Exercise: Count words in a file
Similar to the exercise in which we counted digits, this time we would like to count words.
Give a file that contains lots of line, each line containig words separated by a space, we would like to count how many times each word appear. For the sake of simplicty in parsing, we can assume that there are no special pnctuations that we might need to get around. Just words separated by a space.
A small input file might look like this:
one word another word a new sentence and a new word