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.
Inheritance
Inherited Members
Namespace: Sdl.LanguagePlatform.TranslationMemoryApi
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>, Boolean, Boolean, 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 |
---|---|---|
System.Collections.Generic.IEnumerable<T> | cascadeEntries | cascade entries |
System.Boolean | stopSearchingWhenResultsFound | whether to stop searching when results have been found |
System.Boolean | removeDuplicates | remove duplicates |
Sdl.Core.Globalization.CultureCode | sourceLanguage | source language |
Sdl.Core.Globalization.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 |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<T> |
CascadeEntryIndexesUsed
Gets the Cascade Entry Indexes that were used in the search.
Declaration
public ConcurrentQueue<int> CascadeEntryIndexesUsed { get; }
Property Value
Type | Description |
---|---|
System.Collections.Concurrent.ConcurrentQueue<System.Int32> |
RemoveDuplicates
Gets whether duplicates should be removed from search results.
Declaration
public bool RemoveDuplicates { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
SourceLanguage
Gets the source language of this cascade.
Declaration
public CultureCode SourceLanguage { get; }
Property Value
Type | Description |
---|---|
Sdl.Core.Globalization.CultureCode |
StopSearchingWhenResultsFound
Gets or sets whether to stop searching when results have been found.
Declaration
public bool StopSearchingWhenResultsFound { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
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 |
---|---|
Sdl.Core.Globalization.CultureCode |
Methods
AddOrUpdateTranslationUnits(TranslationUnit[], Int32[], ImportSettings)
Executes AddOrUpdateTranslationUnits(TranslationUnit[], Int32[], ImportSettings) on the current translation provider.
Declaration
public ImportResult[] AddOrUpdateTranslationUnits(TranslationUnit[] translationUnits, int[] previousTranslationHashes, ImportSettings settings)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit[] | translationUnits | |
System.Int32[] | previousTranslationHashes | |
ImportSettings | settings |
Returns
Type | Description |
---|---|
ImportResult[] |
AddOrUpdateTranslationUnits(TranslationUnit[], Int32[], ImportSettings, out IEnumerable<CascadeMessage>)
Executes AddOrUpdateTranslationUnits(TranslationUnit[], Int32[], 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 | |
System.Int32[] | previousTranslationHashes | |
ImportSettings | settings | |
System.Collections.Generic.IEnumerable<CascadeMessage> | cascadeMessages |
Returns
Type | Description |
---|---|
ImportResult[] |
AddOrUpdateTranslationUnitsMasked(TranslationUnit[], Int32[], ImportSettings, Boolean[])
Executes AddOrUpdateTranslationUnitsMasked(TranslationUnit[], Int32[], ImportSettings, Boolean[]) on the current translation provider.
Declaration
public ImportResult[] AddOrUpdateTranslationUnitsMasked(TranslationUnit[] translationUnits, int[] previousTranslationHashes, ImportSettings settings, bool[] mask)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit[] | translationUnits | |
System.Int32[] | previousTranslationHashes | |
ImportSettings | settings | |
System.Boolean[] | mask |
Returns
Type | Description |
---|---|
ImportResult[] |
AddOrUpdateTranslationUnitsMasked(TranslationUnit[], Int32[], ImportSettings, Boolean[], out IEnumerable<CascadeMessage>)
Executes AddOrUpdateTranslationUnitsMasked(TranslationUnit[], Int32[], ImportSettings, Boolean[]) 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 | |
System.Int32[] | previousTranslationHashes | |
ImportSettings | settings | |
System.Boolean[] | mask | |
System.Collections.Generic.IEnumerable<CascadeMessage> | 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 | |
System.Collections.Generic.IEnumerable<CascadeMessage> | 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 | |
System.Collections.Generic.IEnumerable<CascadeMessage> | cascadeMessages |
Returns
Type | Description |
---|---|
ImportResult[] |
AddTranslationUnitsMasked(TranslationUnit[], ImportSettings, Boolean[])
Executes AddTranslationUnitsMasked(TranslationUnit[], ImportSettings, Boolean[]) on the current translation provider.
Declaration
public ImportResult[] AddTranslationUnitsMasked(TranslationUnit[] translationUnits, ImportSettings settings, bool[] mask)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit[] | translationUnits | |
ImportSettings | settings | |
System.Boolean[] | mask |
Returns
Type | Description |
---|---|
ImportResult[] |
AddTranslationUnitsMasked(TranslationUnit[], ImportSettings, Boolean[], out IEnumerable<CascadeMessage>)
Executes AddTranslationUnitsMasked(TranslationUnit[], ImportSettings, Boolean[]) 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 | |
System.Boolean[] | mask | |
System.Collections.Generic.IEnumerable<CascadeMessage> | cascadeMessages |
Returns
Type | Description |
---|---|
ImportResult[] |
GetTranslationProviderNames()
Gets a comma-delimited string of translation provider names.
Declaration
public string GetTranslationProviderNames()
Returns
Type | Description |
---|---|
System.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 |
---|---|
System.Collections.Generic.IList<CascadeMessage> |
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 | |
System.Collections.Generic.IEnumerable<CascadeMessage> | 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 | |
System.Collections.Generic.IEnumerable<CascadeMessage> | cascadeMessages |
Returns
Type | Description |
---|---|
SearchResults[] |
SearchSegmentsMasked(SearchSettings, Segment[], Boolean[])
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 | |
System.Boolean[] | mask |
Returns
Type | Description |
---|---|
SearchResults[] |
SearchSegmentsMasked(SearchSettings, Segment[], Boolean[], 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 | |
System.Boolean[] | mask | |
System.Collections.Generic.IEnumerable<CascadeMessage> | cascadeMessages |
Returns
Type | Description |
---|---|
SearchResultsMerged[] |
SearchSegmentsMasked(SearchSettings, SubsegmentSearchSettings, SubsegmentSearchCondition, Segment[], Boolean[], 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 | |
System.Boolean[] | mask | |
System.Collections.Generic.IEnumerable<CascadeMessage> | 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 | |
System.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 | |
System.String | segment | |
System.Collections.Generic.IEnumerable<CascadeMessage> | 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 | |
System.Collections.Generic.IEnumerable<CascadeMessage> | 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 | |
System.Collections.Generic.IEnumerable<CascadeMessage> | cascadeMessages |
Returns
Type | Description |
---|---|
SearchResults[] |
SearchTranslationUnitsMasked(SearchSettings, SubsegmentSearchSettings, SubsegmentSearchCondition, TranslationUnit[], Boolean[], 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 | |
System.Boolean[] | mask | |
System.Collections.Generic.IEnumerable<CascadeMessage> | cascadeMessages |
Returns
Type | Description |
---|---|
SegmentAndSubsegmentSearchResultsMerged[] |
SearchTranslationUnitsMasked(SearchSettings, TranslationUnit[], Boolean[])
Executes SearchTranslationUnitsMasked(SearchSettings, TranslationUnit[], Boolean[]) on the current translation provider cascade.
Declaration
public SearchResults[] SearchTranslationUnitsMasked(SearchSettings settings, TranslationUnit[] translationUnits, bool[] mask)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
TranslationUnit[] | translationUnits | |
System.Boolean[] | mask |
Returns
Type | Description |
---|---|
SearchResults[] |
SearchTranslationUnitsMasked(SearchSettings, TranslationUnit[], Boolean[], out IEnumerable<CascadeMessage>)
Executes SearchTranslationUnitsMasked(SearchSettings, TranslationUnit[], Boolean[]) 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 | |
System.Boolean[] | mask | |
System.Collections.Generic.IEnumerable<CascadeMessage> | 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 | |
System.Collections.Generic.IEnumerable<CascadeMessage> | 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 | |
System.Collections.Generic.IEnumerable<CascadeMessage> | 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 | |
System.Collections.Generic.IEnumerable<CascadeMessage> | cascadeMessages |
Returns
Type | Description |
---|---|
ImportResult[] |