A hash map or dictionary can be used to store the frequency of a word in a document. The key would be the word, and the value would be the number of times it appears.
What kind of data structure can be used to store the number of times a word appears in a document?