Package opennlp.tools.formats.masc
Klasse MascDocumentStream
java.lang.Object
opennlp.tools.formats.masc.MascDocumentStream
- Alle implementierten Schnittstellen:
AutoCloseable,ObjectStream<MascDocument>
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungMascDocumentStream(File mascCorpusDirectory) MascDocumentStream(File mascCorpusDirectory, boolean searchRecursive, FileFilter fileFilter) Creates a MascDocumentStream to read the documents from a given directory. -
Methodenübersicht
-
Konstruktordetails
-
MascDocumentStream
- Löst aus:
IOException
-
MascDocumentStream
public MascDocumentStream(File mascCorpusDirectory, boolean searchRecursive, FileFilter fileFilter) throws IOException Creates a MascDocumentStream to read the documents from a given directory. Works iff all annotation files mentioned in the headers are present.- Parameter:
mascCorpusDirectory- the directory containing all the MASC filessearchRecursive- whether the search should go through subdirectoriesfileFilter- a custom file filter to filter out some files or null to accept anything- Löst aus:
IOException- if any stage of the stream creation fails
-
-
Methodendetails
-
reset
public void reset()Reset the reading of all documents to the first sentence. Reset the corpus to the first document.- Angegeben von:
resetin SchnittstelleObjectStream<MascDocument>
-
read
Return the next document. Client needs to check if this document has the necessary annotations.- Angegeben von:
readin SchnittstelleObjectStream<MascDocument>- Gibt zurück:
- A corpus document with all its annotations.
- Löst aus:
IOException- if anything goes wrong.
-
close
public void close()Remove the corpus from the memory.- Angegeben von:
closein SchnittstelleAutoCloseable- Angegeben von:
closein SchnittstelleObjectStream<MascDocument>
-