Class BratNameSampleStream
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
sentDetectorISentenceDetectora ISentenceDetector instance
tokenizerITokenizera ITokenizer instance
samplesIObjectStream<BratDocument>
BratNameSampleStream(ISentenceDetector, ITokenizer, IObjectStream<BratDocument?>, ISet<string>?)
Creates a new BratNameSampleStream.
public BratNameSampleStream(ISentenceDetector sentDetector, ITokenizer tokenizer, IObjectStream<BratDocument?> samples, ISet<string>? nameTypes)
Parameters
sentDetectorISentenceDetectora ISentenceDetector instance
tokenizerITokenizera ITokenizer instance
samplesIObjectStream<BratDocument>nameTypesISet<string>the name types to use or
nullif all name types
BratNameSampleStream(SentenceModel, TokenizerModel, IObjectStream<BratDocument?>)
Creates a new BratNameSampleStream.
public BratNameSampleStream(SentenceModel sentModel, TokenizerModel tokenModel, IObjectStream<BratDocument?> samples)
Parameters
sentModelSentenceModela SentenceModel model
tokenModelTokenizerModela TokenizerModel model
samplesIObjectStream<BratDocument>
BratNameSampleStream(SentenceModel, TokenizerModel, IObjectStream<BratDocument?>, ISet<string>?)
Creates a new BratNameSampleStream.
public BratNameSampleStream(SentenceModel sentModel, TokenizerModel tokenModel, IObjectStream<BratDocument?> samples, ISet<string>? nameTypes)
Parameters
sentModelSentenceModela SentenceModel model
tokenModelTokenizerModela TokenizerModel model
samplesIObjectStream<BratDocument>nameTypesISet<string>the name types to use or
nullif all name types
Methods
Read(BratDocument)
Splits the given sample into the samples this stream emits.
protected override IList<NameSample>? Read(BratDocument sample)
Parameters
sampleBratDocumentthe incoming sample to segment
Returns
- IList<NameSample>
the outgoing samples, or
nullif the sample produced none
Exceptions
- IOException
if there is an error during reading
- IOException
if there is an error during reading