Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

GUI driver • Do not allow the user to create a concordance file until they have

ID: 3601891 • Letter: G

Question

GUI driver • Do not allow the user to create a concordance file until they have entered an input file and an output file • Show the text area only when the option to create from text is chosen. • Use a FileChooser for the user to select the input and output files. • Inform the user if there is an error with the input file or the output file • Use exception handling (try/catch) for the validity of the files. • If creating a concordance from text, make sure the user has entered some text in the text area. Inform user if text area is empty. • Display the concordance from the text in the text area. • Provide a way for the user to “clear” the text area. Example of creating a Concordance from an input file Select an input file and an output file. PrideAndPrejudice.txt was used.

Explanation / Answer

A concordance lists every word that occurs in a document in alphabetical order, and for each word it gives the line number of every line in the document where the word occurs.

Write a program that creates a concordance. There will be two ways to create a concordance. The first requires a document to be read from an input file, and the concordance data is written to an output file. The second reads the input from a string and returns an ArrayList of strings that represent the concordance of the string.

Because they are so common, don't include the words "the" or “and” in your concordance. Also, do not include words that have length less than 3. Strip out all punctuation, except apostrophes that occur in the middle of a word, i.e. let’s, we’d, etc.

Data Elements – ConcordanceDataElement, consists of a String (the word) and a reference to a LinkedList<Integer (list of line numbers where word occurs). Follow the Javadoc provided for you.