Last active
October 24, 2015 15:05
-
-
Save dragstar328/30c63095fa6d9220ca65 to your computer and use it in GitHub Desktop.
CaboCha with Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding:utf-8 | |
import CaboCha | |
mt = CaboCha.Parser() | |
targ = "太郎はこの本を次郎を見た女性に渡した" | |
print mt.parseToString(targ) | |
tree = mt.parse(targ) | |
print "--------------------------" | |
print tree.toString(CaboCha.FORMAT_TREE) | |
print "--------------------------" | |
print tree.toString(CaboCha.FORMAT_LATTICE) | |
print "---------------------------" | |
print tree.toString(CaboCha.FORMAT_XML) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment