Skip to content

Instantly share code, notes, and snippets.

@nezuQ
Created May 5, 2014 23:11
Show Gist options
  • Save nezuQ/11549730 to your computer and use it in GitHub Desktop.
Save nezuQ/11549730 to your computer and use it in GitHub Desktop.
Ubuntu環境へCaboChaをインストールし、Pythonで呼び出す。 ref: http://qiita.com/nezuq/items/e1ae073b77d966a27f3c
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import CaboCha
c = CaboCha.Parser()
sent = '国境の長いトンネルを抜けると雪国であった。夜の底が白くなった。信号所に汽車が止まった。'
print c.parseToString(sent)
sudo apt-get install mecab libmecab-dev mecab-utils mecab-ipadic-utf8
sudo apt-get install libcabocha-dev
find / -name CaboCha.py
sudo python setup.py install
国境の---D
長い-D
トンネルを-D
抜けると-D
雪国であった。-----D
夜の-D |
底が-D
白くなった。-----D
信号所に---D
汽車が-D
止まった。
EOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment