Package opennlp.tools.sentiment
Class SentimentEventStream
java.lang.Object
opennlp.tools.util.AbstractEventStream<SentimentSample>
opennlp.tools.sentiment.SentimentEventStream
- All Implemented Interfaces:
AutoCloseable,ObjectStream<Event>
Class for creating events for Sentiment Analysis that is later sent to
MaxEnt.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSentimentEventStream(ObjectStream<SentimentSample> samples, SentimentContextGenerator createContextGenerator) Instantiates aevent stream. -
Method Summary
Modifier and TypeMethodDescriptioncreateEvents(SentimentSample sample) Creates events fromsentiment samples.Methods inherited from class opennlp.tools.util.AbstractEventStream
close, read, reset
-
Field Details
-
contextGenerator
-
-
Constructor Details
-
SentimentEventStream
public SentimentEventStream(ObjectStream<SentimentSample> samples, SentimentContextGenerator createContextGenerator) Instantiates aevent stream.- Parameters:
samples- the sentiment samples to be usedcreateContextGenerator- the context generator to be used
-
-
Method Details
-
createEvents
Creates events fromsentiment samples.- Specified by:
createEventsin classAbstractEventStream<SentimentSample>- Parameters:
sample- the sentiment sample to be used- Returns:
- event iterator
-