Class: Segment::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/rbbt/ner/segment.rb

Overview

{{{ Index

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index, data) ⇒ Index

Returns a new instance of Index.



183
184
185
186
# File 'lib/rbbt/ner/segment.rb', line 183

def initialize(index, data)
  @index = index
  @data = data
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



182
183
184
# File 'lib/rbbt/ner/segment.rb', line 182

def data
  @data
end

#indexObject

Returns the value of attribute index.



182
183
184
# File 'lib/rbbt/ner/segment.rb', line 182

def index
  @index
end

Instance Method Details

#[](pos) ⇒ Object



188
189
190
# File 'lib/rbbt/ner/segment.rb', line 188

def [](pos)
  index[pos].collect{|id| data[id]}
end