opennlp.tools.formats
Class Conll03NameSampleStream
java.lang.Object
opennlp.tools.formats.Conll03NameSampleStream
- All Implemented Interfaces:
- ObjectStream<NameSample>
public class Conll03NameSampleStream
- extends Object
- implements ObjectStream<NameSample>
An import stream which can parse the CONLL03 data.
Method Summary |
void |
close()
Closes the ObjectStream and releases all allocated
resources. |
NameSample |
read()
Returns the next object. |
void |
reset()
Repositions the stream at the beginning and the previously seen object sequence
will be repeated exactly. |
Conll03NameSampleStream
public Conll03NameSampleStream(Conll03NameSampleStream.LANGUAGE lang,
ObjectStream<String> lineStream,
int types)
- Parameters:
lang
- lineStream
- types
-
Conll03NameSampleStream
public Conll03NameSampleStream(Conll03NameSampleStream.LANGUAGE lang,
InputStream in,
int types)
- Parameters:
lang
- in
- types
-
read
public NameSample read()
throws IOException
- Description copied from interface:
ObjectStream
- Returns the next object. Calling this method repeatedly until it returns
null will return each object from the underlying source exactly once.
- Specified by:
read
in interface ObjectStream<NameSample>
- Returns:
- the next object or null to signal that the stream is exhausted
- Throws:
IOException
reset
public void reset()
throws IOException,
UnsupportedOperationException
- Description copied from interface:
ObjectStream
- Repositions 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:
reset
in interface ObjectStream<NameSample>
- Throws:
IOException
UnsupportedOperationException
close
public void close()
throws IOException
- Description copied from interface:
ObjectStream
- Closes the
ObjectStream
and releases all allocated
resources. After close was called its not allowed to call
read or reset.
- Specified by:
close
in interface ObjectStream<NameSample>
- Throws:
IOException
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.