Class MascNamedEntitySampleStream
java.lang.Object
opennlp.tools.util.FilterObjectStream<MascDocument, opennlp.tools.namefind.NameSample>
opennlp.tools.formats.masc.MascNamedEntitySampleStream
- All Implemented Interfaces:
AutoCloseable, opennlp.tools.util.ObjectStream<opennlp.tools.namefind.NameSample>
public class MascNamedEntitySampleStream
extends opennlp.tools.util.FilterObjectStream<MascDocument, opennlp.tools.namefind.NameSample>
-
Constructor Summary
ConstructorsConstructorDescriptionMascNamedEntitySampleStream(opennlp.tools.util.ObjectStream<MascDocument> samples) InitializesMascNamedEntitySampleStreamfrom a stream ofdocuments. -
Method Summary
Methods inherited from class opennlp.tools.util.FilterObjectStream
close
-
Constructor Details
-
MascNamedEntitySampleStream
public MascNamedEntitySampleStream(opennlp.tools.util.ObjectStream<MascDocument> samples) throws IOException InitializesMascNamedEntitySampleStreamfrom a stream ofdocuments.- Parameters:
samples- Aopennlp.tools.util.ObjectStream<MascDocument>of samples.- Throws:
IOException- Thrown if none of the documents has NE labels.
-
-
Method Details
-
read
Reads the next sample of named entities.- Returns:
- One
sentence together with its named entity annotation. - Throws:
IOException- Thrown if the sample cannot be extracted
-
reset
- Specified by:
resetin interfaceopennlp.tools.util.ObjectStream<opennlp.tools.namefind.NameSample>- Overrides:
resetin classopennlp.tools.util.FilterObjectStream<MascDocument, opennlp.tools.namefind.NameSample>- Throws:
IOExceptionUnsupportedOperationException
-