Package opennlp.tools.formats
Class Conll03NameSampleStream
java.lang.Object
opennlp.tools.formats.Conll03NameSampleStream
- All Implemented Interfaces:
- AutoCloseable,- ObjectStream<NameSample>
An import stream which can parse the CONLL03 data.
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructorsConstructorDescriptionConll03NameSampleStream(Conll03NameSampleStream.LANGUAGE lang, InputStreamFactory in, int types) Initializes aConll03NameSampleStream.Conll03NameSampleStream(Conll03NameSampleStream.LANGUAGE lang, ObjectStream<String> lineStream, int types) Initializes aConll03NameSampleStream.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Closes theObjectStreamand releases all allocated resources.read()Returns the nextObjectStreamobject.voidreset()Repositions the stream at the beginning and the previously seen object sequence will be repeated exactly.
- 
Constructor Details- 
Conll03NameSampleStreampublic Conll03NameSampleStream(Conll03NameSampleStream.LANGUAGE lang, ObjectStream<String> lineStream, int types) Initializes aConll03NameSampleStream.- Parameters:
- lang- The language of the CONLL 03 data.
- lineStream- An- ObjectStream<String>over the lines in the CONLL 03 data file.
- types- The entity types to include in the Name Sample object stream.
 
- 
Conll03NameSampleStreampublic Conll03NameSampleStream(Conll03NameSampleStream.LANGUAGE lang, InputStreamFactory in, int types) throws IOException Initializes aConll03NameSampleStream.- Parameters:
- lang- The language of the CONLL 03 data.
- in- The- InputStreamFactoryfor the input file.
- types- The entity types to include in the Name Sample object stream.
- Throws:
- IOException- Thrown if IO errors occurred.
 
 
- 
- 
Method Details- 
readDescription copied from interface:ObjectStreamReturns the nextObjectStreamobject. Calling this method repeatedly until it returnsnullwill return each object from the underlying source exactly once.- Specified by:
- readin interface- ObjectStream<NameSample>
- Returns:
- The next object or nullto signal that the stream is exhausted.
- Throws:
- IOException- Thrown if there is an error during reading.
 
- 
resetDescription copied from interface:ObjectStreamRepositions the stream at the beginning and the previously seen object sequence will be repeated exactly. This method can be used to re-read the stream if multiple passes over the objects are required.The implementation of this method is optional. - Specified by:
- resetin interface- ObjectStream<NameSample>
- Throws:
- IOException- Thrown if there is an error during resetting the stream.
- UnsupportedOperationException- Thrown if the- reset()is not supported. By default, this is the case.
 
- 
closeDescription copied from interface:ObjectStreamCloses theObjectStreamand releases all allocated resources. After close was called, it's not allowed to callObjectStream.read()orObjectStream.reset().- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- ObjectStream<NameSample>
- Throws:
- IOException- Thrown if there is an error during closing the stream.
 
 
-