Created
October 8, 2010 05:27
-
-
Save hideki/616403 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import MeCab | |
m = MeCab.Tagger("-Ochasen") | |
print m.parse("今日は初めてGrouponでクーポンを買った。") |
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
$ ./mecab-test.py | |
今日 キョウ 今日 名詞-副詞可能 | |
は ハ は 助詞-係助詞 | |
初めて ハジメテ 初めて 副詞-一般 | |
Groupon Groupon Groupon 名詞-一般 | |
で デ で 助詞-格助詞-一般 | |
クーポン クーポン クーポン 名詞-一般 | |
を ヲ を 助詞-格助詞-一般 | |
買っ カッ 買う 動詞-自立 五段・ワ行促音便 連用タ接続 | |
た タ た 助動詞 特殊・タ 基本形 | |
。 。 。 記号-句点 | |
EOS |
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
Install: | |
$ sudo port install py25-mecab | |
Test: | |
$ python -c "import MeCab" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment