site  contact  subhomenews

Non-English spell-checking

March 15, 2012 — BarryK
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.

Comments

langpack pinstall.sh
Username: BarryK
Ok, I have done it. When MoManager creates a langpack, pinstall.sh now has this in it: [code]#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 [/code] I haven't uploaded this change to the Woof online repo yet.

spellchecking
Username: rodin.s
"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.

Re Abiword spellchecking
Username: BarryK
"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.

hunspell and momanager
Username: BarryK
"Ok, MoManager can now scoop up any hunspell dictionaries when it creates the langpack: [code] #120316 puppy is usually built with english hunspell dictionary. other languages can be found, #refer: http://bkhome.org/archive/blog2/201203/non-english-spell-checking.html, 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 [/code] I will upload momanager soon.


Tags: woof