Description
Step 1:
Provide a hash table implementation of a Dictionary (use the same interface as assignment 7). You may chose linear probe (open addressing) or separate chaining to handle collisions. You may use the hashCode() method built into Object and overridden in String to obtain your initial hash index. You still need to modify the return from hashCode() to accommodate the size of the array in your hashtable. You do not need to handle rehashing the table to handle the case where you run out of capacity. Instead, choose an initial size of sufficient size. Note: The order returned by the iterator will no longer be sorted.
Step 2:
Create a jUnit test program to thoroughly test your hashtable implementation of a Dictionary (make sure you test various test cases with delete).
Step 3:
Create a word index program (not in edu.iup.cosc310.util). The word index program must open a text file passed to it on the command line. Your program must process the text file identifying the set of unique words in the file and the page numbers on which each word occurs. Separate words on spaces, commas, tabs, newlines, carriage returns, dash, slash, periods, semicolons, colons, quotes, parenthesis, and square brackets (i.e. split on “\\W+”. A page is considered to be 50 lines and starts at page 1.
After processing all the words in the input text file, your word index program must print a list of all the found words, in sorted order, together with the list of page numbers where the words are found. The page numbers must be in sorted order and each page number only is printed once for a given word. Thus, you must use a Set for maintaining the list of page numbers. You can use one of Java’s Set implementations. The output is to be is sorted word order. Thus when iterating over the keys, you will need to place the keys into List and then use Collections.sort to sort them.



