gate
Interface Corpus
- All Superinterfaces:
- Collection<Document>, FeatureBearer, Iterable<Document>, LanguageResource, List<Document>, NameBearer, Resource, Serializable, SimpleCorpus
- All Known Subinterfaces:
- IndexedCorpus
- All Known Implementing Classes:
- CorpusImpl, SerialCorpusImpl
public interface Corpus
- extends SimpleCorpus
Corpora are lists of Document. TIPSTER equivalent: Collection.
Methods inherited from interface java.util.List |
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray |
unloadDocument
void unloadDocument(Document doc)
- Unloads the document from memory. Only needed if memory
preservation is an issue. Only supported for Corpus which is
stored in a Datastore. To get this document back in memory,
use get() on Corpus or if you have its persistent ID, request it
from the Factory.
Transient Corpus objects do nothing,
because there would be no way to get the document back
again afterwards.
- Parameters:
doc
- Document to be unloaded from memory.
isDocumentLoaded
boolean isDocumentLoaded(int index)
- This method returns true when the document is already loaded in memory.
The transient corpora will always return true as they can only contain
documents that are present in the memory.
removeCorpusListener
void removeCorpusListener(CorpusListener l)
- Removes one of the listeners registered with this corpus.
- Parameters:
l
- the listener to be removed.
addCorpusListener
void addCorpusListener(CorpusListener l)
- Registers a new
CorpusListener
with this corpus.
- Parameters:
l
- the listener to be added.