Class ADSentenceSampleStream
Note: Do not use this class, internal use only!
public class ADSentenceSampleStream : ObjectStreamBase<SentenceSample?>, IObjectStream<SentenceSample?>, IDisposable
- Inheritance
-
ADSentenceSampleStream
- Implements
- Inherited Members
Constructors
ADSentenceSampleStream(IInputStreamFactory, string, bool)
Creates a new SentenceSample stream from a Stream.
public ADSentenceSampleStream(IInputStreamFactory @in, string charsetName, bool includeHeadlines)
Parameters
inIInputStreamFactoryinput stream from the corpus
charsetNamestringthe charset to use while reading the corpus
includeHeadlinesboolif true will output the sentences marked as news headlines
Exceptions
- IOException
if there is an error during reading
ADSentenceSampleStream(IObjectStream<string?>, bool)
Creates a new SentenceSample stream from a line stream, i.e. IObjectStream<T> of string, that could be a PlainTextByLineStream object.
public ADSentenceSampleStream(IObjectStream<string?> lineStream, bool includeHeadlines)
Parameters
lineStreamIObjectStream<string>a stream of lines as string
includeHeadlinesboolif true will output the sentences marked as news headlines
Methods
Dispose(bool)
Releases the resources from this object stream.
protected override void Dispose(bool disposing)
Parameters
disposingbool
Read()
Returns the next object. Calling this method repeatedly until it returns
null will return each object from the underlying source exactly once.
public override SentenceSample? Read()
Returns
- SentenceSample
the next object or
nullto signal that the stream is exhausted
Exceptions
- IOException
if there is an error during reading
- IOException
if there is an error during reading
Reset()
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.
public override void Reset()
Exceptions
- IOException
if there is an error during resetting the stream
- NotSupportedException
if reset is not supported on this stream
- IOException
if there is an error during resetting the stream
- NotSupportedException
if the underlying stream does not support resetting