Class: YaCan::Morphem::MaOrUniq

Inherits:
Object
  • Object
show all
Defined in:
lib/yacan/morphem.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ MaOrUniq

Returns a new instance of MaOrUniq.



36
37
38
39
40
# File 'lib/yacan/morphem.rb', line 36

def initialize(xml)
  @total_count = xml.at('total_count').text.to_i rescue nil
  @filtered_count = xml.at('filtered_count').text.to_i rescue nil
  @morphems = xml.search('word').map{ |w| Morphem.new(w) } rescue nil
end

Instance Attribute Details

#filtered_countObject (readonly)

Returns the value of attribute filtered_count.



41
42
43
# File 'lib/yacan/morphem.rb', line 41

def filtered_count
  @filtered_count
end

#morphemsObject (readonly)

Returns the value of attribute morphems.



41
42
43
# File 'lib/yacan/morphem.rb', line 41

def morphems
  @morphems
end

#total_countObject (readonly)

Returns the value of attribute total_count.



41
42
43
# File 'lib/yacan/morphem.rb', line 41

def total_count
  @total_count
end