かずきち。の日記

サーバサイドエンジニアのつぶやき

Pythonで形態素分析

import MeCab
m = MeCab.Tagger('-Ochasen')
print m.parse ("明日は晴れです。")
n = m.parseToNode('明日は晴れです。')
n = n.next
while n:
   print n.surface
   print n.feature
   n = n.next