Class TokSpanEventStream
This class reads the TokenSamples from the given IObjectStream<T> and converts the TokenSamples into Events which can be used by the maxent library for training.
public class TokSpanEventStream : AbstractEventStream<TokenSample>, IObjectStream<Event?>, IDisposable
- Inheritance
-
TokSpanEventStream
- Implements
- Inherited Members
Constructors
TokSpanEventStream(IObjectStream<TokenSample?>, bool)
Initializes the current instance.
public TokSpanEventStream(IObjectStream<TokenSample?> tokenSamples, bool skipAlphaNumerics)
Parameters
tokenSamplesIObjectStream<TokenSample>the samples to create events from
skipAlphaNumericsboolif true alpha numerics are skipped
TokSpanEventStream(IObjectStream<TokenSample?>, bool, ITokenContextGenerator)
Initializes the current instance.
public TokSpanEventStream(IObjectStream<TokenSample?> tokenSamples, bool skipAlphaNumerics, ITokenContextGenerator cg)
Parameters
tokenSamplesIObjectStream<TokenSample>the samples to create events from
skipAlphaNumericsboolif true alpha numerics are skipped
cgITokenContextGeneratorthe context generator
TokSpanEventStream(IObjectStream<TokenSample?>, bool, Regex, ITokenContextGenerator)
Initializes the current instance.
public TokSpanEventStream(IObjectStream<TokenSample?> tokenSamples, bool skipAlphaNumerics, Regex alphaNumeric, ITokenContextGenerator cg)
Parameters
tokenSamplesIObjectStream<TokenSample>the samples to create events from
skipAlphaNumericsboolif true alpha numerics are skipped
alphaNumericRegexthe alpha numeric pattern
cgITokenContextGeneratorthe context generator
Methods
CreateEvents(TokenSample)
Adds training events to the event stream for each of the specified tokens.
protected override IEnumerable<Event> CreateEvents(TokenSample tokenSample)
Parameters
tokenSampleTokenSamplecharacter offsets into the specified text.
Returns
- IEnumerable<Event>
The text of the tokens.