Tux's lil' helper
Joined: 29 May 2005
Location: Ribeirão Preto, Brasil
|Posted: Fri Sep 01, 2006 1:33 pm Post subject: HOW TO use OpenOffice.org dicts in GTK+ apps
|This is an explanation on how to use Myspell/Hunspell dictionaries on GTK+ applications like AbiWord, Tomboy, Inkscape, Evolution etc. The motivation was that Brazilian Portuguese dictionaries for Ispell and Aspell are unmantained for a long time, while OpenOffice.org's counterpart is increasingly comprehensive. Next version of BrOffice.org's spellchecker is expected to have two and a half million words!
The first step is setting Enchant (app-text/enchant), a libraries that allows applications to use any spell checker. Enchant knows how to use Myspell/Hunspell, Aspell, Ispell and others out-of-the-box, but it doesn't know where the dictionaries are! (Except for Aspell dicts.) To have Enchant using a Myspell dictionary, it is necessary to create the ~/.enchant/myspell folder (or /usr/share/enchant/myspell), and put the .dic and .aff files there. Those files may be downloaded from OpenOffice.org, but are also avaliable from the app-dicts/myspell-* ebuilds (in /usr/share/myspell) and the app-office/openoffice ebuild (in /usr/lib/openoffice/share/dict/ooo). If the dictionary files are already installed, you can create a symbolic link between their folder and any one Enchant knows about.
Last step is installing Hunspell (app-text/hunspell). Enchant's ebuild depends on (a) any Aspell dictionary, (b) Ispell, (c) Hspell, or (d) Hunspell, in that order; hence, Hunspell won't be installed by default. It would be even better to emerge Hunspell before an Enchant-aware application is installed, to avoid installing an unnecessary Aspell dictionary.
- This tip was first posted in the Portuguese forum, and later copied to the GNOME Support Forums.
- Hunspell is an extended version of Myspell; it is fully compatible with Myspell dictionaries and is shipped with recent versions of OpenOffice.org.
- GEdit merged GtkSpell source code without the patch that makes this library use Enchant; therefore, GEdit depends directly on Aspell. Version 2.18 should use Enchant for spell checking.
- Besides GtkSpell, GnomeSpell also received a patch to use Enchant instead of using Aspell directly. LibSexy uses Enchant out-of-the-box.
- Ideally Enchant should come aware of the location were the dictionaries reside. It is possible, and it was requested.
- Enchant is used only in GTK+ applications because KDE has its own library for this purpose. It was considered using Enchant in KDE, but developers seamed to prefer improving KSpell2.
- Besides OpenOffice.org, Mozilla applications support Myspell (Firefox, Thunderbird, Seamonkey etc.).
- Examples of applications using Enchant direct or indirectly:
- Misc: AbiWord, Screem, Inkscape, Tomboy.
- E-mail, news and blog: Evolution, Sylpheed, Balsa, Pan, LogJam, Drivel.
- IM: GAIM, Gajim, Gabber, GNU Gadu, GnomeICU, kf, XChat(-GNOME).
- Translation: poEdit, gtranslator.
- 2006-09-11 22:47 UTC: Updates about the GNOME forum and the prevision of word count in the OOo dict.
- 2006-11-13 10:15 UTC: Update about Gedit using Enchant in version 2.18; this tutorial has been published somewhere else (in Portuguese).