Class: YaCan::Morphem::Morphem

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#baseformObject (readonly)

Returns the value of attribute baseform.



53
54
55
# File 'lib/yacan/morphem.rb', line 53

def baseform
  @baseform
end

#countObject (readonly)

Returns the value of attribute count.



53
54
55
# File 'lib/yacan/morphem.rb', line 53

def count
  @count
end

#featureObject (readonly)

Returns the value of attribute feature.



53
54
55
# File 'lib/yacan/morphem.rb', line 53

def feature
  @feature
end

#posObject (readonly)

Returns the value of attribute pos.



53
54
55
# File 'lib/yacan/morphem.rb', line 53

def pos
  @pos
end

#readingObject (readonly)

Returns the value of attribute reading.



53
54
55
# File 'lib/yacan/morphem.rb', line 53

def reading
  @reading
end

#surfaceObject (readonly)

Returns the value of attribute surface.



53
54
55
# File 'lib/yacan/morphem.rb', line 53

def surface
  @surface
end