Skip to content

UseAsSpellChecker

eaxelson edited this page Aug 21, 2017 · 3 revisions

Using HFST as spell checker

First, install hfst-ospell. Then install libvoikko: fetch the newest release here and

$ tar zxvf libvoikko-V.V.tar.gz  #  V.V is the version number
$ ./configure --enable-hfst
$ make
$ sudo make install
$ sudo ldconfig   # this is necessarily not needed

Now we can just go about adding the spellers to right directories. For example we can use Finnish speller based on omorfi downloadable from hfst repo:

$ mkdir -p ~/.voikko/3/
$ cp speller-fi.zhfst ~/.voikko/3/

Now you should be able to test the spell-checker by using voikkospell (in lines saying [CTRL-D], press Control key and then D while holding control, do not type [CTRL-D]):

$ voikkospell -l
fi-x-standard: Suomen kielen oikaisuluin (omorfi 20120401)
$ voikkospell -d fi-x-standard 
talo
C: talo
taloq
W: taloq
[CTRL-D]
$ voikkospell -d fi-x-standard  -s
talo
C: talo
taloq
W: taloq
S: talo
S: taloa
S: talot
S: talon
S: Jalon
[CTRL-D]

Now everything works.

You can continue by installing enchant (your distribution should have this, possibly even with voikko support, already), which will provide this spelling functionality to most of the reasonable open source software, such as everything that uses GtkSpell, GnomeSpell or SexySpell widgets. You'll need your LANG environment variable set to the language you're correcting for this to work, unless the software has dictionary selection widgets somehow.

For problematic huge software behemoths like firefox (spell checker extension) or libreoffice (spell checker extension; 64-bit version only (open the extension file with LibreOffice) you need to fetch those specific extensions.

To go about building one such a spelling-checker dictionary for your language, please refer to tutorial on FST spell-checker building in FSMNLP 2012 Donostia or study the finite-state morphology and language resource repository by Divvun/UiT.

Clone this wiki locally