Class: RSI::TermEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/rsi/dictionary.rb

Overview

An occurrence of a term in a document.

huh. freq and pos_list don’t seem to add much to the dict size

freq is redundant. ==pos_list.length

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(docid) ⇒ TermEntry

Returns a new instance of TermEntry.



14
15
16
17
18
# File 'lib/rsi/dictionary.rb', line 14

def initialize( docid )
  @docid = docid
  @freq = 0
  @pos_list = []
end

Instance Attribute Details

#docidObject

Returns the value of attribute docid.



13
14
15
# File 'lib/rsi/dictionary.rb', line 13

def docid
  @docid
end

#freqObject

Returns the value of attribute freq.



13
14
15
# File 'lib/rsi/dictionary.rb', line 13

def freq
  @freq
end

#pos_listObject

Returns the value of attribute pos_list.



13
14
15
# File 'lib/rsi/dictionary.rb', line 13

def pos_list
  @pos_list
end

Instance Method Details

#to_sObject



19
20
21
# File 'lib/rsi/dictionary.rb', line 19

def to_s
  YAML.dump(self)
end