public class AltTranslation extends Object implements Comparable<AltTranslation>
This object is used with the AltTranslationsAnnotation annotation.
Note that the content of the source and target is always un-segmented.
| Modifier and Type | Field and Description |
|---|---|
static String |
ORIGIN_SOURCEDOC
Origin string indicating that the match is coming from a source input document
(e.g.
|
| Constructor and Description |
|---|
AltTranslation(LocaleId sourceLocId,
LocaleId targetLocId,
TextFragment originalSource,
TextFragment alternateSource,
TextFragment alternateTarget,
MatchType type,
int combinedScore,
String origin)
Creates a new AltTranslation object.
|
AltTranslation(LocaleId sourceLocId,
LocaleId targetLocId,
TextFragment originalSource,
TextFragment alternateSource,
TextFragment alternateTarget,
MatchType type,
int combinedScore,
String origin,
int fuzzyScore,
int qualityScore)
Creates a new AltTranslation object.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(AltTranslation other)
This method implements a three way sort on (1) AltTranslationType (2) Score (3)
source string match.
|
boolean |
equals(Object other)
Define equality of state.
|
boolean |
fromMT()
Indicator telling if the result is coming from a machine translation engine or not.
|
String |
getALttransType() |
int |
getCombinedScore()
Gets the combined score for this entry.
|
String |
getEngine()
Gets the engine for this entry (can be null).
|
ITextUnit |
getEntry()
Gets the text unit for this entry.
|
boolean |
getFromOriginal()
Indicates if this alternate translation was provided from the original document.
|
int |
getFuzzyScore() |
String |
getOrigin()
Gets the origin for this entry (can be null).
|
int |
getQualityScore() |
TextContainer |
getSource()
Gets the source content of this entry (can be empty)
If the result is empty, it means the source is the same as the source of the object (segment or text container)
is attached to.
|
LocaleId |
getSourceLocale()
Gets the source locale for this entry.
|
TextContainer |
getTarget()
Gets the target content of this entry.
|
LocaleId |
getTargetLocale()
Gets the target locale for this entry.
|
XLIFFTool |
getTool() |
MatchType |
getType()
Gets the type of this alternate translation.
|
int |
hashCode()
A class that overrides equals must also override hashCode.
|
void |
setAltTransType(String alttranstype) |
void |
setCombinedScore(int score)
Sets the score of this alternate translation.
|
void |
setEngine(String engine)
Sets the engine of this alternate translation.
|
void |
setFromOriginal(boolean fromOriginal)
Sets the flag indicating if this alternate translation was provided from the original document
(e.g.
|
void |
setFuzzyScore(int fuzzyScore) |
void |
setOrigin(String origin)
Sets the origin of this alternate translation.
|
void |
setQualityScore(int qualityScore) |
void |
setTarget(LocaleId targetLocId,
TextFragment alternateTarget)
Sets the target parts of this alternate translation.
|
void |
setTool(XLIFFTool tool) |
void |
setType(MatchType type)
Sets the match type of this alternate translation.
|
String |
toString() |
public static final String ORIGIN_SOURCEDOC
public AltTranslation(LocaleId sourceLocId, LocaleId targetLocId, TextFragment originalSource, TextFragment alternateSource, TextFragment alternateTarget, MatchType type, int combinedScore, String origin)
sourceLocId - the locale of the source.targetLocId - the locale of the target.originalSource - the original source content.alternateSource - the source content corresponding to the alternate translation (can be null).alternateTarget - the content of alternate translation.type - the type of alternate translation.combinedScore - the combined score for this alternate translation (must be between 0 and 100).origin - an optional identifier for the origin of this alternate translation.public AltTranslation(LocaleId sourceLocId, LocaleId targetLocId, TextFragment originalSource, TextFragment alternateSource, TextFragment alternateTarget, MatchType type, int combinedScore, String origin, int fuzzyScore, int qualityScore)
sourceLocId - the locale of the source.targetLocId - the locale of the target.originalSource - the original source content.alternateSource - the source content corresponding to the alternate translation (can be null).alternateTarget - the content of alternate translation.type - the type of alternate translation.combinedScore - the combined score for this alternate translation (must be between 0 and 100).
Combined score is usually a combination of fuzzyScore and qualityScore.origin - an optional identifier for the origin of this alternate translation.fuzzyScore - - fuzzy score (string distance) between the original source and alternate translation sourcequalityScore - - optional quality score from the TM or MT enginepublic TextContainer getTarget()
public void setTarget(LocaleId targetLocId, TextFragment alternateTarget)
targetLocId - the target locale.alternateTarget - the content of the alternate translation.public LocaleId getSourceLocale()
public LocaleId getTargetLocale()
public TextContainer getSource()
public int getCombinedScore()
public String getOrigin()
public String getEngine()
public ITextUnit getEntry()
public MatchType getType()
MatchType values.public void setType(MatchType type)
type - the new match type.public void setCombinedScore(int score)
score - the new score.public void setOrigin(String origin)
origin - the new origin.public void setEngine(String engine)
engine - the new engine.public void setFromOriginal(boolean fromOriginal)
fromOriginal - true if the match was provided by the original document.public boolean getFromOriginal()
public int getFuzzyScore()
public void setFuzzyScore(int fuzzyScore)
public int getQualityScore()
public void setQualityScore(int qualityScore)
public XLIFFTool getTool()
public void setTool(XLIFFTool tool)
public boolean fromMT()
public String getALttransType()
public void setAltTransType(String alttranstype)
public int compareTo(AltTranslation other)
compareTo in interface Comparable<AltTranslation>other - the AltTranslation we are comparing against.public boolean equals(Object other)
public int hashCode()
Copyright © 2021. All rights reserved.