Hello World from OSS Silicon Valley


HowToUse/MeCab/0.996


#contents

*Prerequisite [#g3dda535]
-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 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("&#12377;&#12418;&#12418;&#12418;&#12418;&#12418;&#12418;&#12418;&#12418;&#12398;&#12358;&#12385;")
 print(result)

:Step.2|
Execute the following command.

 $ python <script name>


*Author [#h54144b0]
S.Yatsuzuka


#back(back,center,0)