|
Bill Teter email: william.teter@plattsburgh.edu |
|
|
Lab 4 -- Strings and ArrayLists A concordance stores data about words that occur in text. Typically
what is stored is the name of the book (or file) in which the word occurs and
the page (or line) number of the occurrence. In this lab
you will build a simple concordance system that will process any number of text
files. You can run my version of this program if you copy the Test.class
file into you account: The project will involve 3 classes: Test -- creates the concordance from a command line argument that contains any number of filenames of text files, prints the filenames and then responds to queries from user about location of words in the files. WordData -- A class that contains three (private) fields: Concordance-- A class that holds an ArrayList that contains all the
WordData objects found in the texts processed in the concordance. Also,
the concordance holds an ArrayList of the names of the textfiles. public void processFile(String fn) public ArrayList<Strings> getTexts() public ArrayList<WordData> getReferences(String wd) Step 1. Step 2. |