「Mecab/インストール・実装」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→辞書インストール) |
(→linux版ダウンロード&インストール) |
||
| (同じ利用者による、間の3版が非表示) | |||
| 行5: | 行5: | ||
==linux版ダウンロード&インストール== | ==linux版ダウンロード&インストール== | ||
| + | ===rocky10,almalinux9=== | ||
| + | <pre> | ||
| + | # EPELリポジトリ追加 | ||
| + | sudo dnf install epel-release | ||
| + | # CRBリポジトリを有効化 | ||
| + | sudo dnf config-manager --set-enabled crb | ||
| + | sudo dnf install dnf-plugins-core | ||
| + | # 本体追加 | ||
| + | sudo dnf install mecab mecab-devel | ||
| + | # 辞書インストール | ||
| + | sudo dnf install mecab-ipadic | ||
| + | </pre> | ||
| + | |||
| + | ====設定確認==== | ||
| + | <pre> | ||
| + | $ mecab -D | ||
| + | filename: /usr/lib64/mecab/dic/ipadic/sys.dic | ||
| + | </pre> | ||
| + | |||
| + | ===centos7=== | ||
本体 | 本体 | ||
$ cd /usr/local/src | $ cd /usr/local/src | ||
| 行15: | 行35: | ||
$ sudo make install | $ sudo make install | ||
| − | ==インストールエラー対応方法== | + | ====インストールエラー対応方法==== |
configure: error: no acceptable C compiler found in $PATH | configure: error: no acceptable C compiler found in $PATH | ||
configure: error: Your compiler is not powerful enough to compile MeCab. If it should be, see config.log for more information of why it failed. | configure: error: Your compiler is not powerful enough to compile MeCab. If it should be, see config.log for more information of why it failed. | ||
| 行21: | 行41: | ||
$ sudo yum install gcc-c++ | $ sudo yum install gcc-c++ | ||
| − | ==辞書インストール== | + | ====辞書インストール==== |
<pre> | <pre> | ||
wget http://sourceforge.net/projects/mecab/files/mecab-ipadic/2.7.0-20070801/mecab-ipadic-2.7.0-20070801.tar.gz | wget http://sourceforge.net/projects/mecab/files/mecab-ipadic/2.7.0-20070801/mecab-ipadic-2.7.0-20070801.tar.gz | ||
tar zxvf mecab-ipadic-2.7.0-20070801.tar.gz | tar zxvf mecab-ipadic-2.7.0-20070801.tar.gz | ||
cd mecab-ipadic-2.7.0-20070801 | cd mecab-ipadic-2.7.0-20070801 | ||
| − | ./configure --with-mecab-config=/usr | + | ./configure --with-mecab-config=/usr/bin/mecab-config --prefix=/usr/local/ --with-charset=utf8 |
make | make | ||
sudo make install | sudo make install | ||
</pre> | </pre> | ||
| − | ==辞書インストールしてない時のエラー== | + | ====辞書インストールしてない時のエラー==== |
param.cpp(69) [ifs] no such file or directory: /usr/local/lib/mecab/dic/ipadic/dicrc | param.cpp(69) [ifs] no such file or directory: /usr/local/lib/mecab/dic/ipadic/dicrc | ||
2026年4月21日 (火) 03:53時点における最新版
目次
windows版ダウンロード&インストール
- http://mecab.sourceforge.net/
- mecab-0.98.exe実行
linux版ダウンロード&インストール
rocky10,almalinux9
# EPELリポジトリ追加 sudo dnf install epel-release # CRBリポジトリを有効化 sudo dnf config-manager --set-enabled crb sudo dnf install dnf-plugins-core # 本体追加 sudo dnf install mecab mecab-devel # 辞書インストール sudo dnf install mecab-ipadic
設定確認
$ mecab -D filename: /usr/lib64/mecab/dic/ipadic/sys.dic
centos7
本体
$ cd /usr/local/src $ wget https://mecab.googlecode.com/files/mecab-0.996.tar.gz $ tar zxfv mecab-0.996.tar.gz $ cd mecab-0.996 $ ./configure --with-charset=utf8 $ make $ make check $ sudo make install
インストールエラー対応方法
configure: error: no acceptable C compiler found in $PATH configure: error: Your compiler is not powerful enough to compile MeCab. If it should be, see config.log for more information of why it failed. $ sudo yum -y install gcc $ sudo yum install gcc-c++
辞書インストール
wget http://sourceforge.net/projects/mecab/files/mecab-ipadic/2.7.0-20070801/mecab-ipadic-2.7.0-20070801.tar.gz tar zxvf mecab-ipadic-2.7.0-20070801.tar.gz cd mecab-ipadic-2.7.0-20070801 ./configure --with-mecab-config=/usr/bin/mecab-config --prefix=/usr/local/ --with-charset=utf8 make sudo make install
辞書インストールしてない時のエラー
param.cpp(69) [ifs] no such file or directory: /usr/local/lib/mecab/dic/ipadic/dicrc
動作確認
$ echo "すもももももももものうち" | mecab すもも 名詞,一般,*,*,*,*,すもも,スモモ,スモモ も 助詞,係助詞,*,*,*,*,も,モ,モ もも 名詞,一般,*,*,*,*,もも,モモ,モモ も 助詞,係助詞,*,*,*,*,も,モ,モ もも 名詞,一般,*,*,*,*,もも,モモ,モモ の 助詞,連体化,*,*,*,*,の,ノ,ノ うち 名詞,非自立,副詞可能,*,*,*,うち,ウチ,ウチ EOS
