Class FileBasedTranslationMemoryLanguageDirection
Represents the language direction of a file-based translation memory (see FileBasedTranslationMemory).
Inheritance
Implements
Inherited Members
Namespace: Sdl.LanguagePlatform.TranslationMemoryApi
Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
Syntax
public class FileBasedTranslationMemoryLanguageDirection : ISubsegmentTranslationMemoryLanguageDirection, ITranslationMemoryLanguageDirection, ITranslationProviderLanguageDirection, IAdvancedContextTranslationMemoryLanguageDirection
Properties
CanReverseLanguageDirection
Gets a flag which indicates whether the translation provider supports searches in the reversed language direction.
Declaration
public bool CanReverseLanguageDirection { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
LanguageDirection
Gets the language direction of the translation memory.
Declaration
public LanguagePair LanguageDirection { get; }
Property Value
Type | Description |
---|---|
LanguagePair |
SourceLanguage
Gets the source language.
Declaration
public CultureCode SourceLanguage { get; }
Property Value
Type | Description |
---|---|
Sdl.Core.Globalization.CultureCode |
TargetLanguage
Gets the target language.
Declaration
public CultureCode TargetLanguage { get; }
Property Value
Type | Description |
---|---|
Sdl.Core.Globalization.CultureCode |
TranslationProvider
Gets the translation memory to which this language direction belongs.
Declaration
public ITranslationMemory TranslationProvider { get; }
Property Value
Type | Description |
---|---|
ITranslationMemory |
Methods
AddOrUpdateTranslationUnits(TranslationUnit[], Int32[], ImportSettings)
Adds an array of translation units to the database. If hash codes of the previous translations are provided,
a found translation will be overwritten. If none is found, or the hash is 0 or the collection is null
,
the operation behaves identical to AddTranslationUnits(TranslationUnit[], ImportSettings).
If the provider doesn't support adding/updating, the implementation should return a reasonable ImportResult but should not throw an exception.
Declaration
public ImportResult[] AddOrUpdateTranslationUnits(TranslationUnit[] translationUnits, int[] previousTranslationHashes, ImportSettings settings)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit[] | translationUnits | An arrays of translation units to be added. |
System.Int32[] | previousTranslationHashes | If provided, a corresponding array of a the hash code of a previous translation. |
ImportSettings | settings | The settings used for this operation. |
Returns
Type | Description |
---|---|
ImportResult[] | An array of ImportResult objects, which mirrors the translation unit array. It has the exact same size and contains the status of each add operation for each particular translation unit with the same index within the array. |
AddOrUpdateTranslationUnitsMasked(TranslationUnit[], Int32[], ImportSettings, Boolean[])
Adds an array of translation units to the database, but will only add those
for which the corresponding mask field is true
. If the previous translation hashes are provided,
existing translations will be updated if the target segment hash changed.
If the provider doesn't support adding/updating, the implementation should return a reasonable ImportResult but should not throw an exception.
Declaration
public ImportResult[] AddOrUpdateTranslationUnitsMasked(TranslationUnit[] translationUnits, int[] previousTranslationHashes, ImportSettings settings, bool[] mask)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit[] | translationUnits | An arrays of translation units to be added. |
System.Int32[] | previousTranslationHashes | Corresponding hash codes of a previous translation (0 if unknown). The parameter may be |
ImportSettings | settings | The settings used for this operation. |
System.Boolean[] | mask | A |
Returns
Type | Description |
---|---|
ImportResult[] | An array of ImportResult objects, which mirrors the translation unit array. It has the exact same size and contains the status of each add operation for each particular translation unit with the same index within the array. |
AddTranslationUnit(TranslationUnit, ImportSettings)
Adds a translation unit to the database. If the provider doesn't support adding/updating, the implementation should return a reasonable ImportResult but should not throw an exception.
Declaration
public ImportResult AddTranslationUnit(TranslationUnit translationUnit, ImportSettings settings)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnit | The translation unit. |
ImportSettings | settings | The settings used for this operation. |
Returns
Type | Description |
---|---|
ImportResult | An ImportResult which represents the status of the operation (succeeded, ignored, etc). |
AddTranslationUnits(TranslationUnit[], ImportSettings)
Adds an array of translation units to the database. If the provider doesn't support adding/updating, the implementation should return a reasonable ImportResult but should not throw an exception.
Declaration
public ImportResult[] AddTranslationUnits(TranslationUnit[] translationUnits, ImportSettings settings)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit[] | translationUnits | An arrays of translation units to be added. |
ImportSettings | settings | The settings used for this operation. |
Returns
Type | Description |
---|---|
ImportResult[] | An array of ImportResult objects, which mirrors the translation unit array. It has the exact same size and contains the status of each add operation for each particular translation unit with the same index within the array. |
AddTranslationUnitsMasked(TranslationUnit[], ImportSettings, Boolean[])
Adds an array of translation units to the database, but will only add those
for which the corresponding mask field is true
. If the provider doesn't support adding/updating, the
implementation should return a reasonable ImportResult but should not throw an exception.
Declaration
public ImportResult[] AddTranslationUnitsMasked(TranslationUnit[] translationUnits, ImportSettings settings, bool[] mask)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit[] | translationUnits | An arrays of translation units to be added. |
ImportSettings | settings | The settings used for this operation. |
System.Boolean[] | mask | A |
Returns
Type | Description |
---|---|
ImportResult[] | An array of ImportResult objects, which mirrors the translation unit array. It has the exact same size and contains the status of each add operation for each particular translation unit with the same index within the array. |
ApplyFieldsToTranslationUnit(FieldValues, Boolean, PersistentObjectToken)
Applies the specified field values to the translation unit identified by the specified
translationUnitId
.
Declaration
public bool ApplyFieldsToTranslationUnit(FieldValues values, bool overwrite, PersistentObjectToken translationUnitId)
Parameters
Type | Name | Description |
---|---|---|
FieldValues | values | The field values to apply |
System.Boolean | overwrite | If true, overwrite the old values, and merge the new values with the old ones otherwise. |
PersistentObjectToken | translationUnitId | The identifier of the translation unit to apply the field values to |
Returns
Type | Description |
---|---|
System.Boolean | true if the translation unit has been modified. false otherwise. |
ApplyFieldsToTranslationUnits(FieldValues, Boolean, PersistentObjectToken[])
Applies the specified field values to the translation units identified by the specified
translationUnitIds
collection.
Declaration
public int ApplyFieldsToTranslationUnits(FieldValues values, bool overwrite, PersistentObjectToken[] translationUnitIds)
Parameters
Type | Name | Description |
---|---|---|
FieldValues | values | The field values to apply |
System.Boolean | overwrite | If true, overwrite the old values, and merge the new values with the old ones otherwise. |
PersistentObjectToken[] | translationUnitIds | A collection of translation unit IDs to apply the field values to |
Returns
Type | Description |
---|---|
System.Int32 | The number of changed translation units |
DeleteAllTranslationUnits()
Deletes all translation units from the TM.
Declaration
public int DeleteAllTranslationUnits()
Returns
Type | Description |
---|---|
System.Int32 | The number of deleted translation units |
DeleteTranslationUnit(PersistentObjectToken)
Deletes the translation unit with the specified translationUnitId
from the TM.
Declaration
public bool DeleteTranslationUnit(PersistentObjectToken translationUnitId)
Parameters
Type | Name | Description |
---|---|---|
PersistentObjectToken | translationUnitId | The ID of the translation unit to delete. |
Returns
Type | Description |
---|---|
System.Boolean |
|
DeleteTranslationUnits(PersistentObjectToken[])
Deletes the translation units with the specified IDs from the translation memory.
Declaration
public int DeleteTranslationUnits(PersistentObjectToken[] translationUnitIds)
Parameters
Type | Name | Description |
---|---|---|
PersistentObjectToken[] | translationUnitIds | A collection of the translation unit IDs to delete |
Returns
Type | Description |
---|---|
System.Int32 | The number of deleted translation units |
DeleteTranslationUnitsWithIterator(ref RegularIterator)
Deletes all translation units in the TM, using an iterator. The iterator will process only a fixed maximum number of translation units (MaxCount) and then the call will return, giving the client an opportunity to discontinue the process or update the UI before the next round-trip.
Optionally, a filter can be set on the iterator which then will only delete those TUs which satisfy the filter condition.
Declaration
public int DeleteTranslationUnitsWithIterator(ref RegularIterator iterator)
Parameters
Type | Name | Description |
---|---|---|
RegularIterator | iterator | The iterator to use. |
Returns
Type | Description |
---|---|
System.Int32 | The number of deleted translation units. |
EditTranslationUnits(EditScript, EditUpdateMode)
Iteratively applies an EditScript to all translation units in the current translation memory.
Declaration
public int EditTranslationUnits(EditScript editScript, EditUpdateMode updateMode)
Parameters
Type | Name | Description |
---|---|---|
EditScript | editScript | The edit script to apply. |
EditUpdateMode | updateMode | The update mode to apply. |
Returns
Type | Description |
---|---|
System.Int32 | The number of edited translation units per round-trip. |
EditTranslationUnits(EditScript, EditUpdateMode, FilterExpression)
Iteratively applies an EditScript to all translation units in the current translation memory. A filter condition can be sued in which case only those translation units which match the filter will be edited.
Declaration
public int EditTranslationUnits(EditScript editScript, EditUpdateMode updateMode, FilterExpression filter)
Parameters
Type | Name | Description |
---|---|---|
EditScript | editScript | The edit script to apply. |
EditUpdateMode | updateMode | The update mode to apply. |
FilterExpression | filter | An optional filter to use for the TM iteration. |
Returns
Type | Description |
---|---|
System.Int32 | The number of edited translation units per round-trip. |
EditTranslationUnits(EditScript, EditUpdateMode, PersistentObjectToken[])
Applies an EditScript to the translation units identified by the
identifiers in the translationUnitIds
collection.
Declaration
public int EditTranslationUnits(EditScript editScript, EditUpdateMode updateMode, PersistentObjectToken[] translationUnitIds)
Parameters
Type | Name | Description |
---|---|---|
EditScript | editScript | The edit script to apply |
EditUpdateMode | updateMode | The update mode, which can be to update changed translation units in-place or add new translation units to the TM (which is only relevant if segment data has been changed). |
PersistentObjectToken[] | translationUnitIds | The collection of TU IDs to apply the edit script to. |
Returns
Type | Description |
---|---|
System.Int32 | The number of changed or edited translation units |
EditTranslationUnitsWithIterator(EditScript, EditUpdateMode, ref RegularIterator)
Applies an EditScript to the translation units, using an iterator.
Declaration
public int EditTranslationUnitsWithIterator(EditScript editScript, EditUpdateMode updateMode, ref RegularIterator iterator)
Parameters
Type | Name | Description |
---|---|---|
EditScript | editScript | The edit script to apply |
EditUpdateMode | updateMode | The update mode, which can be to update changed translation units in-place or add new translation units to the TM (which is only relevant if segment data has been changed). |
RegularIterator | iterator | The iterator to use. Note that a filter condition can be set on the iterator in which case the script will only be applied to those translation units which satisfy the filter condition. |
Returns
Type | Description |
---|---|
System.Int32 | The number of changed or edited translation units |
Remarks
Note that a filter condition can also be set on the editScript
instead of the iterator. Depending on the back-end storage, it may be more efficient to
set it on the iterator than on the edit script.
Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
Exceptions
Type | Condition |
---|---|
System.NullReferenceException | The |
GetDuplicateTranslationUnits(ref DuplicateIterator)
Returns a set of potentially duplicated translation units in the TM, using a special DuplicateIterator. A group of TUs are considered potential duplicates of each other if the internal hash values for their source segments are identical. There may be several reasons for this being the case:
- The TUs have the same source segment, but different translations
- The TUs have different source segments, but only differ in complex
tokens (controlled through the translation memory's
) which will result in the identical hash values, - The source segments only differ by whitespace or certain punctuation, which do not modify the hash values,
- The hashing algorithm leads to collisions in which case the segments may be entirely different, but still result in the same hash value.
Declaration
public TranslationUnit[] GetDuplicateTranslationUnits(ref DuplicateIterator iterator)
Parameters
Type | Name | Description |
---|---|---|
DuplicateIterator | iterator | The iterator to use |
Returns
Type | Description |
---|---|
TranslationUnit[] | The translation units which are potential duplicates, or |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
GetTranslationUnit(PersistentObjectToken)
Retrieves the translation unit with the specified translationUnitId
from the
translation memory.
Declaration
public TranslationUnit GetTranslationUnit(PersistentObjectToken translationUnitId)
Parameters
Type | Name | Description |
---|---|---|
PersistentObjectToken | translationUnitId | The ID of the translation unit to retrieve. |
Returns
Type | Description |
---|---|
TranslationUnit | The translation unit with the specified ID, or |
GetTranslationUnitCount()
Returns the number of translation units in this TM. Note that the computation of the TU count may be a time-consuming operation for some back-end storage systems.
Declaration
public int GetTranslationUnitCount()
Returns
Type | Description |
---|---|
System.Int32 | The number of translation units. |
GetTranslationUnits(ref RegularIterator)
Retrieves a set of translation units, using an iterator. At most
MaxCount translation units will be returned in one
round-trip.
Declaration
public TranslationUnit[] GetTranslationUnits(ref RegularIterator iterator)
Parameters
Type | Name | Description |
---|---|---|
RegularIterator | iterator | The iterator |
Returns
Type | Description |
---|---|
TranslationUnit[] | The translation units, or |
GetTranslationUnitsWithContextContent(ref RegularIterator)
Identical to GetTranslationUnits(ref RegularIterator) except that the implementation will attempt to populate the Segment1 and Segment2 properties for any items in the Contexts collection of a tu
Declaration
public TranslationUnit[] GetTranslationUnitsWithContextContent(ref RegularIterator iterator)
Parameters
Type | Name | Description |
---|---|---|
RegularIterator | iterator |
Returns
Type | Description |
---|---|
TranslationUnit[] |
Remarks
Implementations must ensure Segment1 and Segment2 are tokenized and that their Tokens collections are returned to the client.
PreviewEditTranslationUnits(EditScript, FilterExpression)
Iteratively applies an EditScript to all translation units in the current translation memory. A filter condition can be sued in which case only those translation units which match the filter will be edited.
Declaration
public TranslationUnit[] PreviewEditTranslationUnits(EditScript editScript, FilterExpression filter)
Parameters
Type | Name | Description |
---|---|---|
EditScript | editScript | The edit script to apply. |
FilterExpression | filter | An optional filter to use for the TM iteration. |
Returns
Type | Description |
---|---|
TranslationUnit[] | The number of edited translation units per round-trip. |
PreviewEditTranslationUnitsWithIterator(EditScript, ref RegularIterator)
Applies the specified edit script to the translation units in a TM, but unlike EditTranslationUnitsWithIterator(EditScript, EditUpdateMode, ref RegularIterator), the TUs will not be updated in the TM, but modified copies of the TUs will be returned to the caller. This can be used to "preview" the changes the edit script would apply.
Declaration
public TranslationUnit[] PreviewEditTranslationUnitsWithIterator(EditScript editScript, ref RegularIterator iterator)
Parameters
Type | Name | Description |
---|---|---|
EditScript | editScript | The edit script |
RegularIterator | iterator | An iterator. See also the iterator-related remarks for EditTranslationUnitsWithIterator(EditScript, EditUpdateMode, ref RegularIterator). |
Returns
Type | Description |
---|---|
TranslationUnit[] |
ReindexTranslationUnits(ref RegularIterator)
Re-indexes the translation memory, using an iterator so that the client can update progress indicators or discontinue the process.
The same iterator instance should be passed in subsequent calls, in order to obtain the next page, and so on.
Declaration
public bool ReindexTranslationUnits(ref RegularIterator iterator)
Parameters
Type | Name | Description |
---|---|---|
RegularIterator | iterator | The iterator to use for the re-indexing process. |
Returns
Type | Description |
---|---|
System.Boolean | False if the iterator is at the end of the TM or the TM is empty, |
Remarks
For larger TMs (> 100.000 TUs) it is recommended to also recompute the index statistics after the re-indexing finished (see RecomputeFuzzyIndexStatistics()).
SearchSegment(SearchSettings, Segment)
Performs a segment search.
Declaration
public SearchResults SearchSegment(SearchSettings settings, Segment segment)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | The settings that define the search parameters. |
Segment | segment | The segment to search for. |
Returns
Type | Description |
---|---|
SearchResults | A SearchResults object containing the results or an empty object if no results were found. |
SearchSegment(SearchSettings, SubsegmentSearchSettings, SubsegmentSearchCondition, Segment)
Declaration
public SegmentAndSubsegmentSearchResults SearchSegment(SearchSettings settings, SubsegmentSearchSettings subsegmentSettings, SubsegmentSearchCondition condition, Segment segment)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
SubsegmentSearchSettings | subsegmentSettings | |
SubsegmentSearchCondition | condition | |
Segment | segment |
Returns
Type | Description |
---|---|
SegmentAndSubsegmentSearchResults |
SearchSegments(SearchSettings, Segment[])
Performs a search for an array of segments.
Declaration
public SearchResults[] SearchSegments(SearchSettings settings, Segment[] segments)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | The settings that define the search parameters. |
Segment[] | segments | The array containing the segments to search for. |
Returns
Type | Description |
---|---|
SearchResults[] | An array of SearchResults objects, which mirrors the segments array. It has the exact same size and contains the search results for each segment with the same index within the segments array. |
SearchSegments(SearchSettings, SubsegmentSearchSettings, SubsegmentSearchCondition, Segment[])
Declaration
public SegmentAndSubsegmentSearchResults[] SearchSegments(SearchSettings settings, SubsegmentSearchSettings subsegmentSettings, SubsegmentSearchCondition condition, Segment[] segments)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
SubsegmentSearchSettings | subsegmentSettings | |
SubsegmentSearchCondition | condition | |
Segment[] | segments |
Returns
Type | Description |
---|---|
SegmentAndSubsegmentSearchResults[] |
SearchSegmentsMasked(SearchSettings, Segment[], Boolean[])
Performs a search for an array of segments, specifying a mask which specifies which segments should actually be
searched (only those for which the corresponding mask bit is true
are searched). If the mask is null
, the method
behaves identically to SearchSegments(SearchSettings, Segment[]). Passing a mask only makes sense in document search contexts (IsDocumentSearch
set to true
).
Declaration
public SearchResults[] SearchSegmentsMasked(SearchSettings settings, Segment[] segments, bool[] mask)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | The settings that define the search parameters. |
Segment[] | segments | The array containing the segments to search for. |
System.Boolean[] | mask | The array containing the segments to search for. |
Returns
Type | Description |
---|---|
SearchResults[] | An array of SearchResults objects, which mirrors the segments array. It has the exact same size and contains the search results for each segment with the same index within the segments array. |
SearchSegmentsMasked(SearchSettings, SubsegmentSearchSettings, SubsegmentSearchCondition, Segment[], Boolean[])
Declaration
public SegmentAndSubsegmentSearchResults[] SearchSegmentsMasked(SearchSettings settings, SubsegmentSearchSettings subsegmentSettings, SubsegmentSearchCondition condition, Segment[] segments, bool[] mask)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
SubsegmentSearchSettings | subsegmentSettings | |
SubsegmentSearchCondition | condition | |
Segment[] | segments | |
System.Boolean[] | mask |
Returns
Type | Description |
---|---|
SegmentAndSubsegmentSearchResults[] |
SearchText(SearchSettings, String)
Performs a text search.
Declaration
public SearchResults SearchText(SearchSettings settings, string segment)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | The settings that define the search parameters. |
System.String | segment | The text to search for. |
Returns
Type | Description |
---|---|
SearchResults | A SearchResults object containing the results or an empty object if no results were found. |
SearchTranslationUnit(SearchSettings, SubsegmentSearchSettings, SubsegmentSearchCondition, TranslationUnit)
Declaration
public SegmentAndSubsegmentSearchResults SearchTranslationUnit(SearchSettings settings, SubsegmentSearchSettings subsegmentSettings, SubsegmentSearchCondition condition, TranslationUnit translationUnit)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
SubsegmentSearchSettings | subsegmentSettings | |
SubsegmentSearchCondition | condition | |
TranslationUnit | translationUnit |
Returns
Type | Description |
---|---|
SegmentAndSubsegmentSearchResults |
SearchTranslationUnit(SearchSettings, TranslationUnit)
Performs a translation unit search.
Declaration
public SearchResults SearchTranslationUnit(SearchSettings settings, TranslationUnit translationUnit)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | The settings that define the search parameters. |
TranslationUnit | translationUnit | The translation unit to search for. |
Returns
Type | Description |
---|---|
SearchResults | A SearchResults object containing the results or an empty object if no results were found. |
SearchTranslationUnits(SearchSettings, SubsegmentSearchSettings, SubsegmentSearchCondition, TranslationUnit[])
Declaration
public SegmentAndSubsegmentSearchResults[] SearchTranslationUnits(SearchSettings settings, SubsegmentSearchSettings subsegmentSettings, SubsegmentSearchCondition condition, TranslationUnit[] translationUnits)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
SubsegmentSearchSettings | subsegmentSettings | |
SubsegmentSearchCondition | condition | |
TranslationUnit[] | translationUnits |
Returns
Type | Description |
---|---|
SegmentAndSubsegmentSearchResults[] |
SearchTranslationUnits(SearchSettings, TranslationUnit[])
Performs a translation unit search for an array of translation units.
Declaration
public SearchResults[] SearchTranslationUnits(SearchSettings settings, TranslationUnit[] translationUnits)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | The settings that define the search parameters. |
TranslationUnit[] | translationUnits | The array containing the translation units to search for. |
Returns
Type | Description |
---|---|
SearchResults[] | An array of SearchResults objects, which mirrors the translation unit array. It has the exact same size and contains the search results for each translation unit with the same index within the translation unit array. |
SearchTranslationUnitsMasked(SearchSettings, SubsegmentSearchSettings, SubsegmentSearchCondition, TranslationUnit[], Boolean[])
Declaration
public virtual SegmentAndSubsegmentSearchResults[] SearchTranslationUnitsMasked(SearchSettings settings, SubsegmentSearchSettings subsegmentSettings, SubsegmentSearchCondition condition, TranslationUnit[] translationUnits, bool[] mask)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | |
SubsegmentSearchSettings | subsegmentSettings | |
SubsegmentSearchCondition | condition | |
TranslationUnit[] | translationUnits | |
System.Boolean[] | mask |
Returns
Type | Description |
---|---|
SegmentAndSubsegmentSearchResults[] |
SearchTranslationUnitsMasked(SearchSettings, TranslationUnit[], Boolean[])
Similar to SearchTranslationUnits(SearchSettings, TranslationUnit[]), but allows passing a mask which specifies which TUs are actually searched. This is useful in document search contexts where some TUs are passed which should be used to establish a (text) context, but which should not be processed.
Declaration
public virtual SearchResults[] SearchTranslationUnitsMasked(SearchSettings settings, TranslationUnit[] translationUnits, bool[] mask)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | The settings that define the search parameters. |
TranslationUnit[] | translationUnits | The array containing the translation units to search for. |
System.Boolean[] | mask | A |
Returns
Type | Description |
---|---|
SearchResults[] | An array of SearchResults objects, which mirrors the translation unit array. It has the exact same size and contains the search results for each translation unit with the same index within the translation unit array. |
SubsegmentSearchSegment(SubsegmentSearchSettings, Segment)
Performs a subsegment search on the given segment
Declaration
public SubsegmentSearchResultsCollection SubsegmentSearchSegment(SubsegmentSearchSettings settings, Segment segment)
Parameters
Type | Name | Description |
---|---|---|
SubsegmentSearchSettings | settings | Subsegment search settings |
Segment | segment | Segment to use in search query |
Returns
Type | Description |
---|---|
SubsegmentSearchResultsCollection | A SubsegmentSearchResultsCollection object containing the results or an empty object if no results were found. |
SubsegmentSearchSegments(SubsegmentSearchSettings, Segment[])
Performs a subsegment search on the given array of segments
Declaration
public SubsegmentSearchResultsCollection[] SubsegmentSearchSegments(SubsegmentSearchSettings settings, Segment[] segments)
Parameters
Type | Name | Description |
---|---|---|
SubsegmentSearchSettings | settings | Subsegment search settings |
Segment[] | segments | Segment to use in search query |
Returns
Type | Description |
---|---|
SubsegmentSearchResultsCollection[] | A SubsegmentSearchResultsCollection array containing the results or an empty array if no results were found. |
SupportedSubsegmentMatchTypes()
Declaration
public List<SubsegmentMatchType> SupportedSubsegmentMatchTypes()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<SubsegmentMatchType> |
UpdateTranslationUnit(TranslationUnit)
Updates the properties and fields of an existing translation unit if the source and target segments are unchanged or adds a new translation unit otherwise. If the provider doesn't support adding/updating, the implementation should return a reasonable ImportResult but should not throw an exception.
The translation unit should be initialized in a previous call to the translation memory, so that the ID property is set to a valid value.
Declaration
public ImportResult UpdateTranslationUnit(TranslationUnit translationUnit)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnit | The translation unit to be updated. |
Returns
Type | Description |
---|---|
ImportResult | The result of the operation. |
UpdateTranslationUnits(TranslationUnit[])
Updates the properties and fields of an array of existing translation units if the source and target segments are unchanged or adds new translation units otherwise. If the provider doesn't support adding/updating, the implementation should return a reasonable ImportResult but should not throw an exception.
The translation units should be initialized in previous calls to the translation memory, so that their ID properties are set to valid values.
Declaration
public ImportResult[] UpdateTranslationUnits(TranslationUnit[] translationUnits)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit[] | translationUnits | The translation unit array to be updated. |
Returns
Type | Description |
---|---|
ImportResult[] | An array of results which mirrors the translation unit array. It has the exact same size and contains the results for each translation unit with the same index within the translation unit array. |
UpdateTranslationUnitsMasked(TranslationUnit[], Boolean[])
Updates (adds, overwrites, or merges) the specified translation units.
Declaration
public ImportResult[] UpdateTranslationUnitsMasked(TranslationUnit[] translationUnits, bool[] mask)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit[] | translationUnits | The translation units to update. |
System.Boolean[] | mask | An optional mask with the same length as . Those TUs for which the corresponding
flag is will only be used to establish context information. If no masking
is required, this parameter can be null.
|
Returns
Type | Description |
---|---|
ImportResult[] | An array of ImportResults with the same length as |
Explicit Interface Implementations
ITranslationProviderLanguageDirection.TranslationProvider
Gets the translation memory to which this language direction belongs.
Declaration
ITranslationProvider ITranslationProviderLanguageDirection.TranslationProvider { get; }
Returns
Type | Description |
---|---|
ITranslationProvider |