Installing existing Apertium data
Installing existing Apertium data is pretty simple. The following example walks you through the installation and testing of apertium-srd-ita, an Italian-to-Sardinian translator.
These instructions assume you have the Apertium core tools installed. All lines starting with $ are meant to be run on a linux shell / command line. Usually you can just copy/paste or type everything after the $ symbol and hit enter.
You'll want to start in a fresh directory appropriate for Ling 073 materials, e.g. ~/ling073/.
Contents
Compiling
The easy way
The following command should get and compile the data.
$ apertium-get srd-ita
If it works, you can skip the next two sections and skip ahead to Testing.
Get the data
Get the monolingual modules. The --depth=1 part is optional, but will ensure you only get the most recent version of the code and not the entire history of revisions.
$ git clone --depth=1 https://github.com/apertium/apertium-ita.git $ git clone --depth=1 https://github.com/apertium/apertium-srd.git
Get the translation module:
$ git clone --depth=1 https://github.com/apertium/apertium-srd-ita.git
Each one of these commands should show that it's retrieving a repository, and should return you to the prompt when done.
Compiling the monolingual modules
$ cd apertium-ita $ ./autogen.sh $ make
The autogen.sh and make commands should both show a certain amount of output, and make take a minute to complete. There may be a couple "Warning" statements, but there should be no "Error" statements.
You'll need to cd ../ to get back to the original directory before continuing. Then repeat, but with the other module:
$ cd apertium-srd $ ./autogen.sh $ make
Compiling the translation module
$ cd apertium-srd-ita $ ./autogen.sh --with-lang1=../apertium-srd --with-lang2=../apertium-ita $ make
As before, the autogen and make lines should each return a certain amount of output, and may take a minute to run.
Testing
If you run the following from within your apertium-srd-ita/ directory (or replace . in the command with the path to that directory),
$ echo "Il secchio era da mettere in quell'angolo." | apertium -d . ita-srd
then you should should get output something like the following:
Su puale fiat in pònnere in cuddu àngulu.
Some non-Sardinian-like output could mean a number of things. If you get an error message, you may have run the command wrong, or you may have screwed up a step in the installation process. Let the instructor or course assistant know if you get something different.