uses a dictionary to count the number of words that appear in any text file