Question: IN JAVA CODE: There is a list of about 100,000 English words in alphabetical order. Within a DataFileReader class, write a method createDictWordLengths(String fileName) that
IN JAVA CODE:
There is a list of about 100,000 English words in alphabetical order. Within a DataFileReader class, write a method createDictWordLengths(String fileName) that reads the specified file and returns a dictionary associating word lengths with the frequency at which each length appears in the list. The keys are the lengths, while the values are the frequencies at which those lengths appear. A single entry (key-value pair) in this dictionary might look something like this:
<4, 0.027>
This means that 2.7% of the words in the list contain 4 letters. This dictionary will be used to determine the length of each random word that you generate. (Note: This isnt a very good technique, because we arent considering how frequently each of the words in the list appears in typical English usage. But lets just roll with it for this project!)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
