Created
August 1, 2014 02:01
-
-
Save buhii/4342154190276f75ebd1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mecab="mecab-0.996" | |
mecab_python="mecab-python-0.996" | |
mecab_googlecode="https://mecab.googlecode.com/files/" | |
if ! type curl > /dev/null; then | |
downloader='wget ' | |
else | |
downloader='curl -O ' | |
fi | |
# Download | |
if [ ! -f "${mecab}.tar.gz" ]; then | |
eval "${downloader}${mecab_googlecode}${mecab}.tar.gz" | |
# Expand, compile and install | |
tar -zxvf "${mecab}.tar.gz" | |
cd ${mecab} | |
./configure --enable-utf8-only --with-charset=utf8 | |
make | |
sudo make install | |
sudo ldconfig | |
cd ".." | |
fi | |
if [ ! -f "${mecab_python}.tar.gz" ]; then | |
eval "${downloader}${mecab_googlecode}${mecab_python}.tar.gz" | |
# Expand, compile and install | |
tar -zxvf "${mecab_python}.tar.gz" | |
cd ${mecab_python} | |
python setup.py install | |
sudo ldconfig | |
cd ".." | |
fi | |
# ipadic | |
mecab_ipadic="mecab-ipadic-2.7.0-20070801" | |
if [ ! -f "${mecab_ipadic}.tar.gz" ]; then | |
eval "${downloader}${mecab_googlecode}${mecab_ipadic}.tar.gz" | |
tar zxvf "${mecab_ipadic}.tar.gz" | |
cd "${mecab_ipadic}" | |
./configure --with-charset=utf-8 | |
make | |
sudo make install | |
cd ".." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment