Created
November 30, 2016 01:36
-
-
Save bright23/29f9f13d76014a7726a9d6cf7c65faa5 to your computer and use it in GitHub Desktop.
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
dic = Hash.new(0) | |
while line = ARGF.gets | |
line.downcase! | |
while line.sub!(/[a-z]+/,"") | |
word = $& | |
dic[word] += 1 | |
end | |
end | |
p dic.sort{|a,b|b[1] <=> a[1]}[0...5] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment