Class: YaCan::Dependency::Result
- Inherits:
-
Object
- Object
- YaCan::Dependency::Result
- Defined in:
- lib/yacan/dependency.rb
Instance Attribute Summary collapse
-
#chunks ⇒ Object
readonly
Returns the value of attribute chunks.
-
#morphems ⇒ Object
readonly
Returns the value of attribute morphems.
-
#xml ⇒ Object
readonly
Returns the value of attribute xml.
Instance Method Summary collapse
-
#initialize(xml) ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize(xml) ⇒ Result
Returns a new instance of Result.
17 18 19 20 21 22 |
# File 'lib/yacan/dependency.rb', line 17 def initialize(xml) @xml = xml xml_chunks = Nokogiri::XML(xml).search('Chunk') @chunks = xml_chunks.map{ |c| Chunk.new(c, lambda{ @chunks }) } @morphems = chunks.map{|c| c.morphems}.flatten end |
Instance Attribute Details
#chunks ⇒ Object (readonly)
Returns the value of attribute chunks.
24 25 26 |
# File 'lib/yacan/dependency.rb', line 24 def chunks @chunks end |
#morphems ⇒ Object (readonly)
Returns the value of attribute morphems.
24 25 26 |
# File 'lib/yacan/dependency.rb', line 24 def morphems @morphems end |
#xml ⇒ Object (readonly)
Returns the value of attribute xml.
24 25 26 |
# File 'lib/yacan/dependency.rb', line 24 def xml @xml end |