Linux あるいは Mac OS X でMeCab(和布蕪)をインストール.
さらに CaBoCha (南瓜,カボチャ)をインストール.こっちは、結構大変
MeCab? 和布蕪 http://mecab.sourceforge.net/ をインストール
tar zxf mecab-0.9+.tar.gz cd mecab-0.9+ ./configure --with-charset=utf8 make sudo make install sudo ldconfig
sudo ldconfig を実行し,libmecab.so を登録しておく.
和布蕪 MecaB の辞書
tar zxf mecab-ipadic-2.7.0-20070****.tar.gz cd mecab-ipadic-2.7.0-20070**** ./configure --with-charset=utf-8 make sudo make install
MeCab? を上の手順でインストールしておきます.
次にTinySVM をインストール http://chasen.org/~taku/software/TinySVM/
./configure make make check suso make install
次のようなエラーが出た場合(特にMac OS X)
c++ -DHAVE_CONFIG_H -I. -I. -I.. -Wall -O9 -funroll-all-loops - finline -ffast-math -mieee-fp -c param.cpp -fno-common -DPIC -o .libs/param.lo ./getopt.h:131: error: declaration of C function 'int getopt()' conflicts with /usr/include/unistd.h:454: error: previous declaration 'int getopt(int, char* const*, const char*)' here
./src/getopt.hの131行目を以下のように修正
/* extern int getopt (); */ /* こちらがオリジナル */ extern int getopt (int argc, char *const *argv, const char *shortopts);
さらに./libtool というスクリプトで archive_cmds から始まる行を探し, その行の \$CC を g++ に変更
# Commands used to build and install a shared archive. archive_cmds="g++ \$(test .\$module = .yes && echo -bundle || echo -dynamiclib) \$allow_undefined_flag -o \$lib \$libobjs \ $deplibs\$linkopts -install_name \$rpath/\$soname \$(test -n \\"\$verstring\\\" -a x\$verstring != x0.0 && echo \$verstring)"
この情報はここを参考にした
そして飲茶 YamCha? http://chasen.org/~taku/software/yamcha/
tar zxf yamcha-0.33.tar.gz cd yamcha-0.33 ./configure make make check sudo make install
次のようなエラーが出た場合(特にMac OS X)
configure: error: svm_learn (TinySVM or SVM^light) required for training
configureを次のように実行します。
./configure --with-svm-learn=/usr/local/bin
CRF++をインストール http://crfpp.sourceforge.net/
tar zxf CRF++-0.51.tar.gz cd CRF++-0.51 .configure make sudo make install
ようやく南瓜 Cabocha http://sourceforge.net/projects/cabocha/
bzip2 -cd cabocha-0.60pre2.tar.bz2 | tar xf - cd cabocha-0.60pre2 ./configure --with-charset=UTF8 make sudo make install
なお古い南瓜 http://chasen.org/~taku/software/cabocha/ はutf-8に対応していません.詳しくは日録2007_10月
面倒ではあったが,速度は異様に早い.