Skip to content
Brooke M. Fujita edited this page Feb 12, 2015 · 1 revision

N-Best 読み

Obtain the 2 best readings for given kanji (同字異音異義語)

natto-py can also iterate through a list of kanji and obtain their most probable readings, using the yomi option for output_format_type and specifying output of the 2 nbest candidate readings:

from natto import MeCab

nm = MeCab('-Oyomi -N2')

for kanji in ['日本語', '大人気', '初心']:
    print(nm.parse("{}\n".format(kanji))

ニホンゴ
ニッポンゴ

ダイニンキ
オトナゲ

ショシン
ウブ

Previous | Usage Top | Next