diff options
author | Kenichi Kamiya <[email protected]> | 2019-08-19 18:43:23 +0900 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2019-08-19 18:43:23 +0900 |
commit | 8882986d9701ef8be4cdd87e64a30321f1738cee (patch) | |
tree | 67c0f54ef910e727c9226397d079579ad1addfb0 /sample/occur.rb | |
parent | 209ea85b54c9229f0c1e5c730dee05a096599eb0 (diff) |
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/occur.rb')
-rw-r--r-- | sample/occur.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sample/occur.rb b/sample/occur.rb index 42151d85e8..5927ebc889 100644 --- a/sample/occur.rb +++ b/sample/occur.rb @@ -2,7 +2,7 @@ # usage: ruby occur.rb file.. freq = Hash.new(0) while line = gets() - for word in line.split(/\W+/) + line.scan(/\w+/) do |word| freq[word] += 1 end end |