Record Class SentimentAnalyzer.SentimentResult
java.lang.Object
java.lang.Record
org.episteme.social.linguistics.SentimentAnalyzer.SentimentResult
- All Implemented Interfaces:
Serializable
- Enclosing class:
SentimentAnalyzer
public static record SentimentAnalyzer.SentimentResult(SentimentAnalyzer.Sentiment sentiment, double score, double confidence, Map<String,Double> wordScores)
extends Record
implements Serializable
Result of a sentiment analysis operation.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSentimentResult(SentimentAnalyzer.Sentiment sentiment, double score, double confidence, Map<String, Double> wordScores) Creates an instance of aSentimentResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theconfidencerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doublescore()Returns the value of thescorerecord component.Returns the value of thesentimentrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thewordScoresrecord component.
-
Constructor Details
-
SentimentResult
public SentimentResult(SentimentAnalyzer.Sentiment sentiment, double score, double confidence, Map<String, Double> wordScores) Creates an instance of aSentimentResultrecord class.- Parameters:
sentiment- the value for thesentimentrecord componentscore- the value for thescorerecord componentconfidence- the value for theconfidencerecord componentwordScores- the value for thewordScoresrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
sentiment
Returns the value of thesentimentrecord component.- Returns:
- the value of the
sentimentrecord component
-
score
public double score()Returns the value of thescorerecord component.- Returns:
- the value of the
scorerecord component
-
confidence
public double confidence()Returns the value of theconfidencerecord component.- Returns:
- the value of the
confidencerecord component
-
wordScores
-