Question
I want your program in Java to read in a list of all the words in the English language, and create atext file with 3
I want your program in Java to read in a list of all the words in the English language, and create atext file with 3 sections.
The first section will be a list of all English words that are anagrams with some otherword. (This will be the long section, with thousands of words.) Each line of the firstsection should be a list of >1 words, all of which are anagrams of each other.
The second section will be a list of all English words that have the largest number ofanagrams. For instance "time" has exactly four anagrams: "time", "emit", "item", and"mite". If that turns out to be the most anagrams of any word in English, then these fourwords should be in the second section; however, if there are English words with morethan four anagrams, then "time" won't make this list. Like the first section, each line ofthe second section should be a list of >1 words, all of which are anagrams of each other.
The third section will be a list of all the English words that are the longest words that areanagrams with another word. For instance, "conservation" and "conversation" areanagrams with 12 letters, which is pretty long. If these are the longest anagrams inEnglish, then these two words should appear in the third section; however, if English hasanagrams even longer than 12 letters, then "conservation" and "conversation" won't makeit into the third section. Again, each line of this section will consist of a group of wordsthat are anagrams of each other.(I hope you put some visual division between the sections, like maybe a line of *'s.)I have a file that lists all the words in the English language, according to some web sitethat I found. This file is an ASCII file, with one word per line. No punctuation, nocompound words, no upper case, no diacritical marks, no letters from foreign alphabets,so you don't have to worry about those things. Other than the line-termination characters,the file has no characters except the 26 lower-case letters. Your program can just read thisfile to get a list of all the English words. If this file is replaced by some other Englishdictionary (with the restrictions mentioned above), then your program should work withthat dictionary (and possibly get different answers).Your program should get the input file name and the output file name from the user. Ifthere's any I/O problem, c&d (complain and die).
For example, assume for simplicity that our English dictionary has only 14 words:
ate
blah
conservation
conversation
eat
emit
item
mite
opts
post
stop
tea
time
tops
Then our output file will look something like:
ate eat tea
conservation conversationemit
item mite time
opts post stop tops
************************************************************************
emit item mite timeopts post stop tops
************************************************************************
conservation conversation
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started