MeCabで辞書を追加する

mecabの文字コードの確認

$ mecab -P | grep config-charset
config-charset: EUC-JP

http://sourceforge.jp/projects/naist-jdic/から辞書を落としてくる

解凍して、解凍後のファイルに移動

文字コードをutf8にしてインストール

$ ./configure --prefix=$HOME/local --with-charset=utf8
$ make
/usr/local/libexec/mecab/mecab-dict-index -d . -o . -f EUC-JP -t utf8
reading ./unk.def ... 40
emitting double-array: 100% |###########################################| 
reading ./naist-jdic.csv ... 485863
emitting double-array: 100% |###########################################| 
reading ./matrix.def ... 1396x1396
emitting matrix      : 100% |###########################################| 

done!
To enable dictionary, rewrite /usr/local/etc/mecabrc as "dicdir = /usr/local/lib/mecab/dic/naist-jdic"
$ sudo make install
Password:
/Applications/Xcode.app/Contents/Developer/usr/bin/make  install-exec-hook
if ! [ -d /etc/mecab/dic/naist-jdic ]; \
        then mkdir -p /etc/mecab/dic/naist-jdic; \
    fi
if ! [ -f /etc/mecab/dic/naist-jdic/dicrc ]; \
        then ln -s /usr/local/lib/mecab/dic/naist-jdic/dicrc /etc/mecab/dic/naist-jdic/dicrc; \
    fi
test -z "/usr/local/lib/mecab/dic/naist-jdic" || ./install-sh -c -d "/usr/local/lib/mecab/dic/naist-jdic"
 /usr/bin/install -c -m 644 matrix.bin char.bin sys.dic unk.dic naist-jdic.csv char.def feature.def left-id.def matrix.def pos-id.def rewrite.def right-id.def unk.def dicrc '/usr/local/lib/mecab/dic/naist-jdic'

To enable dictionary, rewrite /usr/local/etc/mecabrc as “dicdir = /usr/local/lib/mecab/dic/naist-jdic”

に従えば終わり・・・かな?