Apertium has moved from SourceForge to GitHub.
If you have any questions, please come and talk to us on #apertium on irc.freenode.net or contact the GitHub migration team.

Install language data by compiling

From Apertium
(Difference between revisions)
Jump to: navigation, search
(don't need SVN!)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  +
[[Installation minimale depuis SVN|En français]]
  +
 
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.
 
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.
   
Line 8: Line 10:
 
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,
 
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,
   
* subversion (SVN)
+
* git
 
* autoconf
 
* autoconf
 
* automake
 
* automake
Line 15: Line 17:
   
 
==Download the language data==
 
==Download the language data==
To see the available 'released' language pairs, go to https://svn.code.sf.net/p/apertium/svn/trunk/. Pairs in development are in the incubator/nursery/staging subdirectories of https://svn.code.sf.net/p/apertium/svn/.
+
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.
   
 
e.g.
 
e.g.
   
 
<pre>
 
<pre>
svn checkout https://svn.code.sf.net/p/apertium/svn/trunk/apertium-eo-en
+
git clone https://github.com/apertium/apertium-eo-en.git
 
</pre>
 
</pre>
   
To see the available 'mature' language mono dictionaries, go to https://svn.code.sf.net/p/apertium/svn/languages/.
+
or also (and quicker):
   
* ''Note: please make sure that the directory where you put these files (i.e. where you run the <code>svn</code> command) doesn't contain spaces and other special characters. That may cause errors while compiling/linking.''
+
<pre>
  +
git clone --depth 1 https://github.com/apertium/apertium-eo-en.git
  +
</pre>
  +
  +
  +
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 <code>git</code> command) doesn't contain spaces and other special characters. That may cause errors while compiling/linking.''
   
   
   
 
==== By script ====
 
==== By script ====
If you've already got the core tools installed (apertium, CG, HFST; or the apertium-all-dev package), 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.
+
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.
 
Please consider that the script can not download a mono-dictionary.
  +
  +
If you installed the <code>apertium-all-dev</code> package, you already have the script running from the commandline,
  +
  +
<pre>
  +
apertium-get
  +
</pre>
   
 
To get the script and release execution permission, go to the directory where you want your Apertium data to be, and run,
 
To get the script and release execution permission, go to the directory where you want your Apertium data to be, and run,
Line 74: Line 82:
 
(where yyy is some language code).
 
(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 [[Install Create a new pair]]. In short, download the missing monodix and place it in the download with the missing language. <code>autogen.sh</code> then <code>make</code> both monodix folders then, in the bidex folder, run the binding configuration, then <code>make</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. <code>autogen.sh</code> then <code>make</code> both monodix folders then, in the bidex folder, run the binding configuration, then <code>make</code>,
   
 
<pre>
 
<pre>
Line 106: Line 114:
 
If you have not used Apertium before, try [[Modes introduction]] and [[Monodix basics]].
 
If you have not used Apertium before, try [[Modes introduction]] and [[Monodix basics]].
   
To start the new translation pair, [[Apertium_New_Language_Pair_HOWTO]].
+
To start work on the new translation pair, [[Apertium New Language Pair HOWTO]].
   
If you have made changes and/or improvements to a pair, please see [[Contributing to an existing pair]].
+
If you have made changes and/or improvements to a pair, please see [[Contributing to an existing pair]]. You may even get to [[Using Git]].
   
 
[[Category:Installation]]
 
[[Category:Installation]]

Latest revision as of 05:07, 11 December 2018

En français

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.


[edit] Prerequisites

Contents

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,

  • git
  • autoconf
  • automake

For a fuller list, see *nix (in general) or the instructions on individual operating systems.

[edit] 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.

e.g.

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 git command) doesn't contain spaces and other special characters. That may cause errors while compiling/linking.


[edit] By script

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,

apertium-get

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

The apertium-get script is sophisticated enough to offer help,

./apertium-get -h

Wiki page on the script: Apertium-get


[edit] Configure, build

Go into the downloaded directiory and do this,

./autogen.sh
make

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,

[edit] Missing dependencies

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.

[edit] 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. autogen.sh then make both monodix folders then, in the bidex folder, run the binding configuration, then make,

cd apertium-xxx-yyy
./autogen.sh --with-lang1=../apertium-xxx --with-lang2=../apertium-yyy
make

[edit] 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...


[edit] 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


[edit] Test

When they work, Install quick tests make the world seem better.


[edit] Useful links

For those who are new here, or need a reminder, Install How to use a build.

If you have not used Apertium before, try Modes introduction and Monodix basics.

To start work on the new translation pair, Apertium New Language Pair HOWTO.

If you have made changes and/or improvements to a pair, please see Contributing to an existing pair. You may even get to Using Git.

Personal tools