The goal of this lab is to practice working with ArrayLists by developing a class that can be used to randomly generate words from a particular part-of-speech (POS). Never again will you be stumped while trying to come up with a hilarious noun during a game of MadLibs.
The following files are provided:
POSDictionary.java
UNFINISHED. This class loads a list of words that are labeled
according to their part-of-speech. You will need to complete this
code so that the words are stored different ArrayLists depending on
the part-of-speech.
MadLibHelper.java
This is an application for generating random words. You may use this for testing your POSDictionary
class.
POSChecker.java
This is an application that can be used to check the part-of-speech
for arbitrary words. You may use this for testing
your POSDictionary
class.
pos_dict.txt
This is
a plain text file containing approximately 200,000 words labeled
according to their part-of-speech. This is a simplified version of
the public domain Moby
Part-of-Speech file. The original version lists multiple parts-of-speech for each word where appropriate. Our version selects a single
part-of-speech for each word. Download the files above and
complete POSDictionary.java
so that all methods conform
to the docstrings. Test your completed file by running the two
provided application programs. Since these are command-line
applications, you should execute them from the terminal, rather than
running them from inside Eclipse. Refer to the ALL CAPS suggestions
while completing your implementation.
Submit your completed version of POSDictionary.java
through Web-CAT. Style checking is turned off, and you have an
unlimited number of submissions. Here are the testing files in case you would prefer to like to run the tests locally before uploading to Web-CAT:
POSDictionaryTest.java
test_file.txt
- A very small dictionary designed to simplify testing.