-
Notifications
You must be signed in to change notification settings - Fork 13
N Best読み
Brooke M. Fujita edited this page Feb 12, 2015
·
1 revision
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))
ニホンゴ
ニッポンゴ
ダイニンキ
オトナゲ
ショシン
ウブ