Package opennlp.tools.tokenize
Class TokSpanEventStream
- java.lang.Object
-
- opennlp.tools.util.AbstractEventStream<TokenSample>
-
- opennlp.tools.tokenize.TokSpanEventStream
-
- All Implemented Interfaces:
AutoCloseable
,ObjectStream<Event>
public class TokSpanEventStream extends AbstractEventStream<TokenSample>
-
-
Constructor Summary
Constructors Constructor Description TokSpanEventStream(ObjectStream<TokenSample> tokenSamples, boolean skipAlphaNumerics)
Initializes a new event stream based on the data stream using aTokenContextGenerator
that relies on aDefaultTokenContextGenerator
.TokSpanEventStream(ObjectStream<TokenSample> tokenSamples, boolean skipAlphaNumerics, Pattern alphaNumeric, TokenContextGenerator cg)
Initializes a new event stream based on the data stream using aTokenContextGenerator
.TokSpanEventStream(ObjectStream<TokenSample> tokenSamples, boolean skipAlphaNumerics, TokenContextGenerator cg)
Initializes a new event stream based on the data stream using aTokenContextGenerator
.
-
-
-
Constructor Detail
-
TokSpanEventStream
public TokSpanEventStream(ObjectStream<TokenSample> tokenSamples, boolean skipAlphaNumerics, Pattern alphaNumeric, TokenContextGenerator cg)
Initializes a new event stream based on the data stream using aTokenContextGenerator
.- Parameters:
tokenSamples
- Thedata stream
for this event stream.skipAlphaNumerics
- Whether alphanumerics are skipped, or not.alphaNumeric
- A custom alphanumericPattern
ornull
. Default is:"^[A-Za-z0-9]+$"
, provided byFactory.DEFAULT_ALPHANUMERIC
.cg
- ATokenContextGenerator
which should be used for the event streamd
.
-
TokSpanEventStream
public TokSpanEventStream(ObjectStream<TokenSample> tokenSamples, boolean skipAlphaNumerics, TokenContextGenerator cg)
Initializes a new event stream based on the data stream using aTokenContextGenerator
.- Parameters:
tokenSamples
- Thedata stream
for this event stream.skipAlphaNumerics
- Whether alphanumerics are skipped, or not.cg
- ATokenContextGenerator
which should be used for the event streamd
.
-
TokSpanEventStream
public TokSpanEventStream(ObjectStream<TokenSample> tokenSamples, boolean skipAlphaNumerics)
Initializes a new event stream based on the data stream using aTokenContextGenerator
that relies on aDefaultTokenContextGenerator
.- Parameters:
tokenSamples
- Thedata stream
for this event stream.skipAlphaNumerics
- Whether alphanumerics are skipped, or not.
-
-