home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
rbemx144.zip
/
ruby-1.4.4
/
sample
/
occur.rb
< prev
next >
Wrap
Text File
|
1999-01-20
|
220b
|
13 lines
# word occurrence listing
# usege: ruby occur.rb file..
freq = Hash.new(0)
while gets()
for word in $_.split(/\W+/)
freq[word] += 1
end
end
for word in freq.keys.sort!
print word, " -- ", freq[word], "\n"
end