Class WordTagSampleStream

Namespace
NOpenNLP.Tools.Postag
Assembly
NOpenNLP.Tools.dll

A stream filter which reads a sentence per line which contains words and tags in word_tag format and outputs a POSSample objects.

public class WordTagSampleStream : FilterObjectStream<string?, POSSample?>, IObjectStream<POSSample?>, IDisposable
Inheritance
WordTagSampleStream
Implements
Inherited Members

Constructors

WordTagSampleStream(IObjectStream<string?>)

A stream filter which reads a sentence per line which contains words and tags in word_tag format and outputs a POSSample objects.

public WordTagSampleStream(IObjectStream<string?> sentences)

Parameters

sentences IObjectStream<string>

the sentences

Methods

Read()

Parses the next sentence and return the next POSSample object.

If an error occurs an empty POSSample object is returned and an warning message is logged. Usually it does not matter if one of many sentences is ignored.

TODO: An exception in error case should be thrown.

public override POSSample? Read()

Returns

POSSample

Exceptions

IOException

if there is an error during reading