You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# replace new lines, numbers, and puncuation with spaces
# break words on spaces
# get the word stem
# remove duplicates
# removed stems less than 3 letters
# remove common words (after they've been stemmed)
common_words = %w(and are but for from had have her his like not our she some than that the their them then there these they this via was were with you your)
self.downcase.gsub(/[^a-z \n]/, ' ').split.map!{|s|s.stem}.uniq.map!{|s|s if (s.length > 2)}.compact - common_words.map!{|s|s.stem}