Module: YaCan::Morphem

Defined in:
lib/yacan/morphem.rb

Defined Under Namespace

Classes: MaOrUniq, Morphem, Result

Constant Summary collapse

@@path =
'/MAService/V1/parse'
@@default_params =
{
  'results' => 'ma,uniq',
  'filter' => (1..13).to_a.join('|'),
  'ma_response' => 'surface,reading,pos,baseform,feature',
  'uniq_response' => 'surface,reading,pos,baseform,feature',
}

Class Method Summary collapse

Class Method Details

.analyze(text, params = {}) ⇒ Object



12
13
14
15
16
17
# File 'lib/yacan/morphem.rb', line 12

def analyze(text, params={})
  params['sentence'] = text
  params = @@default_params.merge(params)
  xml = YaCan::YahooAPI.request(@@path, params)
  return Result.new(xml)
end

.parse(text, params = {}) ⇒ Object



19
20
21
# File 'lib/yacan/morphem.rb', line 19

def parse(text, params={})
  analyze(text, params)
end