Class: Opener::KAF::WordForm
- Inherits:
-
Object
- Object
- Opener::KAF::WordForm
- Defined in:
- lib/opener/kaf/text.rb
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(document, xml_node) ⇒ WordForm
constructor
A new instance of WordForm.
- #length ⇒ Object
- #offset ⇒ Object
- #paragraph ⇒ Object
- #text ⇒ Object
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
#id ⇒ Object
10 11 12 |
# File 'lib/opener/kaf/text.rb', line 10 def id return @id ||= @xml_node.attr('wid') end |
#length ⇒ Object
18 19 20 |
# File 'lib/opener/kaf/text.rb', line 18 def length return @length ||= @xml_node.attr('length').to_i end |
#offset ⇒ Object
22 23 24 |
# File 'lib/opener/kaf/text.rb', line 22 def offset return @offset ||= @xml_node.attr('offset').to_i end |
#paragraph ⇒ Object
26 27 28 |
# File 'lib/opener/kaf/text.rb', line 26 def paragraph return @paragraph ||= @xml_node.attr('para').to_i end |
#text ⇒ Object
14 15 16 |
# File 'lib/opener/kaf/text.rb', line 14 def text return @text ||= @xml_node.text end |