Class: MiniSearch::Tf

Inherits:
Object
  • Object
show all
Defined in:
lib/mini_search/tf.rb

Class Method Summary collapse

Class Method Details

.calculate(token, terms) ⇒ Object



5
6
7
# File 'lib/mini_search/tf.rb', line 5

def self.calculate(token, terms)
  terms.count(token).to_f / terms.size.to_f
end