Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Problem 1: Enhanced Vocabulary Density Application Vocabulary Density of a text is the ratio of the number of words in the document to the

Programming Problem 1: Enhanced Vocabulary Density Application

Vocabulary Density of a text is the ratio of the number of words in the document to the number of unique words in the document. A lower vocabulary density indicates complex text with lots of unique words, and a higher ratio indicates simpler text with words reused.

The problem is clearread the text and count how many words it contains and also the number of unique words it contains. We define a word to be a sequence of letter characters (A through Z) plus the apostrophe character ( ). The apostrophe is included so as to treat words such as its and Mollys as a single word. We ignore the case of letters when determining uniquenessfor example, The and the are considered to be the same word.

This problem has been well discussed and presented in the textbook, Ch.5.3. However, in addition to the vocabulary density, we are also interested in the frequency of each word in the document.

Your Tasks:

For this assignment, you are required to design an application to meet the following specific requirements:

Download all the files below and save them in the folder you created for this assignment

  • LinkedCollectionT.txt

implements Collection Interface{ //You are NOT allowed to add other instance variables f\">

  • CollectionInterface.java

  • data1.txt

  • data2.txt
  • LLNode.java

{ private I data; private LLNode next; public LLNode(T data) { setData(data); next=null; } public LL\">

  • QuickSort.java

{ public void quickSort(T[] arr) { quickSortRec(arr, o, arr. length-1); } private void quickSortRec(\">

  • ReadMe.txt

  • shakespeare.txt

\"MACBETH\" screen play

  • Word.java

{ private String word; private int frequency; public Word(String word) { this.w\">

  1. Rename LinkedCollectionT.txt to LinkedCollectionT.java and implement 6 methods as specified in the file. To get credit, you are not allowed to add any other instance variables for this class.
  2. Create a driver program named VocabularyDensity.java to test your implementation of these methods.
    1. Your driver program should get the file name from the Command argument list.
    2. Your driver program should use LinkedCollectionT to store unique Word objects (please refer to the Word java class for details).
    3. The items in the collection should also record the frequency of each word appearing in the data file.
    4. Display Vocabulary density of the data file, the list of the collection, then call sort method to sort the collection. After sorting, display the sorted list of the collection.
    5. Use two data files, data1.txt and data2.txt to test your program. Screenshot the output of your program.
  3. If you implement all the required methods correctly, the driver program should generate outputs similar to the following:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Integrated Accounting

Authors: Dale A. Klooster, Warren Allen, Glenn Owen

8th edition

1285462726, 1285462721, 978-1285462721

More Books

Students also viewed these Programming questions

Question

=+b) What do you conclude?

Answered: 1 week ago