def incr_word_count(klass, word, count)
      # Only wants strings
      klass = klass.to_s
      word  = word.to_s

      prior_count = @cassandra.get(:classes, word, klass).values.last.to_i
      new_count   = prior_count + count
      @cassandra.insert(:classes, word, {klass => new_count.to_s})

      if (prior_count == 0 && count > 0)
        #
        # we've never seen this word before and we're not trying to unlearn it
        #
        vocab_size = @cassandra.get(:totals, klass, "vocabsize").values.last.to_i
        vocab_size += 1
        @cassandra.insert(:totals, klass, {"vocabsize" => vocab_size.to_s})
      elsif new_count == 0
        #
        # we've seen this word before but we're trying to unlearn it
        #
        vocab_size = @cassandra.get(:totals, klass, "vocabsize").values.last.to_i
        vocab_size -= 1
        @cassandra.insert(:totals, klass, {"vocabsize" => vocab_size.to_s})
      end
      new_count
    end
def incr_word_count(klass, word, count)
      # Only wants strings
      klass = klass.to_s
      word  = word.to_s

      prior_count = @cassandra.get(:classes, word, klass).values.last.to_i
      new_count   = prior_count + count
      @cassandra.insert(:classes, word, {klass => new_count.to_s})

      if (prior_count == 0 && count > 0)
        #
        # we've never seen this word before and we're not trying to unlearn it
        #
        vocab_size = @cassandra.get(:totals, klass, "vocabsize").values.last.to_i
        vocab_size += 1
        @cassandra.insert(:totals, klass, {"vocabsize" => vocab_size.to_s})
      elsif new_count == 0
        #
        # we've seen this word before but we're trying to unlearn it
        #
        vocab_size = @cassandra.get(:totals, klass, "vocabsize").values.last.to_i
        vocab_size -= 1
        @cassandra.insert(:totals, klass, {"vocabsize" => vocab_size.to_s})
      end
      new_count
    end
Increment the count for a given (word,class) pair. Evidently, cassandra
 does not support atomic increment/decrement. Psh. HBase uses ZooKeeper to
 implement atomic operations, ain't it special?