Class: RSI::TermEntry
- Inherits:
-
Object
- Object
- RSI::TermEntry
- 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
-
#docid ⇒ Object
Returns the value of attribute docid.
-
#freq ⇒ Object
Returns the value of attribute freq.
-
#pos_list ⇒ Object
Returns the value of attribute pos_list.
Instance Method Summary collapse
-
#initialize(docid) ⇒ TermEntry
constructor
A new instance of TermEntry.
- #to_s ⇒ Object
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
#docid ⇒ Object
Returns the value of attribute docid.
13 14 15 |
# File 'lib/rsi/dictionary.rb', line 13 def docid @docid end |
#freq ⇒ Object
Returns the value of attribute freq.
13 14 15 |
# File 'lib/rsi/dictionary.rb', line 13 def freq @freq end |
#pos_list ⇒ Object
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_s ⇒ Object
19 20 21 |
# File 'lib/rsi/dictionary.rb', line 19 def to_s YAML.dump(self) end |