Module: SegID

Extended by:
Entity
Includes:
SegmentRanges
Included in:
AnnotID
Defined in:
lib/rbbt/segment.rb,
lib/rbbt/segment/overlaps.rb

Instance Method Summary collapse

Methods included from SegmentRanges

collisions, #includes?, #make_relative, #overlaps, #overlaps?, #pull, #push, #range_in

Instance Method Details

#_partsObject



9
10
11
# File 'lib/rbbt/segment.rb', line 9

def _parts
  @parts ||= self.split(":")
end

#docidObject



17
18
19
# File 'lib/rbbt/segment.rb', line 17

def docid
  @docid ||= DocID.setup(_parts[0..3] * ":")
end

#eendObject



25
26
27
# File 'lib/rbbt/segment.rb', line 25

def eend
  offset.to_i + length - 1
end

#offsetObject



21
22
23
# File 'lib/rbbt/segment.rb', line 21

def offset
  range.begin
end

#rangeObject



13
14
15
# File 'lib/rbbt/segment.rb', line 13

def range
  @range ||= Range.new(*_parts[4].split("..").map(&:to_i))
end

#segment_lengthObject



29
30
31
# File 'lib/rbbt/segment.rb', line 29

def segment_length
  range.end - range.begin + 1
end