I would recommend using a hash with the words as keys, and incrementing the values as you find each phrase.
Ruby is built for data manipulation of this sort, so you're coming at it from the right direction.
I'm not going to to the project for you, but take a look closely at:
http://ruby-doc.org/core-2.0/Hash.html
And then understand the basic regexes you'd need to parse:
http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html#UJ
Edit: I believe in more recent ruby, hashes are sortable! I bet this would help with your table output. I'm not sure how Ruby implements that (efficiently?), however.