Class AbstractLocalTranslationMemory
Abstract base class for bilingual file-based (FileBasedTranslationMemory) and in-memory translation memories (InMemoryTranslationMemory). Do not inherit from this class.
Inheritance
Inherited Members
Namespace: SdlSdl.LanguagePlatformTranslationMemoryApi
Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
Syntax
public abstract class AbstractLocalTranslationMemory : ITranslationMemory, ITranslationProvider, ISupportPlaceables, ILocalTranslationMemory
Properties
Copyright
Gets or sets the copyright string for this translation memory.
Declaration
public string Copyright { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
You have to call Save() in order to perist changes to this property.
CreationDate
Gets the creation date of this translation memory.
Declaration
public DateTime CreationDate { get; set; }
Property Value
Type | Description |
---|---|
DateTime |
CreationUserName
Gets the creation user of this translation memory.
Declaration
public string CreationUserName { get; }
Property Value
Type | Description |
---|---|
string |
Description
Gets or sets a general description of the translation memory.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
You have to call Save() in order to perist changes to this property.
ExpirationDate
Gets or sets the expiration date for this translation memory.
Declaration
public DateTime? ExpirationDate { get; set; }
Property Value
Type | Description |
---|---|
DateTime |
Remarks
You have to call Save() in order to perist changes to this property.
FieldDefinitions
Gets the custom fields defined for this TM.
Declaration
public FieldDefinitionCollection FieldDefinitions { get; }
Property Value
Type | Description |
---|---|
FieldDefinitionCollection |
Remarks
In case this is a server-based translation memory, which is associated with a fields template (see IFieldsTemplate), this returns a read-only fields collection identical to the template's fields collection. In all other cases, the field collection returned can be modified. Note that you have to call Save() to persist any changes made to the fields.
FuzzyIndexStatisticsRecomputedAt
Gets the time of the last fuzzy index statistics recomputation of this TM, if available.
Declaration
public DateTime? FuzzyIndexStatisticsRecomputedAt { get; set; }
Property Value
Type | Description |
---|---|
DateTime |
FuzzyIndexStatisticsSize
Gets the size of the TM at the point of the last fuzzy index statistics recomputation, if available.
Declaration
public int? FuzzyIndexStatisticsSize { get; set; }
Property Value
Type | Description |
---|---|
int |
FuzzyIndexTuningSettings
Gets or sets the fuzzy index tuning settings for the TM.
Declaration
public FuzzyIndexTuningSettings FuzzyIndexTuningSettings { get; set; }
Property Value
Type | Description |
---|---|
FuzzyIndexTuningSettings |
FuzzyIndexes
Gets or sets the set of fuzzy indices defined on this TM.
Declaration
public FuzzyIndexes FuzzyIndexes { get; set; }
Property Value
Type | Description |
---|---|
FuzzyIndexes |
IsReadOnly
Declaration
public virtual bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
bool |
LanguageDirection
Gets the one language direction contained in this translation memory.
Declaration
public ITranslationMemoryLanguageDirection LanguageDirection { get; }
Property Value
Type | Description |
---|---|
ITranslationMemoryLanguageDirection |
LanguageResourceBundles
Gets the language resources which are associated with this TM.
Declaration
public LanguageResourceBundleCollection LanguageResourceBundles { get; }
Property Value
Type | Description |
---|---|
LanguageResourceBundleCollection |
Remarks
In case this is a server-based translation memory, which is associated with a language resources template (see ILanguageResourcesTemplate), this returns a read-only language resources collection identical to the template's language resources collection. In all other cases, the language resources collection returned can be modified. Note that you have to call Save() to persist any changes made to language resources.
Name
Gets the name of the translation memory.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
string |
Recognizers
Gets or sets the recognizers which are enabled for this TM.
Declaration
public BuiltinRecognizers Recognizers { get; set; }
Property Value
Type | Description |
---|---|
BuiltinRecognizers |
StatusInfo
Gets the status info for the provider.
Declaration
public abstract ProviderStatusInfo StatusInfo { get; }
Property Value
Type | Description |
---|---|
ProviderStatusInfo |
SupportedLanguageDirections
Gets the list of language directions which are supported by this translation memory.
Declaration
public ReadOnlyCollection<LanguagePair> SupportedLanguageDirections { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollectionLanguagePair |
SupportsConcordanceSearch
SupportsConcordanceSearch. Always true for TMs.
Declaration
public virtual bool SupportsConcordanceSearch { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsDocumentSearches
SupportsDocumentSearches. Always true for TMs.
Declaration
public virtual bool SupportsDocumentSearches { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsFilters
SupportsFilters. Always true for TMs.
Declaration
public virtual bool SupportsFilters { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsFuzzySearch
SupportsFuzzySearch. Always true for TMs.
Declaration
public virtual bool SupportsFuzzySearch { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsMultipleResults
SupportsMultipleResults. Always true for TMs.
Declaration
public virtual bool SupportsMultipleResults { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsPenalties
SupportsPenalties. Always true for TMs.
Declaration
public virtual bool SupportsPenalties { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsPlaceables
SupportsPlaceables. Always true for TMs.
Declaration
public virtual bool SupportsPlaceables { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsScoring
SupportsScoring. Always true for TMs.
Declaration
public virtual bool SupportsScoring { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsSearchForTranslationUnits
SupportsSearchForTranslationUnits. Always true for TMs.
Declaration
public virtual bool SupportsSearchForTranslationUnits { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsSourceConcordanceSearch
SupportsSourceConcordanceSearch. Always true for TMs.
Declaration
public virtual bool SupportsSourceConcordanceSearch { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsStructureContext
SupportsStructureContext. Always true for TMs.
Declaration
public virtual bool SupportsStructureContext { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsTaggedInput
SupportsTaggedInput. Always true for TMs.
Declaration
public virtual bool SupportsTaggedInput { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsTargetConcordanceSearch
SupportsTargetConcordanceSearch. Returns
true
if this translation memory has a word-based fuzzy index for the target language (see FuzzyIndexes).
Declaration
public virtual bool SupportsTargetConcordanceSearch { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsTranslation
SupportsTranslation. Always true for TMs.
Declaration
public virtual bool SupportsTranslation { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsUpdate
SupportsUpdate. Always true for TMs.
Declaration
public virtual bool SupportsUpdate { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsWordCounts
SupportsWordCounts. Always true for TMs.
Declaration
public virtual bool SupportsWordCounts { get; }
Property Value
Type | Description |
---|---|
bool |
TranslationMethod
Declaration
public TranslationMethod TranslationMethod { get; }
Property Value
Type | Description |
---|---|
TranslationMethod |
Uri
Gets a URI which uniquely identifies this translation memory.
Declaration
public virtual Uri Uri { get; }
Property Value
Type | Description |
---|---|
Uri |
Methods
ClearFuzzyCache()
Clear the fuzzy cache of the TM
Declaration
public void ClearFuzzyCache()
CreateFileBasedTranslationMemoryLanguageDirection()
Declaration
protected virtual FileBasedTranslationMemoryLanguageDirection CreateFileBasedTranslationMemoryLanguageDirection()
Returns
Type | Description |
---|---|
FileBasedTranslationMemoryLanguageDirection |
Delete()
Deletes this translation memory.
Declaration
public void Delete()
Remarks
In the case of a file-based translation memory, this deletes the translation memory file itself.
GetLanguageDirection(LanguagePair)
Gets a specified translation memory language direction.
Declaration
public ITranslationMemoryLanguageDirection GetLanguageDirection(LanguagePair languageDirection)
Parameters
Type | Name | Description |
---|---|---|
LanguagePair | languageDirection | The language direction. |
Returns
Type | Description |
---|---|
ITranslationMemoryLanguageDirection | A translation provider for the specified language direction, or null if no language direction matches. |
GetTranslationUnitCount()
Gets the total translation unit count for all language directions in this translation memory.
Declaration
public int GetTranslationUnitCount()
Returns
Type | Description |
---|---|
int | The total translation unit count for this TM. |
HasPermission(string)
Checks whether the current user has the specified permission on this translation memory.
Declaration
public abstract bool HasPermission(string permission)
Parameters
Type | Name | Description |
---|---|---|
string | permission | A permission ID. See TranslationMemoryPermissions. |
Returns
Type | Description |
---|---|
bool | True if the user has the speicfied permission for this TM. |
LoadState(string)
Loads previously serialized state information into this translation provider instance.
Declaration
public virtual void LoadState(string translationProviderState)
Parameters
Type | Name | Description |
---|---|---|
string | translationProviderState | A string representing the state of translation provider that was previously saved using SerializeState(). |
Remarks
The format of this string can be decided upon by the translation provider implementation.
RecomputeFuzzyIndexStatistics()
Synchronously recomputes the fuzzy index statistics of the TM.
Declaration
public void RecomputeFuzzyIndexStatistics()
Refresh()
Enforces the currently stored setup information to be refreshed. Note that this may initiate a full server/database roundtrip.
Declaration
public void Refresh()
RefreshStatusInfo()
Refreshes the current status information.
Declaration
public abstract void RefreshStatusInfo()
Save()
Saves changes made to properties of this translation memory.
Declaration
public void Save()
Save(IProgress<TranslationMemoryProgress>, CancellationToken)
Saves changes made to properties of this translation memory.
Declaration
public void Save(IProgress<TranslationMemoryProgress> progress, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IProgressTranslationMemoryProgress | progress | |
CancellationToken | cancellationToken |
SerializeState()
Serializes any meaningful state information for this translation provider that can be stored in projects and sent around the supply chain.
Declaration
public virtual string SerializeState()
Returns
Type | Description |
---|---|
string | A string representing the state of this translation provider that can later be passed into the LoadState(string) method to restore the state after creating a new translation provider. |
Remarks
The format of this string can be decided upon by the translation provider implementation.
ShouldRecomputeFuzzyIndexStatistics()
Gets a flag which indicates whether it is recommended to recompute the fuzzy index statistics (see RecomputeFuzzyIndexStatistics()).
Declaration
public bool ShouldRecomputeFuzzyIndexStatistics()
Returns
Type | Description |
---|---|
bool |
SupportsLanguageDirection(LanguagePair)
Checks whether this translation provider supports the specified language direction.
Declaration
public bool SupportsLanguageDirection(LanguagePair languageDirection)
Parameters
Type | Name | Description |
---|---|---|
LanguagePair | languageDirection | The language direction. |
Returns
Type | Description |
---|---|
bool | True if the specified language direction is supported. |