Word frequency count FIXED by shinh

m=Hash.new{0}
$<.read.downcase.gsub(/[^a-z ]/,'').scan(/[a-z]+/){m[$&]+=1}
m.sort_by{|x|x}.map{|k,v|puts"#{v} #{k}"}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return top