sudo rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-> 1.noarch.rpm sudo yum install mecab mecab-devel mecab-ipadic -y sudo pip install https://mecab.googlecode.com/files/mecab-python-0.996.tar.gz
mecab.py
# coding: utf-8
import MeCab
m = MeCab.Tagger ("-Ochasen")
print m.parse ("How are you")
python mecab.py
result:
Go Prefix-Noun Connection Mood Kigen Mood Noun-General Ha ha is a particle-a particle How is it? How is it? Noun-adjectival noun stem It's a desho auxiliary verb special / death imperfect form Uuu auxiliary verb invariant basic form Ka Ka Ka Particles-Sub-particles / Parallel particles / Final particles EOS
that's all.
--If you don't have mecab-devel, you will get an error saying that you don't have mecab-config with pip install mecab.
--mecab-ipadic is a dictionary file. People silently put in all three, such as gcc compilation errors, make, and yum.
Recommended Posts