Class: YaCan::Morphem::Morphem
- Inherits:
-
Object
- Object
- YaCan::Morphem::Morphem
- Defined in:
- lib/yacan/morphem.rb
Instance Attribute Summary collapse
-
#baseform ⇒ Object
readonly
Returns the value of attribute baseform.
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#feature ⇒ Object
readonly
Returns the value of attribute feature.
-
#pos ⇒ Object
readonly
Returns the value of attribute pos.
-
#reading ⇒ Object
readonly
Returns the value of attribute reading.
-
#surface ⇒ Object
readonly
Returns the value of attribute surface.
Instance Method Summary collapse
-
#initialize(xml) ⇒ Morphem
constructor
A new instance of Morphem.
Constructor Details
#initialize(xml) ⇒ Morphem
Returns a new instance of Morphem.
45 46 47 48 49 50 51 52 |
# File 'lib/yacan/morphem.rb', line 45 def initialize(xml) @count = xml.at('count').text.to_i rescue nil @surface = xml.at('surface').text @reading = xml.at('reading').text rescue nil @pos = xml.at('pos').text @baseform = xml.at('baseform').text rescue nil @feature = xml.at('feature').text.split(',') rescue nil end |
Instance Attribute Details
#baseform ⇒ Object (readonly)
Returns the value of attribute baseform.
53 54 55 |
# File 'lib/yacan/morphem.rb', line 53 def baseform @baseform end |
#count ⇒ Object (readonly)
Returns the value of attribute count.
53 54 55 |
# File 'lib/yacan/morphem.rb', line 53 def count @count end |
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
53 54 55 |
# File 'lib/yacan/morphem.rb', line 53 def feature @feature end |
#pos ⇒ Object (readonly)
Returns the value of attribute pos.
53 54 55 |
# File 'lib/yacan/morphem.rb', line 53 def pos @pos end |
#reading ⇒ Object (readonly)
Returns the value of attribute reading.
53 54 55 |
# File 'lib/yacan/morphem.rb', line 53 def reading @reading end |
#surface ⇒ Object (readonly)
Returns the value of attribute surface.
53 54 55 |
# File 'lib/yacan/morphem.rb', line 53 def surface @surface end |