Sha256: 838fdd9bb61466886fe690e436cf6b11bf7ce824409b1fbacbc0e2b8ac75c89e

Contents?: true

Size: 413 Bytes

Versions: 3

Compression:

Stored size: 413 Bytes

Contents

module OmniCat
  module Classifiers
    module BayesInternals
      class Category < ::OmniCat::Base
        attr_accessor :doc_count, :tokens, :token_count

        def initialize(category_hash = {})
          self.doc_count = category_hash[:doc_count].to_i
          self.tokens = category_hash[:tokens] || {}
          self.token_count = category_hash[:token_count].to_i
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
omnicat-0.1.2 lib/omnicat/classifiers/bayes_internals/category.rb
omnicat-0.1.1 lib/omnicat/classifiers/bayes_internals/category.rb
omnicat-0.1.0 lib/omnicat/classifiers/bayes_internals/category.rb