lib/linnaeus/persistence.rb
# Increment word counts within a category
#
# == Parameters
# category::
#   A string representing a category.
# word_occurrences::
#   A hash containing a count of the number of word occurences in a document
Increment word counts within a category
Parameters
category::
A string representing a category.
word_occurrences::
A hash containing a count of the number of word occurences in a document
Increment word counts within a category Parameters category :: A string representing a category . word_occurrences :: A hash containing a count of the number of word occurences in a document
def increment_word_counts_for_category(category, word_occurrences)
    word_occurrences.each do|word,count|
      @redis.pipelined do
        @redis.hincrby base_category_key + category, word, count
        @redis.incrby sum_key(category), count
      end   
    end
  end
def increment_word_counts_for_category ( category , word_occurrences ) word_occurrences . each do | word , count | @redis . pipelined do @redis . hincrby base_category_key + category , word , count @redis . incrby sum_key ( category ) , count end end end
Increment word counts within a category
 Parameters
category::
A string representing a category.
Increment word counts within a category Parameters category :: A string representing a category .
category
<not_specific>
word_occurrences
<not_specific>