Question: import java.util.*; import java.io.*; import java.net.*; public class MySpellchecker{ public static void main(String[] args) throws IOException{ String FileName; if (args.length dict = new HashSet ();

import java.util.*; import java.io.*; import java.net.*; public class MySpellchecker{ public static void main(String[] args) throws IOException{ String FileName; if (args.length dict = new HashSet(); while(sc.hasNext()) dict.add(sc.next()); sc.close(); System.out.println("These words are not in the dictionary: "); sc = new Scanner(new File("Spellchecker.java")); while( sc.hasNextLine()){ String[] tokens = sc.nextLine().split("\\W"); for(String token : tokens) if (token.length() > 1 && !dict.contains(token.toLowerCase())) System.out.println(token); } } } Styles The assignment 1. Add CLEAR COMMENTS for every interesting part of the program. 2. Modify the MySpellchecker.java program to accept a first argument which is the file to be read in and spell-checked. 3. Provide an input file, and capture the spellchecker output from your running program for that file (copy and paste from the console?). Place the output into a file called MySpellcheckerOutput.txt. 4. Modify the MySpellchecker.java program to accept a second argument 5. Extra credt: modify your program so that there is an option to read other which is the alternate dictionary to be used. files determined from console input (that is, you say "enter a file name or quit to finish" and then loop through accep dictionary) and build your own dictionary file called MyDictionaryFile.txt from those other files, such that the dictionary file is suitable as input to your program. (Hint: we are dealing with sets.) Trigger this function when the first argument is "build". Loop getting input file names until "quit" is entered on the console. Add all the words in the files entered into your MyDictionaryFile.txt file ting file names to add to the 6. Zip together your java source program, your input file, and your output file. Be prepared to submit this to Dr. Lytinen at D2L Make sure that your program will compile and run from the command line 7. with the following commands (where InputFile.txt and Dictionary File.txt can have any names we choose). Use the the program source code as the default input, and the given URL dictionary as the default dictionary. e. javac MySpellchecker.java s java MuSnellcheckex 10.Java MSesiishesksx InputFile.txt y java Mspellshesker InputFile.txt Dictionaryfile.txt MySpelishecksx buiid
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
