Remove the stop words
text = %q{this is a test.} stop_words = %w{is a} words = text.scan(/\w+/) key_words = words.select { |word| !stop_words.include?(word) } puts key_words.join(' ')