Class BratNameSampleStream

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

Generates Name Sample objects for a Brat Document object.

public class BratNameSampleStream : SegmenterObjectStream<BratDocument, NameSample>, IObjectStream<NameSample?>, IDisposable
Inheritance
BratNameSampleStream
Implements
Inherited Members

Constructors

BratNameSampleStream(ISentenceDetector, ITokenizer, IObjectStream<BratDocument?>)

Creates a new BratNameSampleStream.

public BratNameSampleStream(ISentenceDetector sentDetector, ITokenizer tokenizer, IObjectStream<BratDocument?> samples)

Parameters

sentDetector ISentenceDetector

a ISentenceDetector instance

tokenizer ITokenizer

a ITokenizer instance

samples IObjectStream<BratDocument>

a BratDocument IObjectStream<T>

BratNameSampleStream(ISentenceDetector, ITokenizer, IObjectStream<BratDocument?>, ISet<string>?)

Creates a new BratNameSampleStream.

public BratNameSampleStream(ISentenceDetector sentDetector, ITokenizer tokenizer, IObjectStream<BratDocument?> samples, ISet<string>? nameTypes)

Parameters

sentDetector ISentenceDetector

a ISentenceDetector instance

tokenizer ITokenizer

a ITokenizer instance

samples IObjectStream<BratDocument>

a BratDocument IObjectStream<T>

nameTypes ISet<string>

the name types to use or null if all name types

BratNameSampleStream(SentenceModel, TokenizerModel, IObjectStream<BratDocument?>)

Creates a new BratNameSampleStream.

public BratNameSampleStream(SentenceModel sentModel, TokenizerModel tokenModel, IObjectStream<BratDocument?> samples)

Parameters

sentModel SentenceModel

a SentenceModel model

tokenModel TokenizerModel

a TokenizerModel model

samples IObjectStream<BratDocument>

a BratDocument IObjectStream<T>

BratNameSampleStream(SentenceModel, TokenizerModel, IObjectStream<BratDocument?>, ISet<string>?)

Creates a new BratNameSampleStream.

public BratNameSampleStream(SentenceModel sentModel, TokenizerModel tokenModel, IObjectStream<BratDocument?> samples, ISet<string>? nameTypes)

Parameters

sentModel SentenceModel

a SentenceModel model

tokenModel TokenizerModel

a TokenizerModel model

samples IObjectStream<BratDocument>

a BratDocument IObjectStream<T>

nameTypes ISet<string>

the name types to use or null if all name types

Methods

Read(BratDocument)

Splits the given sample into the samples this stream emits.

protected override IList<NameSample>? Read(BratDocument sample)

Parameters

sample BratDocument

the incoming sample to segment

Returns

IList<NameSample>

the outgoing samples, or null if the sample produced none

Exceptions

IOException

if there is an error during reading

IOException

if there is an error during reading