|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.aliasi.corpus.Corpus<ObjectHandler<E>>
com.aliasi.corpus.ListCorpus<E>
E - the type of objects handled in the corpus.public class ListCorpus<E>
A ListCorpus implements a corpus based on a list of
training and test cases. Training and testing cases are added to
the corpus with addTrain(Object) and addTest(Object) respectively. The training and test data may
be randomized using permuteCorpus(Random).
| Constructor Summary | |
|---|---|
ListCorpus()
Construct a list-based corpus with no entries. |
|
| Method Summary | |
|---|---|
void |
addTest(E e)
Add the specified item to the list of test items. |
void |
addTrain(E e)
Add the specified item to the list of training items. |
void |
permuteCorpus(Random random)
Uses the specified random number generator to permute the training and test cases in the corpus. |
List<E> |
testCases()
Returns an unmodifiable view of the list of test cases underlying this corpus. |
List<E> |
trainCases()
Returns an unmodifiable view of the list of training cases underlying this corpus. |
void |
visitTest(ObjectHandler<E> handler)
Visit the testing section of the corpus, sending events to the specified handler. |
void |
visitTrain(ObjectHandler<E> handler)
Visit the training section of the corpus, sending events to the specified handler. |
| Methods inherited from class com.aliasi.corpus.Corpus |
|---|
visitCorpus, visitCorpus |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ListCorpus()
| Method Detail |
|---|
public void addTest(E e)
e - Item to add as test case.public void addTrain(E e)
e - Item to add as training case.public void permuteCorpus(Random random)
random - Randomizer for corpus.public List<E> testCases()
public List<E> trainCases()
public void visitTrain(ObjectHandler<E> handler)
CorpusThe implementation does nothing. This method should be overridden by subclasses that contain training data.
visitTrain in class Corpus<ObjectHandler<E>>handler - Handler for training events.public void visitTest(ObjectHandler<E> handler)
CorpusThe implementation does nothing. This method should be overridden by subclasses that contain test data.
visitTest in class Corpus<ObjectHandler<E>>handler - Handler for training events.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||