Reference no: EM13896103
A class named TextProcessor. This class does the heavy lifting of opening the file, reading it, standardizing the text, and tokenizing it. Use this class to accomplish the following requirements:
- Create a Java class namedTextProcessorGUI.
- Provide a main() function that creates and displays an instance ofTextProcessorGUI. I recommend you write this class as a subclass ofJFrame.
- Provide a button that, when pressed, causes aJFileChooser dialog to appear. Use this dialog to allow the user to select a text file.
- After selecting the file, your code will create an instance of TextProcessor and then use itsprocessFile() method.
- After theprocessFile() method completes, display in your window:
- The name of the selected file.
- The number of unique words in the file as provided byTextProcessor.
- The total number of words in the fileas provided byTextProcessor.
- The average number of times a word appears in the fileas provided byTextProcessor.
- The most frequent words (it could be a tie)as provided byTextProcessor.
- The COUNT of words that appear onceas provided byTextProcessor.
- The COUNT of words that appear twiceas provided byTextProcessor.
- The COUNT of words that appear three timesas provided byTextProcessor.
Your window must be appropriately sized for its contents. Further, your program must terminate when I press the "DISMISS" button, i.e. the X in the upper right corner on a Windows system.
When I grade your homework, I will use two different text files. Your code must correctly handle the use of one text file (show the numbers for the first file), then the use of a second text file (show the numbers for the second file).
I recommend you pick a few books from Project Gutenberg. Works by Oscar Wilde, Lewis Carroll, and Mark Twain are good test data; easy to get, moderate in length, and they use pretty standard vocabulary. But you can use whatever test data you want.
This exercise is about creating a GUI. This exercise is NOT about handling a file and the text within.
An answer by sometime (doesn't matter when) tomorrow is needed