Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 13 lines (11 sloc) 0.229 kb
511dc44 initial import
Laurent Sansonetti authored
1 # word occurrence listing
2 # usege: ruby occur.rb file..
3 freq = Hash.new(0)
4 while line = gets()
5 for word in line.split(/\W+/)
6 freq[word] += 1
7 end
8 end
9
10 for word in freq.keys.sort!
11 print word, " -- ", freq[word], "\n"
12 end
Something went wrong with that request. Please try again.