Difference between revisions of "Apertium on Mac OS X (User)"
(slightly less dangerous script) |
|||
Line 1: | Line 1: | ||
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. |
|||
The first step is to install XCode. To do so, visit [http://itunes.apple.com/ca/app/xcode/id448457090?mt=12 XCode Installer]. |
The first step is to install XCode. To do so, visit [http://itunes.apple.com/ca/app/xcode/id448457090?mt=12 XCode Installer]. |
||
Line 26: | Line 26: | ||
echo "Please type the language code for the language pack you want to install (e.g: en-es)" |
echo "Please type the language code for the language pack you want to install (e.g: en-es)" |
||
read directory |
read directory |
||
svn co http://apertium.svn.sourceforge.net/svnroot/apertium/trunk/apertium- |
svn co http://apertium.svn.sourceforge.net/svnroot/apertium/trunk/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 |
cd lttoolbox |
||
./autogen.sh |
|||
make |
make |
||
sudo make install |
sudo make install |
||
sudo cp /usr/local/lib/pkgconfig/lttool* /opt/local/lib/pkgconfig/ |
|||
cd .. |
cd .. |
||
cd apertium |
cd apertium |
||
./autogen.sh |
|||
make |
make |
||
sudo make install |
sudo make install |
||
sudo cp /usr/local/lib/pkgconfig/aperti* /opt/local/lib/pkgconfig/ |
|||
cd .. |
cd .. |
||
cd apertium- |
cd apertium-$directory |
||
./autogen.sh |
|||
make |
make |
||
sudo make install |
sudo make install |
||
echo |
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> |
</pre> |
||
Line 56: | Line 63: | ||
To change languages, or direction, click on the drop-down menu at the top-right, and select a new direction, or language. |
To change languages, or direction, click on the drop-down menu at the top-right, and select a new direction, or language. |
||
[[Category:Installation]] |
Revision as of 08:23, 21 November 2013
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.
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
- MacPorts for SnowLeopard, or
- MacPorts for Lion, or
- MacPorts for MountainLion, or
- MacPorts for Mavericks,
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 svn co http://apertium.svn.sourceforge.net/svnroot/apertium/trunk/lttoolbox svn co http://apertium.svn.sourceforge.net/svnroot/apertium/trunk/apertium echo "Please type the language code for the language pack you want to install (e.g: en-es)" read directory svn co http://apertium.svn.sourceforge.net/svnroot/apertium/trunk/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 of Apertium, 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.