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.


Field Summary
 
Fields inherited from interface gate.SimpleCorpus
CORPUS_DOCLIST_PARAMETER_NAME, CORPUS_NAME_PARAMETER_NAME
 
Method Summary
 void addCorpusListener(CorpusListener l)
          Registers a new CorpusListener with this corpus.
 boolean isDocumentLoaded(int index)
          This method returns true when the document is already loaded in memory.
 void removeCorpusListener(CorpusListener l)
          Removes one of the listeners registered with this corpus.
 void unloadDocument(Document doc)
          Unloads the document from memory.
 
Methods inherited from interface gate.SimpleCorpus
getDocumentName, getDocumentNames, populate, populate, populate
 
Methods inherited from interface gate.LanguageResource
getDataStore, getLRPersistenceId, getParent, isModified, setDataStore, setLRPersistenceId, setParent, sync
 
Methods inherited from interface gate.Resource
cleanup, getParameterValue, init, setParameterValue, setParameterValues
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, setFeatures
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 
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
 

Method Detail

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.