public class BratDocumentStream extends java.lang.Object implements ObjectStream<BratDocument>
| Constructor and Description |
|---|
BratDocumentStream(AnnotationConfiguration config,
java.io.File bratCorpusDirectory,
boolean searchRecursive,
java.io.FileFilter fileFilter)
Creates a BratDocumentStream which reads the documents from the given input directory.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the
ObjectStream and releases all allocated
resources. |
BratDocument |
read()
Returns the next object.
|
void |
reset()
Repositions the stream at the beginning and the previously seen object sequence
will be repeated exactly.
|
public BratDocumentStream(AnnotationConfiguration config, java.io.File bratCorpusDirectory, boolean searchRecursive, java.io.FileFilter fileFilter) throws java.io.IOException
config - the annotation.conf from the brat project as an Annotation Configuration objectbratCorpusDirectory - the directory containing all the brat training data filessearchRecursive - specifies if the corpus directory should be traversed recursively
to find training data files.fileFilter - a custom file filter to filter out certain files or null to accept all filesjava.io.IOException - if reading from the brat directory fails in anywaypublic BratDocument read() throws java.io.IOException
ObjectStreamread in interface ObjectStream<BratDocument>java.io.IOException - if there is an error during readingpublic void reset()
ObjectStreamreset in interface ObjectStream<BratDocument>public void close()
ObjectStreamObjectStream and releases all allocated
resources. After close was called its not allowed to call
read or reset.close in interface java.lang.AutoCloseableclose in interface ObjectStream<BratDocument>Copyright © 2010 - 2019 Adobe. All Rights Reserved