# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import MeCab

mecab = MeCab.Tagger("-Ochasen") # MeCabオブジェクトを生成
malist = mecab.parse("庭には二羽鶏がいる。") # 形態素解析を行う
print(malist)

# +
tagger = MeCab.Tagger()
tagger.parse('') # parseToNode()の不具合を回避するために必要

node = tagger.parseToNode('すもももももももものうち')

while node:
    print(node.surface, node.feature)
    node = node.next

StarcoderdataJupyterScriptsDedupFiltered