reads the words from the file, keeping track of their frequencies (that
is, how many times each word appears),
and prints the complete list of words and their frequencies, sorted in
decreasing order by frequency (words with the same frequency may be printed
in any order).
So, for example, if the file contains the text:
The moose and the kudu
frolicked in the
meadow with their friends
the okapi and the gnu.
the output should be:
the 5
and 2
friends 1
frolicked 1
gnu 1
in 1
kudu 1
meadow 1
moose 1
okapi 1
their 1
with 1
Note that punctuation should be removed, and that "the" and "The" are
considered to be the same word. You may find the String
method toLowerCase() useful.