yma4r
Description
Yahoo Morphological Analyzer wrapper For Ruby
Installation
Archive Installation
rake install
Gem Installation
gem install niku-yma4r
Features/Problems
Synopsis
require ‘yma4r’ yma4r = Yma4r.new(
:appid => 'Your Yahoo Japan Application ID',
:sentence => 'すもももももももものうち',
:results => :ma,
:response => [:surface, :reading, :pos, :baseform]
)
yma4r.parse.ma_result.word_list.each do |e|
puts "surface:#{e.surface}, reading:#{e.reading}, pos:#{e.pos}, baseform:#{e.baseform}"
end
# >> surface:すもも, reading:すもも, pos:名詞, baseform:すもも# >> surface:も, reading:も, pos:助詞, baseform:も# >> surface:もも, reading:もも, pos:名詞, baseform:もも# >> surface:も, reading:も, pos:助詞, baseform:も# >> surface:もも, reading:もも, pos:名詞, baseform:もも# >> surface:の, reading:の, pos:助詞, baseform:の# >> surface:うち, reading:うち, pos:名詞, baseform:うち
SEE ALSO
日本語形態素解析Webサービス: http://developer.yahoo.co.jp/jlp/MAService/V1/parse.html
Copyright
- Author
-
niku <niku at niku.name>
- Copyright
-
Copyright © 2008 niku
- License
-
you can redistribute it and/or modify it under the same terms as Ruby itself.