reddavis/TF-IDF — pull request #1 by lucaswiman (2012-01-06 21:27:10+00:00)
Title: Improve efficiency of calculate_term_frequencies.  

Old version was O(D*L*N), where D is the number of documents, L is the average length of the document, and N was the total number of distinct terms in the corpus. The function looped through all terms (N), then for each term, looped through every document (D), and called the :include? method, which is O(L). The new version is O(D*L).