lib/linnaeus/persistence.rb
# Decrement word counts within a category. This is used when removing a document from the corpus.
#
# == Parameters
# category::
#   A string representing a category.
# word_occurrences::
#   A hash containing a count of the number of word occurences in a document
Decrement word counts within a category. This is used when removing a document from the corpus.
Parameters
category::
A string representing a category.
word_occurrences::
A hash containing a count of the number of word occurences in a document
Decrement word counts within a category . This is used when removing a document from the corpus . Parameters category :: A string representing a category . word_occurrences :: A hash containing a count of the number of word occurences in a document
def decrement_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 decrement_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
Decrement word counts within a category.
Decrement word counts within a category .
category
<not_specific>
word_occurrences
<not_specific>