Class TokSpanEventStream
java.lang.Object
opennlp.tools.util.AbstractEventStream<opennlp.tools.tokenize.TokenSample>
opennlp.tools.tokenize.TokSpanEventStream
- All Implemented Interfaces:
AutoCloseable, opennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Event>
This class reads the
samples via an Iterator
and converts the samples into events which
can be used by the maxent library for training.-
Constructor Summary
ConstructorsConstructorDescriptionTokSpanEventStream(opennlp.tools.util.ObjectStream<opennlp.tools.tokenize.TokenSample> tokenSamples, boolean skipAlphaNumerics) Initializes a new event stream based on the data stream using aTokenContextGeneratorthat relies on aDefaultTokenContextGenerator.TokSpanEventStream(opennlp.tools.util.ObjectStream<opennlp.tools.tokenize.TokenSample> tokenSamples, boolean skipAlphaNumerics, Pattern alphaNumeric, opennlp.tools.tokenize.TokenContextGenerator cg) Initializes a new event stream based on the data stream using aTokenContextGenerator.TokSpanEventStream(opennlp.tools.util.ObjectStream<opennlp.tools.tokenize.TokenSample> tokenSamples, boolean skipAlphaNumerics, opennlp.tools.tokenize.TokenContextGenerator cg) Initializes a new event stream based on the data stream using aTokenContextGenerator. -
Method Summary
Methods inherited from class AbstractEventStream
close, read, reset
-
Constructor Details
-
TokSpanEventStream
public TokSpanEventStream(opennlp.tools.util.ObjectStream<opennlp.tools.tokenize.TokenSample> tokenSamples, boolean skipAlphaNumerics, Pattern alphaNumeric, opennlp.tools.tokenize.TokenContextGenerator cg) Initializes a new event stream based on the data stream using aTokenContextGenerator.- Parameters:
tokenSamples- Thedata streamfor this event stream.skipAlphaNumerics- Whether alphanumerics are skipped, or not.alphaNumeric- A custom alphanumericPatternornull. Default is:"^[A-Za-z0-9]+$", provided byFactory.DEFAULT_ALPHANUMERIC.cg- ATokenContextGeneratorwhich should be used for the event streamd.
-
TokSpanEventStream
public TokSpanEventStream(opennlp.tools.util.ObjectStream<opennlp.tools.tokenize.TokenSample> tokenSamples, boolean skipAlphaNumerics, opennlp.tools.tokenize.TokenContextGenerator cg) Initializes a new event stream based on the data stream using aTokenContextGenerator.- Parameters:
tokenSamples- Thedata streamfor this event stream.skipAlphaNumerics- Whether alphanumerics are skipped, or not.cg- ATokenContextGeneratorwhich should be used for the event streamd.
-
TokSpanEventStream
public TokSpanEventStream(opennlp.tools.util.ObjectStream<opennlp.tools.tokenize.TokenSample> tokenSamples, boolean skipAlphaNumerics) Initializes a new event stream based on the data stream using aTokenContextGeneratorthat relies on aDefaultTokenContextGenerator.- Parameters:
tokenSamples- Thedata streamfor this event stream.skipAlphaNumerics- Whether alphanumerics are skipped, or not.
-