Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 8 lines (6 sloc) 0.303 kb
1 2 3 4 5 6 7 8
#!/usr/bin/env ruby
Dir["#{File.dirname(__FILE__)}/lib/**/*.rb"].each {|file| require file }

sentences = []
ARGF.each('.') {|s| sentences << s }

frequency_table = WordCounter.new(sentences).sorted_table
puts frequency_table.collect {|row| "#{row[:word]}, #{row[:sentences].count}, #{row[:sentences]}"}
Something went wrong with that request. Please try again.