LoginSignup
0
0

More than 1 year has passed since last update.

CentOS系へのMeCab導入

Last updated at Posted at 2022-01-25

MeCab (和布蕪)とは

MeCabは 京都大学情報学研究科−日本電信電話株式会社コミュニケーション科学基礎研究所 共同研究ユニットプロジェクトを通じて開発されたオープンソース 形態素解析エンジンです。 言語, 辞書,コーパスに依存しない汎用的な設計を 基本方針としています。 パラメータの推定に Conditional Random Fields (CRF) を用 いており, ChaSenが採用している 隠れマルコフモデルに比べ性能が向上しています。また、平均的に ChaSen, Juman, KAKASIより高速に動作します。 ちなみに和布蕪(めかぶ)は, 作者の好物です。

導入手順

lang-Cs

sudo yum -y install make gcc-c++
make --version <- 確認
g++ --version <- 確認

iconv

wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz
gzip -dc libiconv-1.16.tar.gz | tar xvf -
cd libiconv-1.16
./configure
make
sudo -s
make install
iconv --version <- 確認

mecab

・本体

https://taku910.github.io/mecab/#download
tar zxfv mecab-0.996.tar.gz
./configure --with-charset=utf8
make
make check
sudo -s
make install
exit <- root抜ける

・辞書

https://taku910.github.io/mecab/#download
tar zxfv mecab-ipadic-2.7.0-XXXX.tar.gz
cd mecab-ipadic-2.7.0-XXXX/
./configure --with-charset=utf8
make
sudo -s
make install
exit <- root抜ける
mecab --version <- 確認

・テスト

$ mecab
すもももももももものうち
すもも   名詞,一般,*,*,*,*,すもも,スモモ,スモモ
も 助詞,係助詞,*,*,*,*,も,モ,モ
もも  名詞,一般,*,*,*,*,もも,モモ,モモ
も 助詞,係助詞,*,*,*,*,も,モ,モ
もも  名詞,一般,*,*,*,*,もも,モモ,モモ
の 助詞,連体化,*,*,*,*,の,ノ,ノ
うち  名詞,非自立,副詞可能,*,*,*,うち,ウチ,ウチ
EOS
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0