Class SegmenterObjectStream<S, T>

Namespace
NOpenNLP.Tools.Formats.Brat
Assembly
NOpenNLP.Tools.dll

An IObjectStream<T> which splits each incoming sample into zero or more outgoing samples, emitting them one at a time.

public abstract class SegmenterObjectStream<S, T> : FilterObjectStream<S?, T?>, IObjectStream<T?>, IDisposable where S : class where T : class

Type Parameters

S

the type of the source/input stream

T

the type of this stream

Inheritance
SegmenterObjectStream<S, T>
Implements
Derived
Inherited Members

Constructors

SegmenterObjectStream(IObjectStream<S?>)

An IObjectStream<T> which splits each incoming sample into zero or more outgoing samples, emitting them one at a time.

protected SegmenterObjectStream(IObjectStream<S?> @in)

Parameters

in IObjectStream<S>

Methods

Dispose(bool)

Releases the resources from this object stream.

protected override void Dispose(bool disposing)

Parameters

disposing bool

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 sealed T? Read()

Returns

T

the next object or null to signal that the stream is exhausted

Exceptions

IOException

if there is an error during reading

IOException

if there is an error during reading

Read(S)

Splits the given sample into the samples this stream emits.

protected abstract IList<T>? Read(S sample)

Parameters

sample S

the incoming sample to segment

Returns

IList<T>

the outgoing samples, or null if the sample produced none

Exceptions

IOException

if there is an error during reading