Sha256: 68691b45cbd1332e7223cc1ae59bcbd0ca1528ed0a89676f3996b02202442404
Contents?: true
Size: 1.75 KB
Versions: 1
Compression:
Stored size: 1.75 KB
Contents
<!----------------------------> <!-- multilingual suffix: en, ja --> <!-- no suffix: en --> <!----------------------------> <!-- $ mmg README.base.md --> # kampyo [](https://badge.fury.io/rb/kampyo) kampyo is a library for conveniently manipulating Cabocha and Mecab. kampyo has its own analysis function. Unique features already implemented are subject and predicate, and stylistic inference. # Guide Basic usage with Cabocha. ``` text = Kampyo::Text.new text.cabocha_parser("今日は雨です") ``` You will get the following result. ``` {:chunks=>[{:id=>1, :link=>2, :score=>0.0}, {:id=>2, :link=>-1, :score=>0.0}], :tokens=> [{:id=>1, :chunk=>1, :surface=>"今日", :feature1=>"名詞", :feature2=>"副詞可能", :baseform=>"今日", :reading=>"キョウ", :ext_reading=>nil}, {:id=>2, :chunk=>1, :surface=>"は", :feature1=>"助詞", :feature2=>"係助詞", :baseform=>"は", :reading=>"ハ", :ext_reading=>nil}, {:id=>3, :chunk=>2, :surface=>"雨", :feature1=>"名詞", :feature2=>"一般", :baseform=>"雨", :reading=>"アメ", :ext_reading=>nil}, {:id=>4, :chunk=>2, :surface=>"です", :feature1=>"助動詞", :feature2=>"*", :baseform=>"です", :reading=>"デス", :ext_reading=>nil}]} ``` Guess the subject, predicate and sentence system. ``` text = Kampyo::Text.new text.analysis(text.cabocha_parser("今日は雨です")) ``` You will get the following result. ``` {:subject=>{:id=>1, :chunk=>1, :surface=>"今日", :feature1=>"名詞", :feature2=>"副詞可能", :baseform=>"今日", :reading=>"キョウ", :ext_reading=>nil}, :predicate=>{:id=>3, :chunk=>2, :surface=>"雨", :feature1=>"名詞", :feature2=>"一般", :baseform=>"雨", :reading=>"アメ", :ext_reading=>nil}, :tod=>"断定"} ```
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
kampyo-0.2.0 | README.base.md |