Skip to content

Instantly share code, notes, and snippets.

@mackee
Created June 8, 2013 16:17
Show Gist options
  • Save mackee/5735688 to your computer and use it in GitHub Desktop.
Save mackee/5735688 to your computer and use it in GitHub Desktop.
[- o -] $ perl -MText::MeCab -MDDP -E 'my $mecab = Text::MeCab->new; my $text = "もず氏がまた撮られたがってる"; for (my $node = $mecab->parse($text); $node; $node = $node->next) { say "text: ".$node->surface; say "id: ".$node->id; say "feature :".$node->feature}'
text: も
id: 1
feature :助詞,係助詞,*,*,*,*,も,モ,モ
text: ず
id: 4feature :助動詞,*,*,*,特殊・ヌ,連用ニ接続,ぬ,ズ,ズ
text: 氏
id: 6
feature :名詞,一般,*,*,*,*,氏,シ,シ
text: が
id: 10feature :助詞,格助詞,一般,*,*,*,が,ガ,ガ
text: また
id: 17
feature :副詞,助詞類接続,*,*,*,*,また,マタ,マタ
text: 撮ら
id: 26feature :動詞,自立,*,*,五段・ラ行,未然形,撮る,トラ,トラ
text: れ
id: 35
feature :動詞,接尾,*,*,一段,連用形,れる,レ,レ
text: た
id: 36
feature :助動詞,*,*,*,特殊・タイ,ガル接続,たい,タ,タ
text: がっ
id: 47
feature :動詞,接尾,*,*,五段・ラ行,連用タ接続,がる,ガッ,ガッ
text: てる
id: 58
feature :動詞,非自立,*,*,一段,基本形,てる,テル,テル
text:
id: 63
feature :BOS/EOS,*,*,*,*,*,*,*,*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment