Class: SimpleBioC::Sentence
- Inherits:
-
Object
- Object
- SimpleBioC::Sentence
- Includes:
- LocationAdjuster
- Defined in:
- lib/simple_bioc/sentence.rb
Instance Attribute Summary collapse
-
#annotations ⇒ Object
Returns the value of attribute annotations.
-
#infons ⇒ Object
Returns the value of attribute infons.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#passage ⇒ Object
readonly
Returns the value of attribute passage.
-
#relations ⇒ Object
Returns the value of attribute relations.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #each_relation ⇒ Object
- #find_node(id) ⇒ Object
-
#initialize(parent) ⇒ Sentence
constructor
A new instance of Sentence.
- #to_c ⇒ Object
Methods included from LocationAdjuster
#adjust_annotation_offsets, choose_offset_candidate, find_all_locations
Constructor Details
#initialize(parent) ⇒ Sentence
Returns a new instance of Sentence.
9 10 11 12 13 14 |
# File 'lib/simple_bioc/sentence.rb', line 9 def initialize(parent) @infons = {} @annotations = [] @relations = [] @passage = parent end |
Instance Attribute Details
#annotations ⇒ Object
Returns the value of attribute annotations.
6 7 8 |
# File 'lib/simple_bioc/sentence.rb', line 6 def annotations @annotations end |
#infons ⇒ Object
Returns the value of attribute infons.
6 7 8 |
# File 'lib/simple_bioc/sentence.rb', line 6 def infons @infons end |
#offset ⇒ Object
Returns the value of attribute offset.
6 7 8 |
# File 'lib/simple_bioc/sentence.rb', line 6 def offset @offset end |
#passage ⇒ Object (readonly)
Returns the value of attribute passage.
7 8 9 |
# File 'lib/simple_bioc/sentence.rb', line 7 def passage @passage end |
#relations ⇒ Object
Returns the value of attribute relations.
6 7 8 |
# File 'lib/simple_bioc/sentence.rb', line 6 def relations @relations end |
#text ⇒ Object
Returns the value of attribute text.
6 7 8 |
# File 'lib/simple_bioc/sentence.rb', line 6 def text @text end |
Instance Method Details
#each_relation ⇒ Object
21 22 23 |
# File 'lib/simple_bioc/sentence.rb', line 21 def each_relation relations.each{|r| yield r} end |
#find_node(id) ⇒ Object
16 17 18 19 |
# File 'lib/simple_bioc/sentence.rb', line 16 def find_node(id) (relations+annotations).each{|n| return n if n.id == id} nil end |
#to_c ⇒ Object
25 26 27 |
# File 'lib/simple_bioc/sentence.rb', line 25 def to_c "Sentence @#{offset}: #{text}" end |