|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.okapi.common.annotation.AltTranslation
public class AltTranslation
Stores the data representing an alternate translation.
This object is used with the AltTranslationsAnnotation annotation.
Note that the content of the source and target is always un-segmented.
| Field Summary | |
|---|---|
static java.lang.String |
ORIGIN_SOURCEDOC
Origin string indicating that the match is coming from a source input document (e.g. |
| Constructor Summary | |
|---|---|
AltTranslation(LocaleId sourceLocId,
LocaleId targetLocId,
TextFragment originalSource,
TextFragment alternateSource,
TextFragment alternateTarget,
MatchType type,
int combinedScore,
java.lang.String origin)
Creates a new AltTranslation object. |
|
AltTranslation(LocaleId sourceLocId,
LocaleId targetLocId,
TextFragment originalSource,
TextFragment alternateSource,
TextFragment alternateTarget,
MatchType type,
int combinedScore,
java.lang.String origin,
int fuzzyScore,
int qualityScore)
Creates a new AltTranslation object. |
|
| Method Summary | |
|---|---|
int |
compareTo(AltTranslation other)
This method implements a three way sort on (1) AltTranslationType (2) Score (3) source string match. |
boolean |
equals(java.lang.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 entry. |
java.lang.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()
|
java.lang.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. |
MatchType |
getType()
Gets the type of this alternate translation. |
int |
hashCode()
A class that overrides equals must also override hashCode. |
void |
setCombinedScore(int score)
Sets the score of this alternate translation. |
void |
setEngine(java.lang.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(java.lang.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 |
setType(MatchType type)
Sets the match type of this alternate translation. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ORIGIN_SOURCEDOC
| Constructor Detail |
|---|
public AltTranslation(LocaleId sourceLocId,
LocaleId targetLocId,
TextFragment originalSource,
TextFragment alternateSource,
TextFragment alternateTarget,
MatchType type,
int combinedScore,
java.lang.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,
java.lang.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 engine| Method Detail |
|---|
public 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 java.lang.String getOrigin()
public java.lang.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(java.lang.String origin)
origin - the new origin.public void setEngine(java.lang.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 boolean fromMT()
public int compareTo(AltTranslation other)
compareTo in interface java.lang.Comparable<AltTranslation>other - the AltTranslation we are comparing against.
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectother - the object to compare with.
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||