Class: Company::Mapping::TermFrequency
- Inherits:
-
Object
- Object
- Company::Mapping::TermFrequency
- Defined in:
- lib/company/mapping/tfidf/tf/term_frequency.rb
Overview
Raw term frequency (number of times a token appears in a given string - document)
Direct Known Subclasses
Instance Method Summary collapse
-
#calculate(text) ⇒ Object
Calculates the raw term frequency given the contents of the document.
-
#initialize(tokenizer) ⇒ TermFrequency
constructor
A new instance of TermFrequency.
Constructor Details
#initialize(tokenizer) ⇒ TermFrequency
6 7 8 |
# File 'lib/company/mapping/tfidf/tf/term_frequency.rb', line 6 def initialize(tokenizer) @tokenizer = tokenizer end |
Instance Method Details
#calculate(text) ⇒ Object
Calculates the raw term frequency given the contents of the document.
11 12 13 |
# File 'lib/company/mapping/tfidf/tf/term_frequency.rb', line 11 def calculate(text) rawFrequency(text) end |