Question: Write a text analyzer in Java that reads a file and outputs statistics about that file. It should output the word frequencies of all words
Write a text analyzer in Java that reads a file and outputs statistics about that file. It should output the word frequencies of all words in the file, sorted by the most frequently used word. The output should be a set of pairs, each pair containing a word and how many times it occurred in the file.
(Java programming question)
Can't figure out how to get it to read by the words and not by the line. I have tried the .split(" "); and it is not working the right way. I have a file of a play and those are the words I am supposed to be counting and right now it is counting the whole sentence as a word.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
