summaryrefslogtreecommitdiff
path: root/sample/occur2.rb
blob: ef8ad2c5412d604167266d83924b92469e14294d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# 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
nt beginless, endless ranges in Range class documentationJeremy Evans 2022-03-30Repaired What's Here sections for Range, String, Symbol, Struct (#5735)Burdette Lamar 2022-02-12[DOC] Simplify operator method referencesNobuyoshi Nakada 2022-02-09Fix Range#include? for beginless exclusive string rangesJeremy Evans 2022-02-08[DOC] Fix broken links to operator methodsNobuyoshi Nakada 2022-02-08[DOC] Fix broken links to literals.rdocNobuyoshi Nakada 2022-02-07[DOC] Use RDoc link style for links in the same class/modulePeter Zhu 2022-02-07[DOC] Use RDoc link style for links to other classes/modulesPeter Zhu 2021-12-03Adding links to literals and Kernel (#5192)Burdette Lamar 2021-11-09Some codes replace to `RBOOL` macro (#5023)S.H 2021-10-25[DOC] Fix code markup [ci skip]Nobuyoshi Nakada