Class SentimentSample

java.lang.Object
opennlp.tools.sentiment.SentimentSample
All Implemented Interfaces:
Serializable, Sample

public class SentimentSample extends Object implements Sample
Class for holding text used for sentiment analysis.
See Also:
  • Constructor Details

    • SentimentSample

      public SentimentSample(String sentiment, String[] sentence)
      Instantiates a SentimentSample object.
      Parameters:
      sentiment - training sentiment
      sentence - training sentence
    • SentimentSample

      public SentimentSample(String sentiment, String[] sentence, boolean clearAdaptiveData)
  • Method Details

    • getSentiment

      public String getSentiment()
      Returns:
      Returns the sentiment.
    • getSentence

      public String[] getSentence()
      Returns:
      Returns the sentence.
    • isClearAdaptiveDataSet

      public boolean isClearAdaptiveDataSet()
      Returns:
      Returns the value of isClearAdaptiveData, true or false.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object