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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!