Determining the word frequency in a text