Class: YaCan::Morphem::MaOrUniq
- Inherits:
-
Object
- Object
- YaCan::Morphem::MaOrUniq
- Defined in:
- lib/yacan/morphem.rb
Instance Attribute Summary collapse
-
#filtered_count ⇒ Object
readonly
Returns the value of attribute filtered_count.
-
#morphems ⇒ Object
readonly
Returns the value of attribute morphems.
-
#total_count ⇒ Object
readonly
Returns the value of attribute total_count.
Instance Method Summary collapse
-
#initialize(xml) ⇒ MaOrUniq
constructor
A new instance of MaOrUniq.
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_count ⇒ Object (readonly)
Returns the value of attribute filtered_count.
41 42 43 |
# File 'lib/yacan/morphem.rb', line 41 def filtered_count @filtered_count end |
#morphems ⇒ Object (readonly)
Returns the value of attribute morphems.
41 42 43 |
# File 'lib/yacan/morphem.rb', line 41 def morphems @morphems end |
#total_count ⇒ Object (readonly)
Returns the value of attribute total_count.
41 42 43 |
# File 'lib/yacan/morphem.rb', line 41 def total_count @total_count end |