Record Class QuestionMatcher.ScoredQuestion
java.lang.Object
java.lang.Record
org.ek9lang.assist.QuestionMatcher.ScoredQuestion
- Enclosing class:
QuestionMatcher
public static record QuestionMatcher.ScoredQuestion(QuestionAndAnswer question, double score, int questionRelevance)
extends Record
A question paired with its BM25F match score and question-text relevance.
Higher score means better match. Higher questionRelevance breaks ties.
-
Constructor Summary
ConstructorsConstructorDescriptionScoredQuestion(QuestionAndAnswer question, double score, int questionRelevance) Creates an instance of aScoredQuestionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.question()Returns the value of thequestionrecord component.intReturns the value of thequestionRelevancerecord component.doublescore()Returns the value of thescorerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ScoredQuestion
Creates an instance of aScoredQuestionrecord class.- Parameters:
question- the value for thequestionrecord componentscore- the value for thescorerecord componentquestionRelevance- the value for thequestionRelevancerecord 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. -
question
Returns the value of thequestionrecord component.- Returns:
- the value of the
questionrecord component
-
score
public double score()Returns the value of thescorerecord component.- Returns:
- the value of the
scorerecord component
-
questionRelevance
public int questionRelevance()Returns the value of thequestionRelevancerecord component.- Returns:
- the value of the
questionRelevancerecord component
-