Sha256: 6b1d9b0501b0b2280bc743b6c40291de4b48e717e8ea7aa0af50e028e4689865

Contents?: true

Size: 495 Bytes

Versions: 2

Compression:

Stored size: 495 Bytes

Contents

module SimpleBioC
  class Sentence
    attr_accessor :offset, :text, :infons, :annotations, :relations
    attr_reader :passage

    def initialize(parent)
      @infons = {}
      @annotations = []
      @relations = []
      @passage = parent
    end

    def find_node(id)
      (@relations+@annotations).each{|n| return n if n.id == id}
      nil
    end

    def each_relation
      @relations.each{|r| yield r}
    end

    def to_c
      "Sentence @#{@offset}: #{@text}"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simple_bioc-0.0.22 lib/simple_bioc/sentence.rb
simple_bioc-0.0.21 lib/simple_bioc/sentence.rb