public class DirectoryExamplesConstructor extends ExamplesConstructor
Modifier and Type | Field and Description |
---|---|
protected java.lang.String[] |
categories
Array of categories (classes) in the data
|
protected java.lang.String |
dirName
Name of the directory where the example files are stored.
|
protected short |
docType
Type of document (text or HTML)
|
protected boolean |
stem
Flag set to stem words to their root forms
|
Constructor and Description |
---|
DirectoryExamplesConstructor(java.lang.String dirName,
java.lang.String[] categories)
Construct an ExamplesConstructor for the given directory and category labels
|
DirectoryExamplesConstructor(java.lang.String dirName,
java.lang.String[] categories,
short docType,
boolean stem)
Construct an ExamplesConstructor for the given directory and category labels
|
Modifier and Type | Method and Description |
---|---|
int |
findClassID(java.lang.String name)
Finds the class ID from the name of the document file.
|
java.util.List<Example> |
getExamples()
Get the examples from the directory, process them into HashMapVector's and
label them with the correct category label
|
static void |
main(java.lang.String[] args)
Test loading a sample directory of examples
|
protected java.lang.String dirName
protected short docType
protected boolean stem
protected java.lang.String[] categories
public DirectoryExamplesConstructor(java.lang.String dirName, java.lang.String[] categories, short docType, boolean stem)
public DirectoryExamplesConstructor(java.lang.String dirName, java.lang.String[] categories)
public java.util.List<Example> getExamples()
getExamples
in class ExamplesConstructor
public int findClassID(java.lang.String name)
public static void main(java.lang.String[] args)