This assignment is to implement an interactive version of the KWIC index system (described in Parnas's On the Criteria To Be Used in Decomposing Systems into Modules) in the object-oriented paradigm. You will be provided with a partial C++ implementation of the system and asked to identify and make the necessary modifications.
The provided system is simply a line alphabetizer. It interactively inputs a line at a time and upon demand outputs an alphabetized list of the current collection of lines. Here is a transcript of a sample session:
Add, Print, Quit: a Add, Print, Quit: a > O my son Absalom > O Absalom Add, Print, Quit: a Add, Print, Quit: p > my son my son O Absalom Add, Print, Quit: a O my son Absalom > and the king cried and the king cried Add, Print, Quit: a in a loud voice > in a loud voice my son my son Add, Print, Quit: p Add, Print, Quit: q O my son Absalom and the king cried in a loud voice my son my son
Your assignment is to modify the existing code to support the following changes:
3 different ways of displaying should be supplied. Upon entry of a p at the command line, the system should print another ``menu line":
Add, Print, Quit: p Simple, Aligned, Concordance:
and the king CRIED and the KING cried
and the king c. and the k. cried
Here is a sample session of the new system:
Add, Print, Original, Delete, Count, Quit: a > and the king cried Add, Print, Original, Delete, Count, Quit: a > in a loud voice Add, Print, Original, Delete, Count, Quit: p Simple, Aligned, Concordance: s cried and the king in a loud voice king cried and the loud voice in a voice in a loud Add, Print, Original, Delete, Count, Quit: c 2 lines Add, Print, Original, Delete, Count, Quit: d > and the king cried Add, Print, Original, Delete, Count, Quit: c 1 lines Add, Print, Original, Delete, Count, Quit: p Simple, Aligned, Concordance: c i. a loud voice in a l. voice in a loud v. Add, Print, Original, Delete, Count, Quit: o in a loud voice Add, Print, Original, Delete, Count, Quit:q