Class ScoringResult
Represents the score for a search result.
Inherited Members
Namespace: SdlSdl.LanguagePlatformTranslationMemory
Assembly: Sdl.LanguagePlatform.TranslationMemory.dll
Syntax
[DataContract]
public class ScoringResult
Constructors
ScoringResult()
Initializes a new instance with default values.
Declaration
public ScoringResult()
Properties
AppliedPenalties
Gets or sets the list of applied penalties for this result.
Declaration
[DataMember]
public List<AppliedPenalty> AppliedPenalties { get; set; }
Property Value
Type | Description |
---|---|
ListAppliedPenalty |
BaseScore
Gets or sets the base score for this result.
Declaration
[DataMember]
public int BaseScore { get; set; }
Property Value
Type | Description |
---|---|
int |
EditDistance
Gets or sets the edit distance for this result. The edit distance is null for concordance searches and is only set for standard searches.
Declaration
[DataMember]
public EditDistance EditDistance { get; set; }
Property Value
Type | Description |
---|---|
EditDistance |
IdContextMatch
Gets or sets SIDContext
Declaration
[DataMember]
public bool IdContextMatch { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsExactMatch
Gets a value indicating whether this result is an exact match. This is the case if the base score is 100.
Declaration
public bool IsExactMatch { get; }
Property Value
Type | Description |
---|---|
bool |
IsStructureContextMatch
Gets or sets whether or not this match also matches the structural document context. If no structure context was specified during the search, the value will be false.
Declaration
[DataMember]
public bool IsStructureContextMatch { get; set; }
Property Value
Type | Description |
---|---|
bool |
Match
Gets the final match score for this result, which is the base score minus the maluses of any applied penalties.
Declaration
public int Match { get; }
Property Value
Type | Description |
---|---|
int |
MatchingConcordanceRanges
Gets or sets the matching concordance ranges for this result. This field is null for standard searches and only set for concordance searches. The value identifies the ranges in the memory source segment which match the concordance search.
Note that the ranges are not necessarily consecutive. They are, however, sorted.
Declaration
[DataMember]
public List<SegmentRange> MatchingConcordanceRanges { get; set; }
Property Value
Type | Description |
---|---|
ListSegmentRange |
MemoryTagsDeleted
Gets or sets whether the tags are deleted or not for this result.
Declaration
[DataMember]
public bool MemoryTagsDeleted { get; set; }
Property Value
Type | Description |
---|---|
bool |
PlaceableFormatChanges
Declaration
[DataMember]
public int PlaceableFormatChanges { get; set; }
Property Value
Type | Description |
---|---|
int |
ResolvedPlaceables
Gets or sets the number of placeables that can be resolved for this result.
Declaration
[DataMember]
public int ResolvedPlaceables { get; set; }
Property Value
Type | Description |
---|---|
int |
TagMismatch
Gets or sets whether there are any tag mismatches. This flag is set even if no tag mismatch penalty is configured.
Declaration
[DataMember]
public bool TagMismatch { get; set; }
Property Value
Type | Description |
---|---|
bool |
TargetSegmentDiffers
Valid only when a whole TU is searched, and is only set if it's a 100% match. Not set for fuzzy or concordance matches.
Declaration
[DataMember]
public bool TargetSegmentDiffers { get; set; }
Property Value
Type | Description |
---|---|
bool |
TextContextMatch
Gets or sets the type of context match for this result, if applicable.
Declaration
[DataMember]
public TextContextMatch TextContextMatch { get; set; }
Property Value
Type | Description |
---|---|
TextContextMatch |
TextReplacements
Gets or sets the number of TextReplacements applied to this result.
Declaration
[DataMember]
public int TextReplacements { get; set; }
Property Value
Type | Description |
---|---|
int |
Methods
ApplyFilter(string, int)
Applies a penalty to the current score, with a specified filter and cost.
Declaration
public void ApplyFilter(string filterName, int malus)
Parameters
Type | Name | Description |
---|---|---|
string | filterName | The filter name. |
int | malus | The penalty cost. |
ApplyPenalty(Penalty)
Applies a penalty to the current score unless a penalty with the same type has already been applied.
Declaration
public void ApplyPenalty(Penalty pt)
Parameters
Type | Name | Description |
---|---|---|
Penalty | pt | The penalty. |
FindAppliedFilter(string)
Retrieves the applied penalty for a specified filter.
Declaration
public AppliedPenalty FindAppliedFilter(string filterName)
Parameters
Type | Name | Description |
---|---|---|
string | filterName | The filter name. |
Returns
Type | Description |
---|---|
AppliedPenalty | The applied penalty for the specified filter or null if no filter with that name can be found. |
FindPenalty(PenaltyType)
Retrieves the applied penalty for a specified penalty type.
Declaration
public AppliedPenalty FindPenalty(PenaltyType pt)
Parameters
Type | Name | Description |
---|---|---|
PenaltyType | pt | The penalty type. |
Returns
Type | Description |
---|---|
AppliedPenalty | The applied penalty for the specified type or null if no penalty of that type can be found. |
RemovePenalty(PenaltyType)
Removes the penalty of the specified type, if set.
Declaration
public void RemovePenalty(PenaltyType pt)
Parameters
Type | Name | Description |
---|---|---|
PenaltyType | pt |