Install language data by compiling
To start a new language pair, goto How to bootstrap a new pair. The instructions are very different. This page is for existing language data.
If you compiled Apertium core, then you are likely to have everything you need to compile a dictionary or pair. A compile of a pair can fail if it needs a Constraint Grammar or HFST. If that happens, follow instructions under missing dependencies.
If you loaded Apertium core from packages, either from the Apertium or a public repository, then you will need compile tools. For a dictionary or pair, you will not need all the library installs needed for a full compile of Apertium. In operating systems/distros with a minimal build environment, you may only need,
For a fuller list, see *nix (in general) or the instructions on individual operating systems.
Download the language data
To see the available 'released' language pairs, go to https://apertium.github.io/apertium-on-github/source-browser.html and see the column 'trunk'. Pairs in development are in the 'incubator'/'nursery'/'staging' columns.
git clone https://github.com/apertium/apertium-eo-en.git
or also (and quicker):
git clone --depth 1 https://github.com/apertium/apertium-eo-en.git
To see the available 'mature' language mono dictionaries, go to git clone https://github.com/apertium/ and see the column 'languages'.
- Note: please make sure that the directory where you put these files (i.e. where you run the
gitcommand) doesn't contain spaces and other special characters. That may cause errors while compiling/linking.
If you've already got the core tools installed and you download Apertium languages frequently, then there's a script that can download and setup a language data (pair + possible dependencies) for you. The script can look in trunk, staging, nursery, and incubator.
Please consider that the script can not download a mono-dictionary.
If you installed the
apertium-all-dev package, you already have the script running from the commandline,
To get the script and release execution permission, go to the directory where you want your Apertium data to be, and run,
wget https://raw.githubusercontent.com/unhammer/apertium-get/master/apertium-get chmod +x apertium-get
apertium-get script is sophisticated enough to offer help,
Wiki page on the script: Apertium-get
Go into the downloaded directiory and do this,
If a language pair has more dependencies than lt-toolbox and apertium-lex-tools (i.e. the core), the
README should mention it (and the
autogen.sh step should fail with a message about what is missing). The top of this page has links to how to install other dependencies.
Some possible problems,
Some language pairs need code libraries which are not part of Apertium core/lt-tools. You may not know until a compile starts streaming 'fail' messages. If your language pair complains about lacking 'CG3' or 'HFST', you need to install support libraries. See Installation of grammar libraries.
Missing language data
If your pair complains about lacking language data like
apertium-rus, the pair is missing a dictionary. This is happening more nowadays because language pairs are sharing dictionaries. Sharing dictionaries shares effort. If you used the download script above, this will probably not happen. The README should have explained that the pair shares a dictionary. Or maybe you start
autogen.sh then find it fails with a message like,
No package 'apertium-yyy' found
(where yyy is some language code).
If this happens you must treat the missing language as part of a new pair. You can find full instructions at How to bootstrap a new pair. In short, download the missing monodix and place it in the download with the missing language.
make both monodix folders then, in the bidex folder, run the binding configuration, then
cd apertium-xxx-yyy ./autogen.sh --with-lang1=../apertium-xxx --with-lang2=../apertium-yyy make
Reminder: Adjust prefixes
In some rare circumstances, an Apertium core is hand-compiled then placed at a custom prefix. The reasons you chose to do that may mean you need also to install language data at a custom prefix. In which case, we assume you know what you are doing...
Install (or not)
Note: Developers should be careful. Many new/incubator language pairs don't work if installed :-)
If you are developing the language data, do not install. You may confuse results between a development and an installed pair. However, in the rare situation that you are a user who wants to translate only, yet ran a compile, you can install. This should be done from the bidex directory,
cd xxx-yyy make install
When they work, Install quick tests make the world seem better.
For those who are new here, or need a reminder, Install How to use a build.
To start work on the new translation pair, Apertium New Language Pair HOWTO.