Class: Ferret::Index::TermInfo
- Inherits:
-
Object
- Object
- Ferret::Index::TermInfo
- Defined in:
- lib/ferret/index/term_info.rb
Overview
A TermInfo is the record of information stored for a term.
Instance Attribute Summary collapse
-
#doc_freq ⇒ Object
Returns the value of attribute doc_freq.
-
#freq_pointer ⇒ Object
Returns the value of attribute freq_pointer.
-
#prox_pointer ⇒ Object
Returns the value of attribute prox_pointer.
-
#skip_offset ⇒ Object
Returns the value of attribute skip_offset.
Instance Method Summary collapse
- #==(o) ⇒ Object (also: #eql?)
- #copy_of ⇒ Object
-
#initialize(df = 0, fp = 0, pp = 0, so = 0) ⇒ TermInfo
constructor
A new instance of TermInfo.
- #set!(ti) ⇒ Object
- #set_values!(df = 0, fp = 0, pp = 0, so = 0) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(df = 0, fp = 0, pp = 0, so = 0) ⇒ TermInfo
Returns a new instance of TermInfo.
6 7 8 |
# File 'lib/ferret/index/term_info.rb', line 6 def initialize(df=0, fp=0, pp=0, so=0) set_values!(df, fp, pp, so) end |
Instance Attribute Details
#doc_freq ⇒ Object
Returns the value of attribute doc_freq.
4 5 6 |
# File 'lib/ferret/index/term_info.rb', line 4 def doc_freq @doc_freq end |
#freq_pointer ⇒ Object
Returns the value of attribute freq_pointer.
4 5 6 |
# File 'lib/ferret/index/term_info.rb', line 4 def freq_pointer @freq_pointer end |
#prox_pointer ⇒ Object
Returns the value of attribute prox_pointer.
4 5 6 |
# File 'lib/ferret/index/term_info.rb', line 4 def prox_pointer @prox_pointer end |
#skip_offset ⇒ Object
Returns the value of attribute skip_offset.
4 5 6 |
# File 'lib/ferret/index/term_info.rb', line 4 def skip_offset @skip_offset end |
Instance Method Details
#==(o) ⇒ Object Also known as: eql?
28 29 30 31 32 33 34 |
# File 'lib/ferret/index/term_info.rb', line 28 def ==(o) return false if !o.instance_of?(TermInfo) @doc_freq == o.doc_freq && @freq_pointer == o.freq_pointer && @prox_pointer == o.prox_pointer && @skip_offset == o.skip_offset end |
#copy_of ⇒ Object
24 25 26 |
# File 'lib/ferret/index/term_info.rb', line 24 def copy_of() TermInfo.new(doc_freq, freq_pointer, prox_pointer, skip_offset) end |
#set!(ti) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/ferret/index/term_info.rb', line 10 def set!(ti) @doc_freq = ti.doc_freq @freq_pointer = ti.freq_pointer @prox_pointer = ti.prox_pointer @skip_offset = ti.skip_offset end |
#set_values!(df = 0, fp = 0, pp = 0, so = 0) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/ferret/index/term_info.rb', line 17 def set_values!(df=0, fp=0, pp=0, so=0) @doc_freq = df @freq_pointer = fp @prox_pointer = pp @skip_offset = so end |
#to_s ⇒ Object
37 38 39 |
# File 'lib/ferret/index/term_info.rb', line 37 def to_s() "TermInfo:df=#{@doc_freq}:fp=#{@freq_pointer}:pp=#{@prox_pointer}:so=#{@skip_offset}" end |