summaryrefslogtreecommitdiff
path: root/sample/freq.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sample/freq.rb')
-rw-r--r--sample/freq.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/sample/freq.rb b/sample/freq.rb
index 0c433ae..d951591 100644
--- a/sample/freq.rb
+++ b/sample/freq.rb
@@ -1,8 +1,8 @@
# word occurrence listing
# usege: ruby freq.rb file..
freq = {}
-while gets()
- while sub(/\w+/, '')
+while gets
+ while sub!(/\w+/, '')
word = $&
freq[word] +=1
end