in reply to a question about making a word frequency matrix

Since you are writing your output line by line, you don't need to store a matrix. You need a hash which maintains the number of times the word is found in a given paragraph. Therefore,
You'll want to deal with capitalization somehow, as well. :D

Don Wilde
"There's more than one level to any answer."
  • Comment on Re: a question about making a word frequency matrix