This class keeps a word => index mapping. It is used to map stemmed words to dimensions of a vector.
Returns the dimension of the word or nil if the word is not in the space.
# File lib/classifier-reborn/lsi/word_list.rb, line 21 def [](lookup) term = lookup @location_table[term] end
Adds a word (if it is new) and assigns it a unique dimension.
# File lib/classifier-reborn/lsi/word_list.rb, line 15 def add_word(word) term = word @location_table[term] = @location_table.size unless @location_table[term] end
Generated with the Darkfish Rdoc Generator 2.