Class NameSampleCountersStream

Namespace
NOpenNLP.Tools.Cmdline.Namefind
Assembly
nopennlp.dll

Counts tokens, sentences and names by type

public class NameSampleCountersStream : FilterObjectStream<NameSample?, NameSample?>, IObjectStream<NameSample?>, IDisposable
Inheritance
NameSampleCountersStream
Implements
Inherited Members

Constructors

NameSampleCountersStream(IObjectStream<NameSample?>)

protected NameSampleCountersStream(IObjectStream<NameSample?> samples)

Parameters

samples IObjectStream<NameSample>

Properties

NameCounters

public virtual IDictionary<string?, int> NameCounters { get; }

Property Value

IDictionary<string, int>

SentenceCount

public virtual int SentenceCount { get; }

Property Value

int

TokenCount

public virtual int TokenCount { get; }

Property Value

int

Methods

PrintSummary()

public virtual void PrintSummary()

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

Returns

NameSample

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

Exceptions

IOException

if there is an error during reading

IOException

if reading from the underlying stream fails

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 resetting the underlying stream fails

NotSupportedException

if the underlying stream cannot be reset