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.

Apertium on Mac OS X (User)

From Apertium
(Difference between revisions)
Jump to: navigation, search
(This guide will detail how to install the Apertium, an open-source machine translation engine. It is meant to be very user-friendly.)
 
(add link to updated instructions)
 
(11 intermediate revisions by 6 users not shown)
Line 1: Line 1:
This guide will detail how to install the Apertium, an open-source machine translation engine. It is meant to be very user-friendly.<br />
+
<div style="background-color:pink; text-align:center; line-height:2.5; border: 1px solid crimson;">Are you sure this is the page you want?<br/>If not, you probably actually want [[Apertium_on_Mac_OS_X]]<br/>If you're here because the instructions on that page didn't work for you, log on to [[IRC]] and describe what went wrong.</div>
   
The first step is to install XCode.<br />
 
To do so, visit<br />
 
[http://itunes.apple.com/ca/app/xcode/id448457090?mt=12 XCode Installer]<br />
 
in a web browser. Click on “View in the Mac App Store”, and once the Mac App Store opens, install XCode. Once the download is complete, go into your Applications folder, and open “Install XCode” Go through the installer.<br />
 
Once that is completed, you can install MacPorts.<br />
 
To do this, download either of <br />
 
[https://distfiles.macports.org/MacPorts/MacPorts-2.0.3-10.6-SnowLeopard.dmg MacPorts] <br />
 
for Snow Leopard, or<br />
 
[https://distfiles.macports.org/MacPorts/MacPorts-2.0.3-10.7-Lion.dmg MacPorts]<br />
 
for Lion, depending on what version of Mac OS X you are running.<br />
 
After MacPorts finishes downloading, open the downloaded file. Double click on the installer package inside the window that opens. Go through the installation procedure. <br />
 
Once finished installing, you need to reboot your Mac.<br />
 
   
When you get back to your desktop, open the Utilities folder inside of the Applications folder. Then, open Terminal. Type the following commands, separated by the return key.<br />
+
<span style="color: #f00;">You can run [https://apertium.projectjj.com/osx/install-release.sh install-release.sh] or [https://apertium.projectjj.com/osx/install-nightly.sh install-nightly.sh] to install the latest compiled version of apertium, lttoolbox, vislcg3 and HFST that way you don't have to check out, build and install these by hand.</span> You will still need gawk, git, autoconf, automake, pkgconfig from MacPorts.
   
<code>
+
This guide will detail how to install the Apertium, an open-source machine translation engine, on Mac OS X. It is meant to be very user-friendly. If you know your way around the terminal, you should follow [[Installation]] instead.
cd ~<br />
+
sudo port install autoconf automake expat flex gettext gperf help2man libiconv libtool libxml2 libxslt m4 ncurses ncursesw p5-locale-gettext pcre perl5.8 pkgconfig zlib gawk subversion<br />
+
The first step is to install XCode. To do so, visit [http://itunes.apple.com/ca/app/xcode/id448457090?mt=12 XCode Installer].
mkdir apertiumBuild<br />
+
Click on “View in the Mac App Store”, and once the Mac App Store opens, install XCode. Once the download is complete, go into your Applications folder, and open “Install XCode” Go through the installer.
cd apertiumBuild<br />
+
svn co http://apertium.svn.sourceforge.net/svnroot/apertium/trunk/lttoolbox<br />
+
Once that is completed, you can install MacPorts. To do this, download either of
svn co http://apertium.svn.sourceforge.net/svnroot/apertium/trunk/apertium<br />
+
* [https://distfiles.macports.org/MacPorts/MacPorts-2.2.1-10.6-SnowLeopard.pkg MacPorts for SnowLeopard], or
echo "Please type the language code for the language pack you want to install (e.g: en-es)"<br />
+
* [https://distfiles.macports.org/MacPorts/MacPorts-2.2.1-10.7-Lion.pkg MacPorts for Lion], or
read directory<br />
+
* [https://distfiles.macports.org/MacPorts/MacPorts-2.2.1-10.8-MountainLion.pkg MacPorts for MountainLion], or
svn co http://apertium.svn.sourceforge.net/svnroot/apertium/trunk/apertium-`echo $directory` <br />
+
* [https://distfiles.macports.org/MacPorts/MacPorts-2.2.1-10.9-Mavericks.pkg MacPorts for Mavericks],
cd lttoolbox <br />
+
depending on what version of Mac OS X you are running.
PKG_CONFIG_PATH=/opt/local/lib/pkgconfig ./autogen.sh <br />
+
make <br />
+
After MacPorts finishes downloading, open the downloaded file. Double click on the installer package inside the window that opens. Go through the installation procedure.
sudo make install <br />
+
sudo cp /usr/local/lib/pkgconfig/lttool* /opt/local/lib/pkgconfig/<br />
+
Once finished installing, you need to reboot your Mac.
cd ..<br />
+
cd apertium<br />
+
When you get back to your desktop, open the Utilities folder inside of the Applications folder. Then, open Terminal. Paste the following commands:
PKG_CONFIG_PATH=/opt/local/lib/pkgconfig ./autogen.sh<br />
+
make<br />
+
<pre>
sudo make install<br />
+
cd ~
sudo cp /usr/local/lib/pkgconfig/aperti* /opt/local/lib/pkgconfig/<br />
+
sudo port install autoconf automake expat flex gettext gperf help2man libiconv libtool libxml2 libxslt m4 ncurses p5-locale-gettext pcre perl5.8 pkgconfig zlib gawk subversion
cd .. <br />
+
mkdir apertiumBuild
cd apertium-`echo $directory` <br />
+
cd apertiumBuild
PKG_CONFIG_PATH=/opt/local/lib/pkgconfig ./autogen.sh <br />
+
git clone https://github.com/apertium/lttoolbox.git
make <br />
+
git clone https://github.com/apertium/apertium.git
sudo make install <br />
+
echo "Please type the language code for the language pack you want to install (e.g: en-es)"
echo "Done!" <br />
+
read directory
</code>
+
git clone https://github.com/apertium/apertium-$directory
<sub>Note: If you copy and paste these commands, ensure there are no line breaks in the middle of the command.</sub><br />
+
LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
This will download, and install Apertium. Part way through these commands, you will be asked for the language code for the language pack you wish to install. To find this language code, open<br />
+
export LD_LIBRARY_PATH
[http://wiki.apertium.org/wiki/Main_Page Apertium Wiki]<br />
+
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH}
in a web browser. At the top of the page, there is a box, which has the list of all stable language packs, followed by the language code in brackets. Enter the language code you want to install into the script, without the brackets. Press the return key when finished.<br />
+
export PKG_CONFIG_PATH
Once the command have completed, Apertium has been installed!<br />
+
cd lttoolbox
To test your installation of Apertium, open <br />
+
./autogen.sh
[http://javabog.dk:8080/apertium-viewer/launch.jnlp Apertium-Viewer]<br />
+
make
in a browser. Click allow, when it requests access to your computer.<br />
+
sudo make install
Once loaded, click “Hide Intermediate” at the top of the window, until you see your input text (“Hello! This is a test.” is the default), and your output text (“Hola! Esto es una prueba.”, for en-es, or English-Spanish).<br /> To change languages, or direction, click on the drop-down menu at the top-right, and select a new direction, or language.<br />
+
cd ..
  +
cd apertium
  +
./autogen.sh
  +
make
  +
sudo make install
  +
cd ..
  +
cd apertium-$directory
  +
./autogen.sh
  +
make
  +
sudo make install
  +
echo 'Done!'
  +
echo "Now append the following lines to the file ~/.bashrc if you haven't done so already:"
  +
echo 'LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}'
  +
echo 'export LD_LIBRARY_PATH'
  +
echo 'PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH}'
  +
echo 'export PKG_CONFIG_PATH'
  +
</pre>
  +
  +
  +
This will download, and install Apertium. Part way through these commands, you will be asked for the language code for the language pack you wish to install. To find this language code, see [[Main_Page]]. At the top of the page, there is a box which has the list of all stable language packs, followed by the language code in brackets. Enter the language code you want to install into the script, without the brackets. Press the return key when finished.<br />
  +
  +
Once the command have completed, Apertium has been installed!
  +
  +
To test your installation from the terminal, paste this command:
  +
<pre>
  +
apertium -l
  +
</pre>
  +
It should list the possible translation directions. You should now be able to translate like this:
  +
<pre>
  +
echo some test sentence | apertium from-to
  +
</pre>
  +
replacing "from-to" with the translation direction given in the previous step.
  +
  +
To test your installation of Apertium with a graphical interface, open [http://javabog.dk:8080/apertium-viewer/launch.jnlp Apertium-Viewer]. Click allow, when it requests access to your computer.
  +
  +
Once loaded, click “Hide Intermediate” at the top of the window, until you see your input text (“Hello! This is a test.” is the default), and your output text (“Hola! Esto es una prueba.”, for en-es, or English-Spanish).
  +
  +
To change languages, or direction, click on the drop-down menu at the top-right, and select a new direction, or language.
  +
  +
  +
[[Category:Installation]]
  +
[[Category:Documentation in English]]

Latest revision as of 20:35, 12 May 2019

Are you sure this is the page you want?
If not, you probably actually want Apertium_on_Mac_OS_X
If you're here because the instructions on that page didn't work for you, log on to IRC and describe what went wrong.


You can run install-release.sh or install-nightly.sh to install the latest compiled version of apertium, lttoolbox, vislcg3 and HFST – that way you don't have to check out, build and install these by hand. You will still need gawk, git, autoconf, automake, pkgconfig from MacPorts.

This guide will detail how to install the Apertium, an open-source machine translation engine, on Mac OS X. It is meant to be very user-friendly. If you know your way around the terminal, you should follow Installation instead.

The first step is to install XCode. To do so, visit XCode Installer. Click on “View in the Mac App Store”, and once the Mac App Store opens, install XCode. Once the download is complete, go into your Applications folder, and open “Install XCode” Go through the installer.

Once that is completed, you can install MacPorts. To do this, download either of

depending on what version of Mac OS X you are running.

After MacPorts finishes downloading, open the downloaded file. Double click on the installer package inside the window that opens. Go through the installation procedure.

Once finished installing, you need to reboot your Mac.

When you get back to your desktop, open the Utilities folder inside of the Applications folder. Then, open Terminal. Paste the following commands:

cd ~
sudo port install autoconf automake expat flex gettext gperf help2man libiconv libtool libxml2 libxslt m4 ncurses p5-locale-gettext pcre perl5.8  pkgconfig zlib gawk subversion
mkdir apertiumBuild
cd apertiumBuild
git clone https://github.com/apertium/lttoolbox.git
git clone https://github.com/apertium/apertium.git
echo "Please type the language code for the language pack you want to install (e.g: en-es)"
read directory
git clone https://github.com/apertium/apertium-$directory
LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH}
export PKG_CONFIG_PATH
cd lttoolbox 
./autogen.sh 
make 
sudo make install 
cd ..
cd apertium
./autogen.sh
make
sudo make install
cd .. 
cd apertium-$directory
./autogen.sh 
make 
sudo make install 
echo 'Done!'
echo "Now append the following lines to the file ~/.bashrc if you haven't done so already:"
echo 'LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}'
echo 'export LD_LIBRARY_PATH'
echo 'PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH}'
echo 'export PKG_CONFIG_PATH'


This will download, and install Apertium. Part way through these commands, you will be asked for the language code for the language pack you wish to install. To find this language code, see Main_Page. At the top of the page, there is a box which has the list of all stable language packs, followed by the language code in brackets. Enter the language code you want to install into the script, without the brackets. Press the return key when finished.

Once the command have completed, Apertium has been installed!

To test your installation from the terminal, paste this command:

apertium -l

It should list the possible translation directions. You should now be able to translate like this:

echo some test sentence | apertium from-to

replacing "from-to" with the translation direction given in the previous step.

To test your installation of Apertium with a graphical interface, open Apertium-Viewer. Click allow, when it requests access to your computer.

Once loaded, click “Hide Intermediate” at the top of the window, until you see your input text (“Hello! This is a test.” is the default), and your output text (“Hola! Esto es una prueba.”, for en-es, or English-Spanish).

To change languages, or direction, click on the drop-down menu at the top-right, and select a new direction, or language.

Personal tools