Class: OmniCat::Classifiers::StrategyInternals::Category

Inherits:
Base
  • Object
show all
Defined in:
lib/omnicat/classifiers/strategy_internals/category.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#to_hash

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_countObject

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

#docsObject

Returns the value of attribute docs.



7
8
9
# File 'lib/omnicat/classifiers/strategy_internals/category.rb', line 7

def docs
  @docs
end

#token_countObject

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

#tokensObject

Returns the value of attribute tokens.



7
8
9
# File 'lib/omnicat/classifiers/strategy_internals/category.rb', line 7

def tokens
  @tokens
end