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
collisions, #includes?, #make_relative, #overlaps, #overlaps?, #pull, #push, #range_in
Instance Method Details
#_parts ⇒ Object
9
10
11
|
# File 'lib/rbbt/segment.rb', line 9
def _parts
@parts ||= self.split(":")
end
|
#docid ⇒ Object
17
18
19
|
# File 'lib/rbbt/segment.rb', line 17
def docid
@docid ||= DocID.setup(_parts[0..3] * ":")
end
|
#eend ⇒ Object
25
26
27
|
# File 'lib/rbbt/segment.rb', line 25
def eend
offset.to_i + length - 1
end
|
#offset ⇒ Object
21
22
23
|
# File 'lib/rbbt/segment.rb', line 21
def offset
range.begin
end
|
#range ⇒ Object
13
14
15
|
# File 'lib/rbbt/segment.rb', line 13
def range
@range ||= Range.new(*_parts[4].split("..").map(&:to_i))
end
|
#segment_length ⇒ Object
29
30
31
|
# File 'lib/rbbt/segment.rb', line 29
def segment_length
range.end - range.begin + 1
end
|