Become a language pair developer for Apertium

From Apertium
Revision as of 23:41, 17 December 2011 by BrendenD14 (talk | contribs)
Jump to navigation Jump to search

This is a 3-part, step-by-step guide on how to use a development version of Apertium to make a change in a language pair. These instructions assume that you are using Ubuntu or Debian; if not then please see the Installation page for instructions for other OS's such as Mac OS X or Windows.


There are 2 options as to how you can get Apertium. You can use either the Terminal to get the most up-to-date versions or the Synaptic Package Manager can be used to get development versions that aren't quite as up-to-date. There are pros and cons to each, however, the Terminal method is more for those that intend to submit their work while using the package manager is normally easier and you are using a graphical interface instead of a command line.

YOU DON'T NEED TO KNOW A PROGRAMMING LANGUAGE TO DEVELOP FOR APERTIUM. All development for adding new words is done with a text editor.

Getting Ready

Method 1: TERMINAL

Step 1: Get the Prerequisites

A development version of Apertium and the language pair you want to change has to be installed on your computer first before you can change something about the language pair.

Start by opening a new Terminal.

Then, use this command to install the prerequisites:

sudo apt-get install subversion build-essential g++ pkg-config gawk libxml2 \
> libxml2-dev libxml2-utils xsltproc flex automake autoconf libtool libpcre3-dev

The Terminal will then ask you for your password to begin.

Note: Keep track of how you type your password in your head. The Terminal will not display characters entered for your password for security reasons.

After you have entered your password, press the "Enter" key and wait for your computer to download and install the packages.

Step 2: Get Apertium, lttoolbox, & Your Language Pair(s)

Using the same Terminal, you can download the entire language pairs tree from SVN using the command:

svn co

Keep in mind that the full tree is over 4GB. If you have a slow connection, limited disk space, or a limited data transfer amount, installing the whole tree is not recommended. However, if you want to focus on a small number of language pairs you can easily download and add language pairs with a command such as:

svn co<modulename>

Note: This command only downloads one module at a time. For a more complete set of instructions on effectively using SVN, see the Using SVN page.

In the area where it says <modulename>, you can replace this with the module that you want to use such as the Spanish/English module.

These next commands download Apertium, lttoolbox, and the language pair that you want to use.

svn co
svn co
svn co<modulename>

For example, if you wanted to get Apertium, lttoolbox, and the Spanish/English module you could enter:

svn co
svn co
svn co

Note: You can find a full list of modules at

Final Step: Compilation & Installation

First, you need to compile lttoolbox, Apertium, and your language pair and install them. For this we will use,

cd apertium
cd lttoolbox/
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./
sudo make install
sudo ldconfig

, for lttoolbox. Then,

cd ..
cd apertium/
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./
sudo make install
sudo ldconfig

for Apertium. And finally,

cd ..
cd <modulename>/
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./
sudo make install

,for your language pair which replaces the text <modulename>.

For further instruction, if necessary, see Apertium on Ubuntu.


Using the Synaptic Package Manager to download and install Apertium, lttoolbox, and your language pair is considerably easier than the Terminal method, however, your choice of language pairs is limited, you may be unable to commit changes, and there may possibly be other flaws or minor bugs.

Step 1: Find your Packages

To begin, start by finding the Synaptic Package Manager and opening it.

Then, use the search box and type in "apertium".

Synaptic should bring up a list of everything related to Apertium. This list should include language pairs, the development versions of lttoolbox and libapertium, as well as the Apertium base package and various others.

Step 2: Compilation & Installation

Luckily, Synaptic takes care of getting the prerequisites, dependencies, and other required packages. All you have to do is select which packages you need and have Synaptic download and install them.

Start by selecting the "apertium" checkbox and choose "Mark for Installation" from the drop-down menu.

Synaptic will inform you of Apertium's dependencies and will ask if you want to mark them as well. Click "Mark" in the lower-right of the pop-up box.

Changing Things Around

When you want to make a change in Apertium, you more than likely want to add a word to an existing language pair.

IMPORTANT: Adding a word won't do you any good if you don't recompile the modules after the change is made. Simply use the Terminal like before and enter: make <modulenamehere> and press the "Enter" key and your computer will create the new files necessary.

There are 3 major steps in adding a new word to a language pair:

1. Add an entry to the dictionary for the first language that will be used.

2. Add an entry to the bilingual dictionary for the pair.

3. Add an entry to the dictionary for the second language that will be used.

You will need to find the module you want to work with on your computer and open the three dictionaries; for example:,, and Note: Each dictionary will have the suffix ".dix" You should open these files in a text editor or specialized XML editor.

Step 1: Adding to the First Dictionary


Show it to the World