Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
7 lines (4 sloc) 581 Bytes

word_count

This program will count the words in the provided text as further described in the file PROBLEM, and will print a word frequency table to standard output.

Usage: ./word_count.rb [file1 file2...]; if your OS doesn't understand the #! line, try ruby word_count.rb instead, as usual. If no filenames are supplied, standard input is read instead.

The script has been tested with Ruby 1.9.2, though it may work with other versions of Ruby. It has no external dependencies other than the standard library; the Gemfile in the repository is only needed for testing.