Calculate word frequencies of a text and order them