class SimpleBioC::Sentence

Attributes

annotations[RW]
infons[RW]
offset[RW]
passage[R]
relations[RW]
text[RW]

Public Class Methods

new(parent) click to toggle source
# File lib/simple_bioc/sentence.rb, line 6
def initialize(parent)
  @infons = {}
  @annotations = []
  @relations = []
  @passage = parent
end

Public Instance Methods

all_annotations(ret) click to toggle source
# File lib/simple_bioc/sentence.rb, line 22
def all_annotations(ret)
  @annotations.each{|a| ret << a}
end
all_relations(ret) click to toggle source
# File lib/simple_bioc/sentence.rb, line 26
def all_relations(ret)
  @relations.each{|r| ret << r}
end
each_relation() { |r| ... } click to toggle source
# File lib/simple_bioc/sentence.rb, line 18
def each_relation
  @relations.each{|r| yield r}
end
find_node(id) click to toggle source
# File lib/simple_bioc/sentence.rb, line 13
def find_node(id)
  (@relations+@annotations).each{|n| return n if n.id == id}
  nil
end
to_c() click to toggle source
# File lib/simple_bioc/sentence.rb, line 30
def to_c
  "Sentence @#{@offset}: #{@text}"
end