Class Cascade<T>
A cascade is used to perform searches and updates across many different translation provider language directions. Each translation provider language direction is represented by a cascade entry that contains other information with regards to how it should be treated
- e.g. what penalties should be applied during searches.
Inherited Members
Namespace: SdlSdl.LanguagePlatformTranslationMemoryApi
Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
Syntax
public class Cascade<T> where T : CascadeEntry
Type Parameters
Name | Description |
---|---|
T | T represents the cascade entry type. A simple cascade can just use CascadeEntry but, for example, project cascades need more information associated with each cascade entry and uses ProjectCascadeEntry. |
Constructors
Cascade(IEnumerable<T>, bool, bool, CultureCode, CultureCode)
Constructor that takes the cascade entries, cascade search mode, remove duplicates, source language, and target language.
Declaration
public Cascade(IEnumerable<T> cascadeEntries, bool stopSearchingWhenResultsFound, bool removeDuplicates, CultureCode sourceLanguage, CultureCode targetLanguage)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable | cascadeEntries | cascade entries |
bool | stopSearchingWhenResultsFound | whether to stop searching when results have been found |
bool | removeDuplicates | remove duplicates |
CultureCode | sourceLanguage | source language |
CultureCode | targetLanguage | target language |
Properties
CascadeEntries
Gets the cascade entries, which refer to a translation provider language direction and specify and optional penalty to apply when perforing look-ups.
Declaration
public ReadOnlyCollection<T> CascadeEntries { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollection |
CascadeEntryIndexesUsed
Gets the Cascade Entry Indexes that were used in the search.
Declaration
public ConcurrentQueue<int> CascadeEntryIndexesUsed { get; }
Property Value
Type | Description |
---|---|
ConcurrentQueueint |
RemoveDuplicates
Gets whether duplicates should be removed from search results.
Declaration
public bool RemoveDuplicates { get; }
Property Value
Type | Description |
---|---|
bool |
SourceLanguage
Gets the source language of this cascade.
Declaration
public CultureCode SourceLanguage { get; }
Property Value
Type | Description |
---|---|
CultureCode |
StopSearchingWhenResultsFound
Gets or sets whether to stop searching when results have been found.
Declaration
public bool StopSearchingWhenResultsFound { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
"Stop searching" means that the cascade will not search the next translation provider when results have been found in the current translation provider.
TargetLanguage
Gets the target language of this cascade.
Declaration
public CultureCode TargetLanguage { get; }
Property Value
Type | Description |
---|---|
CultureCode |
Methods
AddOrUpdateTranslationUnits(TranslationUnit[], int[], ImportSettings)
Executes AddOrUpdateTranslationUnits(TranslationUnit[], int[], ImportSettings) on the current translation provider.
Declaration
public ImportResult[] AddOrUpdateTranslationUnits(TranslationUnit[] translationUnits, int[] previousTranslationHashes, ImportSettings settings)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnits | |
int | previousTranslationHashes | |
ImportSettings | settings |
Returns
Type | Description |
---|---|
ImportResult |
AddOrUpdateTranslationUnits(TranslationUnit[], int[], ImportSettings, out IEnumerable<CascadeMessage>)
Executes AddOrUpdateTranslationUnits(TranslationUnit[], int[], ImportSettings) on the current translation provider.
Declaration
public ImportResult[] AddOrUpdateTranslationUnits(TranslationUnit[] translationUnits, int[] previousTranslationHashes, ImportSettings settings, out IEnumerable<CascadeMessage> cascadeMessages)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnits | |
int | previousTranslationHashes | |
ImportSettings | settings | |
IEnumerableCascadeMessage | cascadeMessages |
Returns
Type | Description |
---|---|
ImportResult |
AddOrUpdateTranslationUnitsMasked(TranslationUnit[], int[], ImportSettings, bool[])
Executes AddOrUpdateTranslationUnitsMasked(TranslationUnit[], int[], ImportSettings, bool[]) on the current translation provider.
Declaration
public ImportResult[] AddOrUpdateTranslationUnitsMasked(TranslationUnit[] translationUnits, int[] previousTranslationHashes, ImportSettings settings, bool[] mask)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnits | |
int | previousTranslationHashes | |
ImportSettings | settings | |
bool | mask |
Returns
Type | Description |
---|---|
ImportResult |
AddOrUpdateTranslationUnitsMasked(TranslationUnit[], int[], ImportSettings, bool[], out IEnumerable<CascadeMessage>)
Executes AddOrUpdateTranslationUnitsMasked(TranslationUnit[], int[], ImportSettings, bool[]) on the current translation provider.
Declaration
public ImportResult[] AddOrUpdateTranslationUnitsMasked(TranslationUnit[] translationUnits, int[] previousTranslationHashes, ImportSettings settings, bool[] mask, out IEnumerable<CascadeMessage> cascadeMessages)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnits | |
int | previousTranslationHashes | |
ImportSettings | settings | |
bool | mask | |
IEnumerableCascadeMessage | cascadeMessages |
Returns
Type | Description |
---|---|
ImportResult |
AddTranslationUnit(TranslationUnit, ImportSettings)
Executes AddTranslationUnit(TranslationUnit, ImportSettings) on the current translation provider.
Declaration
public ImportResult AddTranslationUnit(TranslationUnit translationUnit, ImportSettings settings)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnit | |
ImportSettings | settings |
Returns
Type | Description |
---|---|
ImportResult |
AddTranslationUnit(TranslationUnit, ImportSettings, out IEnumerable<CascadeMessage>)
Executes AddTranslationUnit(TranslationUnit, ImportSettings) on the current translation provider.
Declaration
public ImportResult AddTranslationUnit(TranslationUnit translationUnit, ImportSettings settings, out IEnumerable<CascadeMessage> cascadeMessages)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnit | |
ImportSettings | settings | |
IEnumerableCascadeMessage | cascadeMessages |
Returns
Type | Description |
---|---|
ImportResult |
AddTranslationUnits(TranslationUnit[], ImportSettings)
Executes AddTranslationUnits(TranslationUnit[], ImportSettings) on the current translation provider.
Declaration
public ImportResult[] AddTranslationUnits(TranslationUnit[] translationUnits, ImportSettings settings)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnits | |
ImportSettings | settings |
Returns
Type | Description |
---|---|
ImportResult |
AddTranslationUnits(TranslationUnit[], ImportSettings, out IEnumerable<CascadeMessage>)
Executes AddTranslationUnits(TranslationUnit[], ImportSettings) on the current translation provider.
Declaration
public ImportResult[] AddTranslationUnits(TranslationUnit[] translationUnits, ImportSettings settings, out IEnumerable<CascadeMessage> cascadeMessages)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnits | |
ImportSettings | settings | |
IEnumerableCascadeMessage | cascadeMessages |
Returns
Type | Description |
---|---|
ImportResult |
AddTranslationUnitsMasked(TranslationUnit[], ImportSettings, bool[])
Executes AddTranslationUnitsMasked(TranslationUnit[], ImportSettings, bool[]) on the current translation provider.
Declaration
public ImportResult[] AddTranslationUnitsMasked(TranslationUnit[] translationUnits, ImportSettings settings, bool[] mask)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnits | |
ImportSettings | settings | |
bool | mask |
Returns
Type | Description |
---|---|
ImportResult |
AddTranslationUnitsMasked(TranslationUnit[], ImportSettings, bool[], out IEnumerable<CascadeMessage>)
Executes AddTranslationUnitsMasked(TranslationUnit[], ImportSettings, bool[]) on the current translation provider.
Declaration
public ImportResult[] AddTranslationUnitsMasked(TranslationUnit[] translationUnits, ImportSettings settings, bool[] mask, out IEnumerable<CascadeMessage> cascadeMessages)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnits | |
ImportSettings | settings | |
bool | mask | |
IEnumerableCascadeMessage | cascadeMessages |
Returns
Type | Description |
---|---|
ImportResult |
GetTranslationProviderNames()
Gets a comma-delimited string of translation provider names.
Declaration
public string GetTranslationProviderNames()
Returns
Type | Description |
---|---|
string | translation provider names |
GetWarningMessage(T, SearchSettings)
Getting Warning messages for Upgrade requirement.
Declaration
public IList<CascadeMessage> GetWarningMessage(T cascadeEntry, SearchSettings searchSettings)
Parameters
Type | Name | Description |
---|---|---|
T | cascadeEntry | |
SearchSettings | searchSettings |
Returns
Type | Description |
---|---|
IListCascadeMessage |
SearchSegment(SearchSettings, Segment)
Executes SearchSegment(SearchSettings, Segment) on the current translation provider cascade.
Declaration
public SearchResults SearchSegment(SearchSettings settings, Segment segment)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
Segment | segment |
Returns
Type | Description |
---|---|
SearchResults |
SearchSegment(SearchSettings, Segment, out IEnumerable<CascadeMessage>)
Executes SearchSegment(SearchSettings, Segment) on the current translation provider cascade.
Declaration
public SearchResults SearchSegment(SearchSettings settings, Segment segment, out IEnumerable<CascadeMessage> cascadeMessages)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
Segment | segment | |
IEnumerableCascadeMessage | cascadeMessages |
Returns
Type | Description |
---|---|
SearchResults |
SearchSegments(SearchSettings, Segment[])
Executes SearchSegments(SearchSettings, Segment[]) on the current translation provider cascade.
Declaration
public SearchResults[] SearchSegments(SearchSettings settings, Segment[] segments)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
Segment | segments |
Returns
Type | Description |
---|---|
SearchResults |
SearchSegments(SearchSettings, Segment[], out IEnumerable<CascadeMessage>)
Executes SearchSegments(SearchSettings, Segment[]) on the current translation provider cascade.
Declaration
public SearchResults[] SearchSegments(SearchSettings settings, Segment[] segments, out IEnumerable<CascadeMessage> cascadeMessages)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
Segment | segments | |
IEnumerableCascadeMessage | cascadeMessages |
Returns
Type | Description |
---|---|
SearchResults |
SearchSegmentsMasked(SearchSettings, Segment[], bool[])
Executes SearchSegments(SearchSettings, Segment[]) on the current translation provider cascade.
Declaration
public SearchResults[] SearchSegmentsMasked(SearchSettings settings, Segment[] segments, bool[] mask)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
Segment | segments | |
bool | mask |
Returns
Type | Description |
---|---|
SearchResults |
SearchSegmentsMasked(SearchSettings, Segment[], bool[], out IEnumerable<CascadeMessage>)
Executes SearchSegments(SearchSettings, Segment[]) on the current translation provider cascade.
Declaration
public SearchResultsMerged[] SearchSegmentsMasked(SearchSettings settings, Segment[] segments, bool[] mask, out IEnumerable<CascadeMessage> cascadeMessages)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
Segment | segments | |
bool | mask | |
IEnumerableCascadeMessage | cascadeMessages |
Returns
Type | Description |
---|---|
SearchResultsMerged |
SearchSegmentsMasked(SearchSettings, SubsegmentSearchSettings, SubsegmentSearchCondition, Segment[], bool[], out IEnumerable<CascadeMessage>)
Executes SearchSegments(SearchSettings, Segment[]) on the current translation provider cascade.
Declaration
public SegmentAndSubsegmentSearchResultsMerged[] SearchSegmentsMasked(SearchSettings settings, SubsegmentSearchSettings subsegmentSettings, SubsegmentSearchCondition subsegmentSearchCondition, Segment[] segments, bool[] mask, out IEnumerable<CascadeMessage> cascadeMessages)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
SubsegmentSearchSettings | subsegmentSettings | |
SubsegmentSearchCondition | subsegmentSearchCondition | |
Segment | segments | |
bool | mask | |
IEnumerableCascadeMessage | cascadeMessages |
Returns
Type | Description |
---|---|
SegmentAndSubsegmentSearchResultsMerged |
SearchText(SearchSettings, string)
Executes SearchText(SearchSettings, string) on the current translation provider cascade.
Declaration
public SearchResults SearchText(SearchSettings settings, string segment)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
string | segment |
Returns
Type | Description |
---|---|
SearchResults |
SearchText(SearchSettings, string, out IEnumerable<CascadeMessage>)
Executes SearchText(SearchSettings, string) on the current translation provider cascade.
Declaration
public SearchResults SearchText(SearchSettings settings, string segment, out IEnumerable<CascadeMessage> cascadeMessages)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
string | segment | |
IEnumerableCascadeMessage | cascadeMessages |
Returns
Type | Description |
---|---|
SearchResults |
SearchTranslationUnit(SearchSettings, TranslationUnit)
Executes SearchTranslationUnit(SearchSettings, TranslationUnit) on the current translation provider cascade.
Declaration
public SearchResults SearchTranslationUnit(SearchSettings settings, TranslationUnit translationUnit)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
TranslationUnit | translationUnit |
Returns
Type | Description |
---|---|
SearchResults |
SearchTranslationUnit(SearchSettings, TranslationUnit, out IEnumerable<CascadeMessage>)
Executes SearchTranslationUnit(SearchSettings, TranslationUnit) on the current translation provider cascade.
Declaration
public SearchResults SearchTranslationUnit(SearchSettings settings, TranslationUnit translationUnit, out IEnumerable<CascadeMessage> cascadeMessages)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
TranslationUnit | translationUnit | |
IEnumerableCascadeMessage | cascadeMessages |
Returns
Type | Description |
---|---|
SearchResults |
SearchTranslationUnits(SearchSettings, TranslationUnit[])
Executes SearchTranslationUnits(SearchSettings, TranslationUnit[]) on the current translation provider cascade.
Declaration
public SearchResults[] SearchTranslationUnits(SearchSettings settings, TranslationUnit[] tus)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
TranslationUnit | tus |
Returns
Type | Description |
---|---|
SearchResults |
SearchTranslationUnits(SearchSettings, TranslationUnit[], out IEnumerable<CascadeMessage>)
Executes SearchTranslationUnits(SearchSettings, TranslationUnit[]) on the current translation provider cascade.
Declaration
public SearchResults[] SearchTranslationUnits(SearchSettings settings, TranslationUnit[] tus, out IEnumerable<CascadeMessage> cascadeMessages)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
TranslationUnit | tus | |
IEnumerableCascadeMessage | cascadeMessages |
Returns
Type | Description |
---|---|
SearchResults |
SearchTranslationUnitsMasked(SearchSettings, SubsegmentSearchSettings, SubsegmentSearchCondition, TranslationUnit[], bool[], out IEnumerable<CascadeMessage>)
Executes SearchSegments(SearchSettings, Segment[]) on the current translation provider cascade.
Declaration
public SegmentAndSubsegmentSearchResultsMerged[] SearchTranslationUnitsMasked(SearchSettings settings, SubsegmentSearchSettings subsegmentSettings, SubsegmentSearchCondition subsegmentSearchCondition, TranslationUnit[] translationUnits, bool[] mask, out IEnumerable<CascadeMessage> cascadeMessages)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
SubsegmentSearchSettings | subsegmentSettings | |
SubsegmentSearchCondition | subsegmentSearchCondition | |
TranslationUnit | translationUnits | |
bool | mask | |
IEnumerableCascadeMessage | cascadeMessages |
Returns
Type | Description |
---|---|
SegmentAndSubsegmentSearchResultsMerged |
SearchTranslationUnitsMasked(SearchSettings, TranslationUnit[], bool[])
Executes SearchTranslationUnitsMasked(SearchSettings, TranslationUnit[], bool[]) on the current translation provider cascade.
Declaration
public SearchResults[] SearchTranslationUnitsMasked(SearchSettings settings, TranslationUnit[] translationUnits, bool[] mask)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
TranslationUnit | translationUnits | |
bool | mask |
Returns
Type | Description |
---|---|
SearchResults |
SearchTranslationUnitsMasked(SearchSettings, TranslationUnit[], bool[], out IEnumerable<CascadeMessage>)
Executes SearchTranslationUnitsMasked(SearchSettings, TranslationUnit[], bool[]) on the current translation provider cascade.
Declaration
public SearchResultsMerged[] SearchTranslationUnitsMasked(SearchSettings settings, TranslationUnit[] translationUnits, bool[] mask, out IEnumerable<CascadeMessage> cascadeMessages)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
TranslationUnit | translationUnits | |
bool | mask | |
IEnumerableCascadeMessage | cascadeMessages |
Returns
Type | Description |
---|---|
SearchResultsMerged |
SubsegmentSearchSegments(SubsegmentSearchSettings, Segment[], out IEnumerable<CascadeMessage>)
Executes SubsegmentSearchSegments(SubsegmentSearchSettings, Segment[]) on the current translation provider cascade.
Declaration
public SubsegmentSearchResultsCollection[] SubsegmentSearchSegments(SubsegmentSearchSettings subsegmentSearchSettings, Segment[] segments, out IEnumerable<CascadeMessage> cascadeMessages)
Parameters
Type | Name | Description |
---|---|---|
SubsegmentSearchSettings | subsegmentSearchSettings | |
Segment | segments | |
IEnumerableCascadeMessage | cascadeMessages |
Returns
Type | Description |
---|---|
SubsegmentSearchResultsCollection |
UpdateTranslationUnit(TranslationUnit)
Executes UpdateTranslationUnit(TranslationUnit) on the current translation provider.
Declaration
public ImportResult UpdateTranslationUnit(TranslationUnit translationUnit)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnit |
Returns
Type | Description |
---|---|
ImportResult |
UpdateTranslationUnit(TranslationUnit, out IEnumerable<CascadeMessage>)
Executes UpdateTranslationUnit(TranslationUnit) on the current translation provider.
Declaration
public ImportResult UpdateTranslationUnit(TranslationUnit translationUnit, out IEnumerable<CascadeMessage> cascadeMessages)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnit | |
IEnumerableCascadeMessage | cascadeMessages |
Returns
Type | Description |
---|---|
ImportResult |
UpdateTranslationUnits(TranslationUnit[])
Executes UpdateTranslationUnits(TranslationUnit[]) on the current translation provider.
Declaration
public ImportResult[] UpdateTranslationUnits(TranslationUnit[] translationUnits)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnits |
Returns
Type | Description |
---|---|
ImportResult |
UpdateTranslationUnits(TranslationUnit[], out IEnumerable<CascadeMessage>)
Executes UpdateTranslationUnits(TranslationUnit[]) on the current translation provider.
Declaration
public ImportResult[] UpdateTranslationUnits(TranslationUnit[] translationUnits, out IEnumerable<CascadeMessage> cascadeMessages)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnits | |
IEnumerableCascadeMessage | cascadeMessages |
Returns
Type | Description |
---|---|
ImportResult |