Word frequency count FIXED by xdigit

h={}
$<.read.delete('!-@_~\\').downcase.split.each{|x|h[x]=(v=h[x])?v+1:1}
h.to_a.sort.each{|x,y|puts"#{y} #{x}"}

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

download

return to the top page