Document Analysis
Introduction
James Madison is most famous for his work on the U.S. Constitution and
the Bill of Rights. In honor of his 262nd birthday, this lab will
give us a chance to take a closer look at those documents.
The goal of this lab is to write a simple terminal-based program that
analyzes a text document and reports some summary statistics. The
skeleton for this program is provided for you. Your job is to
complete all methods so that they conform to the provided Javadocs.
Files
The following files are provided:
- DocumentStats.java This class is
responsible for reading a text file and storing it as a collection of
individual words. It provides information about the document such as
the total number of words etc.
- DocumentReporter.java This class is responsible for generating and storing nicely formatted reports based on the data provided by the
DocumentStats
class.
- DocumentUI.java The class contains the main. It is responsible for reading command line arguments and performing the appropriate actions. The specific behavior is described in the file comments.
- FileFormatException.java
This exception will be used to indicate that the file being processed
exists, but does not contain any usable data. YOU WILL NOT NEED TO MODIFY THIS FILE.
- constitution.txt You can test your code on these text files.
- bill_of_rights.txt
Submitting
You will submit this lab through WebCAT. You should only submit the four java files above. You may submit as many times as you like, and you do not need to provide unit tests.
Here are the unit tests that will be used by
WebCAT: document_tests.zip. Feel free to use them if it
will save time.