Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 17 lines (15 sloc) 0.272 kb
511dc44 initial import
Laurent Sansonetti authored
1 # word occurrence listing
2 # usege: ruby occur2.rb file..
3 freq = {}
4 while gets()
5 for word in split(/\W+/)
6 begin
7 freq[word] += 1
8 rescue NameError
9 freq[word] = 1
10 end
11 end
12 end
13
14 for word in freq.keys.sort
15 printf("%s -- %d\n", word, freq[word])
16 end
Something went wrong with that request. Please try again.