public class SpellCheckerTest
extends java.lang.Object
Constructor and Description |
---|
SpellCheckerTest() |
Modifier and Type | Method and Description |
---|---|
static void |
compareDocs(java.lang.String out,
java.lang.String expected)
This is a helper method that compares two documents.
|
static void |
spellCheckFiles(java.lang.String fdict,
int dictSize,
java.lang.String fcorr,
java.lang.String fdoc,
java.lang.String fout,
java.lang.String finput)
spellCheckFiles Runs the spell checker on some test input.
|
void |
testCheckFoxGood() |
void |
testCheckGettysburgSwap() |
void |
testCheckMeanInput() |
public static void spellCheckFiles(java.lang.String fdict, int dictSize, java.lang.String fcorr, java.lang.String fdoc, java.lang.String fout, java.lang.String finput) throws java.io.IOException, FileCorrector.FormatException
fdict
- The filename of the dictionarydictSize
- If the int dictSize is -1, it is ignored.
Otherwise we check the size of the dictionary after creating it,
to make sure it was parsed correctly and the tests will work.fcorr
- The filename of the corrections to use, or null
if the swap corrector should be used.fdoc
- The filename of the document to checkfout
- The filename where the output should be writtenfinput
- The filename where the user input should be read fromjava.io.IOException
FileCorrector.FormatException
public void testCheckFoxGood() throws java.io.IOException, FileCorrector.FormatException
java.io.IOException
FileCorrector.FormatException
public void testCheckMeanInput() throws java.io.IOException, FileCorrector.FormatException
java.io.IOException
FileCorrector.FormatException
public void testCheckGettysburgSwap() throws java.io.IOException, FileCorrector.FormatException
java.io.IOException
FileCorrector.FormatException
public static void compareDocs(java.lang.String out, java.lang.String expected) throws java.io.IOException, java.io.FileNotFoundException
java.io.IOException
java.io.FileNotFoundException