Permalink
Browse files

Tweak to word cloud exclusions...

  * compare case insensitively
  * add a few more words
  * compare as a Set
  • Loading branch information...
1 parent b310d77 commit 7c4a1f4cdb4a26ffd8febdc2ccf6e271d43809dc Sam Stokes committed Mar 29, 2009
Showing with 5 additions and 3 deletions.
  1. +5 −3 app/controllers/prints_controller.rb
@@ -18,7 +18,7 @@ def show
words = Hash.new(0)
tweets.each do |tweet|
tweet.split(/[-\s]/).each do |word|
- words[word] += 1 unless word.empty? || common_words.include?(word)
+ words[word] += 1 unless word.empty? || common_words.include?(word.downcase)
end
end
@@ -32,8 +32,10 @@ def show
private
def common_words
- %w(the to is a I in for and of on but that can with you at was not as have
- it)
+ Set.new(%w(
+ the to is a i in for and of on but that can with you at was not as have
+ it your be my this by get i'm will or so if are we has
+ ))
end
def word_cloud(words_freqs)

0 comments on commit 7c4a1f4

Please sign in to comment.