import MeCab
tagger = MeCab.Tagger('')
tagger.parse('') #This is important! !! !! !!
text = u'Let's play with MeCab!'
node = tagger.parseToNode(text)
while node:
print(node.surface + '\t' + node.feature)
node = node.next
reference: https://shogo82148.github.io/blog/2015/12/20/mecab-in-python3-final/
Recommended Posts