Using Giellatekno Divvun spellers with LibreOffice-Voikko on Debian

From Apertium
Jump to navigation Jump to search

This shows how to get Northern Saami spell checking under LibreOffice (and on the command line) on Ubuntu/Debian, using the Voikko plugins and Giellatekno/Divvun language data.

The guide should also be applicable to other languages supported by Giellatekno/Divvun or Apertium that are set up with spelling.

Install prerequisites

wget http://apertium.projectjj.com/apt/install-nightly.sh
sudo bash install-nightly.sh
sudo apt-get install libreoffice-voikko


Now we would like to do sudo apt-get install libvoikko-dev, but unfortunately that package is currently outdated (gives E: Initialižation of Voikko failed: No valid dictionaries were found), so we have to compile it manually:

sudo apt-get install hfst-ospell-dev \
  locales build-essential automake git pkg-config libtool
git clone https://github.com/voikko/corevoikko/
cd corevoikko/libvoikko
./autogen.sh
./configure --with-dictionary-path=/usr/share/voikko:/usr/lib/voikko --enable-hfst
make -j4
sudo make install
echo 'export LD_LIBRARY_PATH=/usr/local/lib:"${LD_LIBRARY_PATH}"' >> ~/.bash_profile
echo 'export PATH=/usr/local/bin:"${PATH}"' >> ~/.bash_profile

Now close your terminal and open a new one.

Install the language data

Installing Giellatekno/Divvun language data

You can see available Giellatekno/Divvun language packages by doing

apt-cache search giella single

We want Northern Saami, so we do:

sudo apt-get install giella-sme

But Giellatekno/Divvun packages currently install the actual speller data into a non-standard directory; we'll put it in a special folder inside our home folder which is always searched.

First we check where the speller data file is:

dpkg -L giella-sme | grep zhfst$

This should show something like /usr/lib/x86_64-linux-gnu/voikko/3/se.zhfst.

Then we make our target folder and copy the file there:

mkdir -p ~/.voikko/3
cp /usr/lib/x86_64-linux-gnu/voikko/3/se.zhfst ~/.voikko/3/


Installing Apertium language data

You can also search for apertium in case you want a language covered there:

apt-cache search apertium single

Say we want Kazakh:

apt-cache search apertium-kaz

Not all Apertium packages have speller-data, so to avoid disappointment we first check that there's speller data in there:

dpkg -L apertium-kaz | grep zhfst$

That gives us something like /usr/share/apertium/apertium-kaz/kaz.zhfst, which is what we want. But again, it's in a non-standard directory, so we copy it into ~/.voikko/3, and also give it a name that LibreOffice will understand:

mkdir -p ~/.voikko/3
cp /usr/share/apertium/apertium-kaz/kaz.zhfst ~/.voikko/3/kk.zhfst


Test the speller from the command line

echo gafe | voikkospell -s -d se

This should give something like:

W: gafe
S: gáfe
S: gábe
S: gáfen
S: gáfes
S: gáffe

Test in LibreOffice-Voikko

This is where you change languages for your text
  • In the status line at the bottom of your document, click on the fourth tab to change language (you may have to select all your text first, if you've already written something)
  • It probably won't be listed, so click "More …" and select "Saami, Northern" (it may also be listed as e.g. "Nordsamisk (Noreg)").


Example underlines for Kazakh

Now you should get red lines under words :-)


For some languages, you can select them as Document language under Tools→Options→Language Settings→Languages→Default Languages for Documents. Unfortunately, this does not (yet) go for Northern Saami, but it works for e.g. Kazakh.

Problems

If there is any other problem, get in touch and we'll try to help.