- The added line is THIS COLOR.
- The deleted line is THIS COLOR.
#contents
*Prerequisite [#g3dda535]
-xxx installation (You can refer [[Overall/xxx]])
-Cent OS installation (You can refer [[HowToUse/CentOS/6.5]])
*Install&Setup [#he265cef]
:Step.1|
Add repository.
$ sudo rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm
:Step.2|
Update package information.
$ sudo yum makecache
:Step.3|
Install MeCab.
$ sudo yum install mecab mecab-ipadic
$ sudo yum install mecab mecab-ipadic mecab-devel
:Step.4|
Install binding program for python.
$ pip install mecab-python3
*HowToUse [#c0be576b]
**Execute from command [#af050662]
:Step.1|
Execute the morphological analysis in Japanese.
$ mecab
すもももももももものうち
<enter string>
**Execute from python [#v3cb8870]
:Step.1|
Create a sample code as below.
# coding: utf-8
すもも 名詞,一般,*,*,*,*,すもも,スモモ,スモモ
も 助詞,係助詞,*,*,*,*,も,モ,モ
もも 名詞,一般,*,*,*,*,もも,モモ,モモ
も 助詞,係助詞,*,*,*,*,も,モ,モ
もも 名詞,一般,*,*,*,*,もも,モモ,モモ
の 助詞,連体化,*,*,*,*,の,ノ,ノ
うち 名詞,非自立,副詞可能,*,*,*,うち,ウチ,ウチ
import MeCab
m=MeCab.Tagger('mecabrc')
result=m.parse("すもももももももものうち")
print(result)
:Step.2|
Execute the following command.
$ python <script name>
*Author [#h54144b0]
S.Yatsuzuka
#back(back,center,0)