Created
July 30, 2015 14:20
-
-
Save techsin/445ce2efa79c9609a6c4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
sentence = <<-something | |
Steven likes the movies. Blake likes to ride his bike but hates movies. | |
Blake is taller than steven. Steven Steven is a great teacher. | |
something | |
counter = Hash.new(0) | |
sentence.gsub!(".","").split(" ").each do |word| | |
counter[word] += 1 | |
end | |
words = counter.select { |k,v| v>2 } | |
puts words | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment