Class: OmniCat::Classifiers::StrategyInternals::Category
- Defined in:
- lib/omnicat/classifiers/strategy_internals/category.rb
Instance Attribute Summary collapse
-
#doc_count ⇒ Object
Returns the value of attribute doc_count.
-
#docs ⇒ Object
Returns the value of attribute docs.
-
#token_count ⇒ Object
Returns the value of attribute token_count.
-
#tokens ⇒ Object
Returns the value of attribute tokens.
Instance Method Summary collapse
-
#initialize(category_hash = {}) ⇒ Category
constructor
A new instance of Category.
Methods inherited from Base
Constructor Details
#initialize(category_hash = {}) ⇒ Category
Returns a new instance of Category.
9 10 11 12 13 14 |
# File 'lib/omnicat/classifiers/strategy_internals/category.rb', line 9 def initialize(category_hash = {}) @doc_count = category_hash[:doc_count].to_i @docs = category_hash[:docs] || {} @tokens = category_hash[:tokens] || {} @token_count = category_hash[:token_count].to_i end |
Instance Attribute Details
#doc_count ⇒ Object
Returns the value of attribute doc_count.
7 8 9 |
# File 'lib/omnicat/classifiers/strategy_internals/category.rb', line 7 def doc_count @doc_count end |
#docs ⇒ Object
Returns the value of attribute docs.
7 8 9 |
# File 'lib/omnicat/classifiers/strategy_internals/category.rb', line 7 def docs @docs end |
#token_count ⇒ Object
Returns the value of attribute token_count.
7 8 9 |
# File 'lib/omnicat/classifiers/strategy_internals/category.rb', line 7 def token_count @token_count end |
#tokens ⇒ Object
Returns the value of attribute tokens.
7 8 9 |
# File 'lib/omnicat/classifiers/strategy_internals/category.rb', line 7 def tokens @tokens end |