RosettaCodeData/Task/Word-frequency/Ruby/word-frequency-2.rb

4 lines
132 B
Ruby
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
RE = /[[:alpha:]]+/
count = open("135-0.txt").read.downcase.scan(RE).tally.max_by(10, &:last)
count.each{|ar| puts ar.join("->") }