aboutsummaryrefslogtreecommitdiffstats
path: root/sample/occur2.rb
diff options
context:
space:
mode:
authorKenichi Kamiya <kachick1@gmail.com>2019-08-19 18:43:23 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-08-19 18:43:23 +0900
commit8882986d9701ef8be4cdd87e64a30321f1738cee (patch)
tree67c0f54ef910e727c9226397d079579ad1addfb0 /sample/occur2.rb
parent209ea85b54c9229f0c1e5c730dee05a096599eb0 (diff)
downloadruby-8882986d9701ef8be4cdd87e64a30321f1738cee.tar.gz
Drop duplicated sample code (#2389) [ci skip]
* Drop duplicated sample code * Drop another style sample https://github.com/ruby/ruby/pull/2389#issuecomment-522489520 * Update sample list
Diffstat (limited to 'sample/occur2.rb')
-rw-r--r--sample/occur2.rb13
1 files changed, 0 insertions, 13 deletions
diff --git a/sample/occur2.rb b/sample/occur2.rb
deleted file mode 100644
index ef8ad2c541..0000000000
--- a/sample/occur2.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# word occurrence listing
-# usage: ruby occur2.rb file..
-freq = {}
-ARGF.each_line do |line|
- for word in line.split(/\W+/)
- freq[word] ||= 0
- freq[word] += 1
- end
-end
-
-for word in freq.keys.sort
- printf("%s -- %d\n", word, freq[word])
-end