0% found this document useful (0 votes)
13 views

Assignment #1 Java KWIC

The assignment requires the creation of a Java program to generate a KWIC index by sorting and aligning words from input lines read from a specified file. It includes various requirements such as handling optional stopwords, error reporting for non-existent or empty files, and producing output in a specified format. Additionally, a class diagram must be submitted alongside the program by January 29, 2023, with penalties for late submissions.

Uploaded by

alok singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Assignment #1 Java KWIC

The assignment requires the creation of a Java program to generate a KWIC index by sorting and aligning words from input lines read from a specified file. It includes various requirements such as handling optional stopwords, error reporting for non-existent or empty files, and producing output in a specified format. Additionally, a class diagram must be submitted alongside the program by January 29, 2023, with penalties for late submissions.

Uploaded by

alok singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

SE 211 – Software Specification and Design II

Winter 2023

Assignment #1

Create an object-oriented program (using Java) to generate a KWIC index.

The requirements are as follows:

• Req-1: A KWIC index is formed by sorting and aligning the words within a line to allow each word
to be searchable alphabetically.

• Req-2: The program must read the input lines from a file. We’ll refer to this file as the inputfile.

• Req-3: The program must allow the user to optionally specify using the option -s the name of a file
which contains the words to be ignored. We’ll refer to this file as the stopwords.

• Req-4: The command to execute the program should be of the form: kwic [-s stopwords] inputfile.
Note: the square brackets are not part of the invocation command; rather, they are used to indicate
that the use of -s is optional.

• Req-5: If the inputfile does not exist, the program should report the error message “Error: The file
inputfile does not exist” and terminate.

• Req-6: If the inputfile exists but it is empty, the program should report the error message “Error: The
file inputfile is empty” and terminate.

• Req-7: If the -s option has been specified and the stopwords file does not exist, the program should
report the message “Warning: The file stopwords does not exist” and continue with the execution.

• Req-8: If the -s option has been specified and the stopwords file exists but is empty, the program
should report the error message “Warning: The file stopwords is empty” and continue with the
execution.

• Req-9: The format of the generated output should be similar to that shown as the “Output” on the
lecture slides.

In addition to the program, you should also create a class diagram to document the design.

Please submit your program and the class diagram via Blackboard by Sunday, January 29, 2023,
11:59pm.

There will be a 20-point deduction for each week of lateness.

You might also like