public class QueryResult extends Object implements Comparable<QueryResult>
| Modifier and Type | Field and Description |
|---|---|
static int |
COMBINEDSCORE_UNDEFINED |
int |
connectorId
ID of the connector that generated this result.
|
Date |
creationDate
Creation date of TM entry
|
String |
engine
String providing additional information about the origin.
|
String |
entryId
Unique id of this TM entry.
|
MatchType |
matchType
MatchType of this result. |
String |
origin
String indicating the origin of the result (e.g.
|
static int |
QUALITY_UNDEFINED |
TextFragment |
source
Text of the source for this result.
|
TextFragment |
target
Text of the target for this result.
|
int |
weight
Weight for this result.
|
| Constructor and Description |
|---|
QueryResult() |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(QueryResult other)
This method implements a five way sort on (1) weight (2)
MatchType (3) Score (4) source string match and (5) creation
date. |
boolean |
equals(Object other)
Define equality of state.
|
boolean |
fromMT()
Indicator telling if the result is coming from a machine translation
engine or not.
|
int |
getCombinedScore()
Gets the combined score for this result.
|
int |
getFuzzyScore()
Gets the fuzzy score (i.e., string distance) for this result.
|
int |
getQuality()
Gets the quality rating of the translation in this result.
|
int |
hashCode()
A class that overrides equals must also override hashCode.
|
void |
setCombinedScore(int combinedScore)
Sets the combined score for this result.
|
void |
setFuzzyScore(int fuzzyScore)
Sets the score for this result.
|
void |
setQuality(int quality)
Sets the quality rating of the translation in this result
Each connector is responsible for adjusting the original quality information (if any) to this scale.
|
AltTranslation |
toAltTranslation(TextFragment originalSource,
LocaleId sourceLocId,
LocaleId targetLocId)
Convert a QueryResult to an
AltTranslation |
public static int QUALITY_UNDEFINED
public static int COMBINEDSCORE_UNDEFINED
public int weight
public TextFragment source
public TextFragment target
public Date creationDate
public String entryId
public int connectorId
public String origin
public String engine
public AltTranslation toAltTranslation(TextFragment originalSource, LocaleId sourceLocId, LocaleId targetLocId)
AltTranslationoriginalSource - the original source content.sourceLocId - the LocaleId of the source.targetLocId - the LocaleId of the target.AltTranslation corresponding to this QueryResultpublic boolean fromMT()
public int getQuality()
QUALITY_UNDEFINED if no quality rating is set.public void setQuality(int quality)
quality - the new quality value
(a value between 0 and 100, or QUALITY_UNDEFINED if the value is not defined.InvalidParameterException - if the parameter value is not valid.public int getCombinedScore()
public void setCombinedScore(int combinedScore)
combinedScore - the new combined score value.
This is a re-calculated score to take into account quality (when available)
(a value between 0 and 100, or COMBINEDSCORE_UNDEFINED if the value is not defined.
public int getFuzzyScore()
getCombinedScore()public void setFuzzyScore(int fuzzyScore)
fuzzyScore - the new combined score value
(normally a value between 0 and 100, but some systems can set higher scores).public int compareTo(QueryResult other)
MatchType (3) Score (4) source string match and (5) creation
date. Weight is the primary key, MatchType secondary, score
tertiary and source string quaternary.compareTo in interface Comparable<QueryResult>other - the QueryResult we are comparing against.public boolean equals(Object other)
Copyright © 2022. All rights reserved.