import MeCab
def mecab_list(text):
tagger = MeCab.Tagger("-Ochasen")
tagger.parse('')
node = tagger.parseToNode(text)
word_class = []
while node:
word = node.surface
wclass = node.feature.split(',')
if wclass[0] != u'BOS/EOS':
if wclass[6] == None:
word_class.append((wclass[7]))
else:
word_class.append((wclass[7]))
node = node.next
mojiretsu=''.join(word_class)
return mojiretsu
Kanji → Katakana → Hiragana → Kanji-Konvertierung mit Python, Mecab, GoogleTranslitrate API. Modul zum Auflisten der MeCab-Ausgabe in Python (mecab-python)
Recommended Posts