Skip to content

Instantly share code, notes, and snippets.

@orangeclover
Created November 5, 2011 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orangeclover/1341266 to your computer and use it in GitHub Desktop.
Save orangeclover/1341266 to your computer and use it in GitHub Desktop.
形態素解析
// 形態素解析
// https://github.com/sile/gomoku/downloads
// GROOVY_HOME/libにgomoku-0.0.4.jar をコピー
import net.reduls.gomoku.*
for(morpheme in Tagger.parse("我が輩は猫である。名前はまだない。")){
println(morpheme.surface + ":" + morpheme.feature)
}
/*
我が:連体詞,*,*,*,*,*
輩:名詞,一般,*,*,*,*
は:助詞,係助詞,*,*,*,*
猫:名詞,一般,*,*,*,*
で:助動詞,*,*,*,特殊・ダ,連用形
ある:助動詞,*,*,*,五段・ラ行アル,基本形
。:記号,句点,*,*,*,*
名前:名詞,一般,*,*,*,*
は:助詞,係助詞,*,*,*,*
まだ:副詞,助詞類接続,*,*,*,*
ない:形容詞,自立,*,*,形容詞・アウオ段,基本形
。:記号,句点,*,*,*,*
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment