Difference between revisions of "How to bootstrap a new pair"

From Apertium
Jump to navigation Jump to search
Line 10: Line 10:
==With two existing monolingual packages==
==With two existing monolingual packages==


Do the two languagues you're making a pair of already have monolingual modules in https://svn.code.sf.net/p/apertium/svn/languages/ (or perhaps https://svn.code.sf.net/p/apertium/svn/incubator )?
First compile the monolingual packages:


Then follow this part, replacing LANG1 and LANG2 for the ISO 639-3 codes of your languages:


Then generate the pair:


First compile the monolingual packages:
<pre>
svn co https://svn.code.sf.net/p/apertium/svn/languages/apertium-LANG1
cd apertium-LANG1
./autogen.sh
make -j
cd ..
svn co https://svn.code.sf.net/p/apertium/svn/languages/apertium-LANG2
cd apertium-LANG2
./autogen.sh
make -j
cd ..
</pre>

Then generate the pair:
<pre>
python3 apertium-init.py LANG1-LANG2
</pre>


Then compile the pair:
Then compile the pair:


<pre>
<pre>
./autogen.sh --with-lang1=../apertium-LANG1 --with-lang2=../apertium-LANG2
./autogen.sh
make -j
./configure --with-lang1=/path/to/apertium-xxx --with-lang2=/path/to/apertium-yyy
</pre>
</pre>


And test:
And test:
<pre>
echo house | apertium -d . LANG1-LANG2
echo Haus | apertium -d . LANG2-LANG1
</pre>

Now you can add words to apertium-LANG1-LANG2.LANG1-LANG2.dix, then test again:

<pre>
make -j
echo house | apertium -d . LANG1-LANG2
echo Haus | apertium -d . LANG2-LANG1
</pre>

If you had to add words to the monolingual dictionaries, you will have to type "make" in those directories first. Alternatively, there is a shortcut from the pair directory: "make langs" should make the monolingual dictionaries even if you're in the pair directory.


==With one existing monolingual package==
==With one existing monolingual package==

Revision as of 07:46, 8 December 2015

Prerequisites

You need to get this installed first:

  • apertium-init
  • apertium/lttoolbox/hfst, see Installation, in particular the prerequisites parts. (You most likely don't need to go all the way to "minimal instlalation from svn", since you should get this stuff from Tino's repositories. If you're on Windows, get the virtualbox)

With two existing monolingual packages

Do the two languagues you're making a pair of already have monolingual modules in https://svn.code.sf.net/p/apertium/svn/languages/ (or perhaps https://svn.code.sf.net/p/apertium/svn/incubator )?

Then follow this part, replacing LANG1 and LANG2 for the ISO 639-3 codes of your languages:


First compile the monolingual packages:

svn co https://svn.code.sf.net/p/apertium/svn/languages/apertium-LANG1
cd apertium-LANG1
./autogen.sh
make -j
cd ..
svn co https://svn.code.sf.net/p/apertium/svn/languages/apertium-LANG2
cd apertium-LANG2
./autogen.sh
make -j
cd ..

Then generate the pair:

python3 apertium-init.py LANG1-LANG2

Then compile the pair:

./autogen.sh --with-lang1=../apertium-LANG1 --with-lang2=../apertium-LANG2
make -j

And test:

echo house | apertium -d . LANG1-LANG2
echo Haus | apertium -d . LANG2-LANG1

Now you can add words to apertium-LANG1-LANG2.LANG1-LANG2.dix, then test again:

make -j
echo house | apertium -d . LANG1-LANG2
echo Haus | apertium -d . LANG2-LANG1

If you had to add words to the monolingual dictionaries, you will have to type "make" in those directories first. Alternatively, there is a shortcut from the pair directory: "make langs" should make the monolingual dictionaries even if you're in the pair directory.

With one existing monolingual package

First make a new monolingual package:

Then compile the monolingual packages:


Then generate the pair:


Then compile the pair:

And test:

With no existing monolingual packages

First make the two monolingual packages:

Then compile the monolingual packages:


Then generate the pair:


Then compile the pair:

And test: