public class SpellTestCmdLine
extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
SpellTestCmdLine.DictBuilder
Common interface for various dictionary-building algorithms
|
private static class |
SpellTestCmdLine.SpeltDictBuilder
Builds a new-style Spelt spelling dictionary
|
private static class |
SpellTestCmdLine.SpeltSuggTester
Get spelling suggestions using the Spelt (new) algorithm
|
private static interface |
SpellTestCmdLine.SuggTester
Generic strategy for testing spelling suggestion algorithms
|
private static class |
SpellTestCmdLine.TextRipper
Scans a directory for files, and rips text from all of them.
|
Constructor and Description |
---|
SpellTestCmdLine() |
Modifier and Type | Method and Description |
---|---|
private static void |
buildDictionary(int alg,
String srcDir,
String dictDir)
Rip text from files in a given source directory and add them to a
spelling dictionary, using the specified algorithm.
|
static void |
main(String[] args)
Parse command line arguments and run.
|
private static HashSet |
makeStopSet()
Create a default stop-word set
|
private static void |
printUsageAndExit()
Prints out a message saying how to use this tool, then exits.
|
private static void |
testDictionary(int alg,
String testFile,
String dictDir)
Test the spelling index
|
public static void main(String[] args)
private static void printUsageAndExit()
private static void buildDictionary(int alg, String srcDir, String dictDir) throws IOException
alg
- 0 for null (to test speed of ripper);
1 for the old Lucene algorithm;
2 for the new Spelt algorithm.srcDir
- Directory to grab files to ripdictDir
- Directory to put spelling dictionary inIOException
private static void testDictionary(int alg, String testFile, String dictDir) throws IOException
IOException
private static HashSet makeStopSet()