Non-English spell-checking

A message to all translators! (L18L, esmourguit, rodin.s and vicmz).

Puppy uses Hunspell for spell-checking, for most apps. Currently there is only one language-specific dictionary PET package:

http://distro.ibiblio.org/quirky/pet_packages-noarch/hunspell-en-us-2.pet

Please download this and open it up:

# tar -zxf hunspell-en-us-2.pet

This will give you the template for a non-English dictionary.

You can obtain a non-English dictionary by going here:

http://packages.ubuntu.com/

and do a search for package names "hunspell". You will find, for example "hunspell-de-de". Download it, right-click on it and choose to open with pupzip, and expand it. Then you can get the dictionary files out of it.

What I suggest though, is that we don't create 'hunspell-de-de-1.pet', instead put it into the langpack_de-<date>.pet. That is, put the template and dictionaries into it.
We will then be keeping all required translations in the one langpack, which simplifies things for users.

Note that the template, that is, hunspell-en-us-2.pet, has a 'pinstall.sh' script, you will need to copy the code out of that and put it into the langpack's pinstall.sh -- actually, I should modify MoManager to have that already in pinstall.sh -- will do that now.


Posted on 15 Mar 2012, 8:10


Comments:

Posted on 15 Mar 2012, 8:26 by BarryK
langpack pinstall.sh
Ok, I have done it. When MoManager creates a langpack, pinstall.sh now has this in it:

#120315 maybe have hunspell dictionaries in langpack...

for ONEHUN in `find ./usr/share/hunspell -mindepth 1 -maxdepth 1 -type f -name '*.dic' -o -name '*.aff' | tr '\n' ' '`
do
HUNBASE="`basename $ONEHUN`"
[ -e ./usr/lib/seamonkey ] && ln -snf ../../../share/hunspell/${HUNBASE} ./usr/lib/seamonkey/dictionaries/${HUNBASE}
[ -e ./usr/lib/firefox ] && ln -snf ../../../share/hunspell/${HUNBASE} ./usr/lib/firefox/dictionaries/${HUNBASE}
done


I haven't uploaded this change to the Woof online repo yet.



Posted on 15 Mar 2012, 10:32 by technosaurus
metapackages
Ppm _does_ have dependency tracking, why not use it to make it easier for maintainers to do incremental updates. Just run dir2pet on an empty dir (name of meta-pack) and specify deps. I really wish the devx had something similar split into a few small-medium sized packs ... Would save pulling in unnecessary deps like python/perl/gtkmm...


Posted on 15 Mar 2012, 12:16 by vicmz
Spellchecker for latin languages
The Ubuntu link above doesn't have hunspell-es, hunspell-pt or hunspell-it, although I found these and many more in this Fedora link: http://pkgs.fedoraproject.org/repo/pkgs/


Posted on 15 Mar 2012, 21:49 by rodin.s
spellchecking
I have added hunspell-ru into Russian langpack and spell-checking works. Interesting thing is that I have another dictionary for Abiword (and Poedit). It's called Abispell.
But now I have removed Abispell but spell-checking in Abiword, Poedit and Seamonkey still works. That's great.


Posted on 16 Mar 2012, 8:25 by BarryK
Re Abiword spellchecking
rodin.s,
Yes, hunspell is compatible with aspell and myspell I think.

Sometimes it is just a matter of putting in a symlink to the hunspell dictionaries, so the application can find them. ...if we discover any situation like that, we can put the fix into Woof.

That's what I do with SeaMonkey, just remove it's dictionary files, replace with symlinks to hunspell files. But, SeaMonkey/Firefox does have to be compiled to be hunspell-friendly.



Posted on 16 Mar 2012, 8:59 by BarryK
hunspell and momanager
Ok, MoManager can now scoop up any hunspell dictionaries when it creates the langpack:

  #120316 puppy is usually built with english hunspell dictionary. other languages can be found,

#refer: http://bkhome.org/blog/?viewDetailed=02750, refer also pinstall.sh of langpack.
for ONEHUN in `find /usr/share/hunspell -mindepth 1 -maxdepth 1 -type f -name "${ORIGLANG1}*.dic" -o -name "${ORIGLANG12}*.aff" | tr '\n' ' '`
do
HUNBASE="`basename $ONEHUN`"
mkdir -p /root/langpack_${GENLANG}-${ADATE}/usr/share/hunspell
cp -a -f $ONEHUN /root/langpack_${GENLANG}-${ADATE}/usr/share/hunspell/
#maybe need symlinks for apps that use myspell, refer to example hunspell-en-us-2.pet ...
mkdir -p /root/langpack_${GENLANG}-${ADATE}/usr/share/enchant/myspell
ln -snf ../../hunspell/${HUNBASE} /root/langpack_${GENLANG}-${ADATE}/usr/share/enchant/myspell/${HUNBASE}
mkdir -p /root/langpack_${GENLANG}-${ADATE}/usr/share/myspell/dicts
ln -snf ../../hunspell/${HUNBASE} /root/langpack_${GENLANG}-${ADATE}/usr/share/myspell/dicts/${HUNBASE}
done


I will upload momanager soon.