Question: Task 1 (80 marks) Write a Java program called WordMatch. java. This program takes four command-line argu- ments. For example: java WordMatch in1 . txt

 Task 1 (80 marks) Write a Java program called WordMatch. java.

Task 1 (80 marks) Write a Java program called WordMatch. java. This program takes four command-line argu- ments. For example: java WordMatch in1 . txt out1. txt in2. txt out2. txt 1. The first is the name of a text file that contains the names of the text files from which the words are to be read to build the lexicon (The aim of this argument is to specify the input files) 2. The second is the name of the text files to which the words in the lexicon are to be written (The argument specifies the file that contains the words and their neighbors in the lexicon) 3. The third is the name of a text file that contains a number of matching patterns, one per line (The aim of this argument is to provide the matching patterns) 4. The fourth is the name of the text file that contains the result of the matching for the given patterns (The argument specifies the file that contains the result) For this version, the efficiency with which the program performs various operations is a major concern. For example, the files read in can be quite long and the lexicon of words can grow to be quite lengthy. Time to insert the words will be critical here and you will need to carefully consider which algorithms and data structures you use. You can use any text files for input to this program. A good source of long text files is at the Gutenberg project (www.gutenberg.com) which is a project aimed to put into electronic form older literary works that are in the public domain. The extract from Jane Austen's book Pride and Prejudice used as the sample text file above was sourced from this web site. You should choose files of lengths suitable for providing good information about the efficiency of your program. A selection of test files have been posted on LMS for your efficiency testing. You can consider additional test files if you wish. As expected, the definition of a word, and the content of a query's result and display of this result are exactly the same as what described in Part 1. All the Java files must be submitted. The program will be marked on correctness and efficiency. Bad coding style and documentation may have up 5 marks deducted. With the exceptions of ArrayList and LinkedList, you are not permitted to use any of the classes in the Java Collections Framework, e.g. TreeMap, HashMap, Collections, Arrays

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!