summaryrefslogtreecommitdiff
path: root/sample/occur.rb
blob: 8bb09e15adff933214b4b47459f9f2d86fb0a579 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# 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
3-03-01* Merge Onigmo 0fe387da2fee089254f6b04990541c731a26757fnaruse 2012-03-05Remove unused variables.naruse 2012-02-18* regcomp.c, regexec.c: fix-up warnings.nobu 2012-02-17* Merge Onigmo-5.13.1. [ruby-dev:45057] [Feature #5820]naruse 2011-12-15* regcomp.c (onig_region_memsize): implemented for memsize_of().nobu 2011-12-05* class.c (rb_obj_methods), compile.c (iseq_compile_each),nobu 2011-11-15* regcomp.c (print_indent_tree): fix double printing of ENCLOSE_OPTIONnaruse 2011-02-23Show encoding of compiling regexp.naruse 2011-01-31* addr2line.c: suppressed shorten-64-to-32 warnings.naruse 2010-11-26* regcomp.c (setup_tree): restart setup_tree() for a node whosenaruse 2010-11-26* regcomp.c (onig_is_prelude): added to check whether ruby is stillnaruse 2010-11-25* regcomp.c (print_distance_range): use PRIuSIZE.naruse 2010-11-17* regint.h (OnigOpInfoType): constify name.naruse 2010-08-17* regcomp.c: revert r26701; it introduces Bug #3681.naruse 2010-08-14* regcomp.c (onig_memsize): constified.nobu