2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AWS Redhat/Amazon Linux IaaSに最短でmecab環境整えるメモ

Last updated at Posted at 2019-04-27

AWS AMI ID :RHEL-7.6_HVM_GA-20181017-x86_64-0-Hourly2-GP2 (ami-0b500ef59d8335eee)
AWS AMI ID :amzn-ami-hvm-2018.03.0.20181129-x86_64-gp2 (ami-0cd3dfa4e37921605)

ちなみに

$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.6 (Maipo)

※RHELのみ

まずコンパイラから

$ sudo yum install gcc
$ sudo yum install gcc-c++
$ which gcc
/usr/bin/gcc
$ which c++
/usr/bin/c++

mecab本体。文字コード指定に注意(デフォルトだとEUCになる)

$ tar zxvf mecab-0.996.tar.gz
$ cd mecab-0.996
$ ./configure --with-charset=utf8
$ make
$ sudo make install
$ which mecab
/usr/local/bin/mecab

単体で動確すると

$ mecab
param.cpp(69) [ifs] no such file or directory: /usr/local/lib/mecab/dic/ipadic/dicrc

辞書がないエラー

IPA辞書。これも文字コードに注意。

$ tar zxvf mecab-ipadic-2.7.0-20070801.tar.gz
$ cd mecab-ipadic-2.7.0-20070801
$ ./configure --with-charset=utf8
$ make
$ sudo make install

ここまでが目標

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

mecab & IPA辞書のダウンロード

2
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?