Class: YaCan::Dependency::Morphem

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ Morphem

Returns a new instance of Morphem.



53
54
55
56
57
58
59
# File 'lib/yacan/dependency.rb', line 53

def initialize(xml)
  @surface = xml.at('Surface').text
  @reading = xml.at('Reading').text
  @baseform = xml.at('Baseform').text
  @pos = xml.at('POS').text
  @feature = xml.at('Feature').text.split(',')
end

Instance Attribute Details

#baseformObject (readonly)

Returns the value of attribute baseform.



65
66
67
# File 'lib/yacan/dependency.rb', line 65

def baseform
  @baseform
end

#featureObject (readonly)

Returns the value of attribute feature.



65
66
67
# File 'lib/yacan/dependency.rb', line 65

def feature
  @feature
end

#posObject (readonly)

Returns the value of attribute pos.



65
66
67
# File 'lib/yacan/dependency.rb', line 65

def pos
  @pos
end

#readingObject (readonly)

Returns the value of attribute reading.



65
66
67
# File 'lib/yacan/dependency.rb', line 65

def reading
  @reading
end

#surfaceObject (readonly)

Returns the value of attribute surface.



65
66
67
# File 'lib/yacan/dependency.rb', line 65

def surface
  @surface
end

Instance Method Details

#to_sObject



61
62
63
# File 'lib/yacan/dependency.rb', line 61

def to_s
  "#{@surface}: #{@feature.join(',')}"
end