Class: Opener::KAF::WordForm

Inherits:
Object
  • Object
show all
Defined in:
lib/opener/kaf/text.rb

Instance Method Summary collapse

Constructor Details

#initialize(document, xml_node) ⇒ WordForm

Returns a new instance of WordForm.



5
6
7
8
# File 'lib/opener/kaf/text.rb', line 5

def initialize(document, xml_node)
  @document = document
  @xml_node = xml_node
end

Instance Method Details

#idObject



10
11
12
# File 'lib/opener/kaf/text.rb', line 10

def id
  return @id ||= @xml_node.attr('wid')
end

#lengthObject



18
19
20
# File 'lib/opener/kaf/text.rb', line 18

def length
  return @length ||= @xml_node.attr('length').to_i
end

#offsetObject



22
23
24
# File 'lib/opener/kaf/text.rb', line 22

def offset
  return @offset ||= @xml_node.attr('offset').to_i
end

#paragraphObject



26
27
28
# File 'lib/opener/kaf/text.rb', line 26

def paragraph
  return @paragraph ||= @xml_node.attr('para').to_i
end

#textObject



14
15
16
# File 'lib/opener/kaf/text.rb', line 14

def text
  return @text ||= @xml_node.text
end