Class: BowTfidf::Computation
- Inherits:
-
Object
- Object
- BowTfidf::Computation
- Defined in:
- lib/bow_tfidf/computation.rb
Instance Attribute Summary collapse
-
#bow ⇒ Object
readonly
Returns the value of attribute bow.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(bow) ⇒ Computation
constructor
A new instance of Computation.
Constructor Details
#initialize(bow) ⇒ Computation
Returns a new instance of Computation.
5 6 7 8 9 |
# File 'lib/bow_tfidf/computation.rb', line 5 def initialize(bow) raise(ArgumentError, 'BowTfidf::BagOfWords instance expected') unless bow.is_a?(BowTfidf::BagOfWords) @bow = bow end |
Instance Attribute Details
#bow ⇒ Object (readonly)
Returns the value of attribute bow.
3 4 5 |
# File 'lib/bow_tfidf/computation.rb', line 3 def bow @bow end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 |
# File 'lib/bow_tfidf/computation.rb', line 11 def call compute_idf compute_tfidf bow end |