Class ScoringResult
Represents the score for a search result.
Inheritance
Inherited Members
Namespace: Sdl.LanguagePlatform.TranslationMemory
Assembly: Sdl.LanguagePlatform.TranslationMemory.dll
Syntax
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
public List<AppliedPenalty> AppliedPenalties { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<AppliedPenalty> |
BaseScore
Gets or sets the base score for this result.
Declaration
public int BaseScore { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
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
public EditDistance EditDistance { get; set; }
Property Value
Type | Description |
---|---|
EditDistance |
IdContextMatch
Gets or sets SIDContext
Declaration
public bool IdContextMatch { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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
public bool IsStructureContextMatch { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
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 |
---|---|
System.Int32 |
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
public List<SegmentRange> MatchingConcordanceRanges { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<SegmentRange> |
MemoryTagsDeleted
Gets or sets whether the tags are deleted or not for this result.
Declaration
public bool MemoryTagsDeleted { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
PlaceableFormatChanges
Declaration
public int PlaceableFormatChanges { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
ResolvedPlaceables
Gets or sets the number of placeables that can be resolved for this result.
Declaration
public int ResolvedPlaceables { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
TagMismatch
Gets or sets whether there are any tag mismatches. This flag is set even if no tag mismatch penalty is configured.
Declaration
public bool TagMismatch { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
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
public bool TargetSegmentDiffers { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
TextContextMatch
Gets or sets the type of context match for this result, if applicable.
Declaration
public TextContextMatch TextContextMatch { get; set; }
Property Value
Type | Description |
---|---|
TextContextMatch |
TextReplacements
Gets or sets the number of TextReplacements applied to this result.
Declaration
public int TextReplacements { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
ApplyFilter(String, Int32)
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 |
---|---|---|
System.String | filterName | The filter name. |
System.Int32 | 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 |
---|---|---|
System.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 |