Class SearchSettings
Represents a set of settings relevant for search opeartions.
Inherited Members
Namespace: Sdl.LanguagePlatform.TranslationMemory
Assembly: Sdl.LanguagePlatform.TranslationMemory.dll
Syntax
public class SearchSettings
Constructors
SearchSettings()
Initializes a new instance with default values. The default values are:
Declaration
public SearchSettings()
Fields
MinscoreLowerbound
The lower bound of the minimum match score supported by translation memories.
Declaration
public static readonly int MinscoreLowerbound
Field Value
| Type | Description |
|---|---|
| System.Int32 |
Properties
AdaptiveMachineTranslationLookupMode
Specifies how to use adaptive machine translation.
Declaration
public AdaptiveMachineTranslationLookupMode AdaptiveMachineTranslationLookupMode { get; set; }
Property Value
| Type | Description |
|---|---|
| AdaptiveMachineTranslationLookupMode |
AdvancedTokenizationLegacyScoring
Gets or sets whether legacy scores should be calculated for languages that were formerly handled as character sequences rather than parsed into multiple-character tokens. The default is false.
Declaration
public bool AdvancedTokenizationLegacyScoring { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
AutoLocalizationSettings
Gets or sets the translation settings, which contains information about auto-localizations and other settings specific to the translation process. The value is only relevant if ComputeTranslationProposal is true, and never relevant for concordance searches. NOTE that this object is not created by default by the constructor of the class.
Declaration
public AutoLocalizationSettings AutoLocalizationSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| AutoLocalizationSettings |
CheckMatchingSublanguages
Gets or sets whether the TM should apply strict language direction validation of the search segment or TU. The default is false.
Declaration
public bool CheckMatchingSublanguages { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
ComputeTranslationProposal
If true, compute a translation proposal with the match TU and include it in the result. If false, no proposal will be computed or included in the result.
Declaration
public bool ComputeTranslationProposal { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
ContextConfirmationLevels
Similarly to ConfirmationLevels, when searching with TUs, those whose ConfirmationLevel does not match an element in this array do not generate context for their neighbour(s) when the TM context type is PrecedingSourceAndTarget. No effect when empty/null.
Declaration
public ConfirmationLevel[] ContextConfirmationLevels { get; set; }
Property Value
| Type | Description |
|---|---|
| ConfirmationLevel[] |
CurrentStructureContext
Gets or sets the current structure context which is used for the search. May be null.
Declaration
public string CurrentStructureContext { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Filters
Gets or sets the filters.
Declaration
public List<Filter> Filters { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<Filter> |
HardFilter
Gets or sets the hard filter. The hard filter is not evaluated on the storage level yet.
Declaration
public FilterExpression HardFilter { get; set; }
Property Value
| Type | Description |
|---|---|
| FilterExpression |
IsConcordanceSearch
Gets a value indicating whether this instance is used for a concordance search.
Declaration
public bool IsConcordanceSearch { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsDocumentSearch
Gets or sets whether contextual information should be used during the search.
Declaration
public bool IsDocumentSearch { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
MachineTranslationLookup
Specifies when to use machine translation.
Declaration
public MachineTranslationLookupMode MachineTranslationLookup { get; set; }
Property Value
| Type | Description |
|---|---|
| MachineTranslationLookupMode |
MaxResults
Gets or sets the maximum number of results to be retrieved by the search.
The minimum accepted value for MaxResults is 1.
Declaration
public int MaxResults { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
MinScore
Gets or sets the minimum score for retrieving the results.
Any candidates with a score lower than MinScore are not returned by the search.
The minimum accepted value for MinScore is MinscoreLowerbound.
Declaration
public int MinScore { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Mode
Gets or sets the search mode.
Declaration
public SearchMode Mode { get; set; }
Property Value
| Type | Description |
|---|---|
| SearchMode |
Penalties
Gets or sets the penalties.
Declaration
public List<Penalty> Penalties { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<Penalty> |
QuickInsertIds
Lists of quick insert TagIDs that are present in the document that holds the search segments key is FileId, value is list of quickInsertIds for that document/file
Declaration
public IDictionary<string, IList<string>> QuickInsertIds { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IDictionary<System.String, System.Collections.Generic.IList<System.String>> |
SortSpecification
Gets or sets the sort specification.
Declaration
public SortSpecification SortSpecification { get; set; }
Property Value
| Type | Description |
|---|---|
| SortSpecification |
Methods
AddFilter(Filter)
Adds the supplied filter to the list of filters.
Declaration
public void AddFilter(Filter filter)
Parameters
| Type | Name | Description |
|---|---|---|
| Filter | filter | A Filter |
AddPenalty(PenaltyType, Int32)
Adds the specified penalty to the list of penalties, unless already present (in which case nothing happens).
Declaration
public void AddPenalty(PenaltyType pt, int malus)
Parameters
| Type | Name | Description |
|---|---|---|
| PenaltyType | pt | The penalty type |
| System.Int32 | malus | The malus (> 0) |
FindFilter(String)
Attempts to find the filter with the specified name.
Declaration
public Filter FindFilter(string filterName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filterName | The name fo the filter to be found. |
Returns
| Type | Description |
|---|---|
| Filter | The filter object with that name; or null if none was found. |
FindPenalty(PenaltyType)
Retrieves a penalty of a specified type.
Declaration
public Penalty FindPenalty(PenaltyType pt)
Parameters
| Type | Name | Description |
|---|---|---|
| PenaltyType | pt | The penalty type. |
Returns
| Type | Description |
|---|---|
| Penalty | The penalty object, if exists, otherwise null. |
RemoveFilter(String)
Attempts to remove the filter with the specified name.
Declaration
public bool RemoveFilter(string filterName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filterName | The name of the filter to be removed. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the filter has been found and removed; false otherwise. |
RemovePenalty(PenaltyType)
Removes the specified penalty from the list of penalties, if present (otherwise nothing happens).
Declaration
public void RemovePenalty(PenaltyType pt)
Parameters
| Type | Name | Description |
|---|---|---|
| PenaltyType | pt | The penalty type |