Class | Ankusa::MemoryStorage |
In: |
lib/ankusa/memory_storage.rb
|
Parent: | Object |
# File lib/ankusa/memory_storage.rb, line 39 def get_total_word_count(klass) @total_word_counts[klass] end
# File lib/ankusa/memory_storage.rb, line 27 def get_vocabulary_sizes count = Hash.new 0 @freqs.each { |w, ks| ks.keys.each { |k| count[k] += 1 } } count end
# File lib/ankusa/memory_storage.rb, line 35 def get_word_counts(word) @freqs.fetch word, Hash.new(0) end
# File lib/ankusa/memory_storage.rb, line 56 def incr_doc_count(klass, count) @total_doc_counts[klass] += count end
# File lib/ankusa/memory_storage.rb, line 52 def incr_total_word_count(klass, count) @total_word_counts[klass] += count end
# File lib/ankusa/memory_storage.rb, line 47 def incr_word_count(klass, word, count) @freqs[word] ||= Hash.new(0) @freqs[word][klass] += count end