Class SegmentElement
Base abstract class representing a segment element. A Segment consists of a sequence of segment elements.
Inherited Members
Namespace: Sdl.LanguagePlatform.Core
Assembly: Sdl.LanguagePlatform.Core.dll
Syntax
public abstract class SegmentElement
Constructors
SegmentElement()
Declaration
protected SegmentElement()
Methods
AcceptSegmentElementVisitor(ISegmentElementVisitor)
Visitor pattern implementation. Derived classes should call back on the appropriate method on the visitor.
Declaration
public abstract void AcceptSegmentElementVisitor(ISegmentElementVisitor visitor)
Parameters
| Type | Name | Description |
|---|---|---|
| ISegmentElementVisitor | visitor | The visitor instance (must not be |
Duplicate()
Creates a new instance that is a deep copy of this instance.
Declaration
public abstract SegmentElement Duplicate()
Returns
| Type | Description |
|---|---|
| SegmentElement | A new instance that is a deep copy of this instance. |
GetSimilarity(SegmentElement)
Declaration
public SegmentElement.Similarity GetSimilarity(SegmentElement other)
Parameters
| Type | Name | Description |
|---|---|---|
| SegmentElement | other |
Returns
| Type | Description |
|---|---|
| SegmentElement.Similarity |
GetSimilarity(SegmentElement, Boolean)
Declaration
public SegmentElement.Similarity GetSimilarity(SegmentElement other, bool allowCompatibility)
Parameters
| Type | Name | Description |
|---|---|---|
| SegmentElement | other | |
| System.Boolean | allowCompatibility |
Returns
| Type | Description |
|---|---|
| SegmentElement.Similarity |
GetSimilarityAsync(SegmentElement)
Computes the degree of similarity to another instance.
Declaration
public virtual Task<SegmentElement.Similarity> GetSimilarityAsync(SegmentElement other)
Parameters
| Type | Name | Description |
|---|---|---|
| SegmentElement | other | The other instance. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<SegmentElement.Similarity> | A value indicating the degree of similarity to the provided segment element. |
GetSimilarityAsync(SegmentElement, Boolean)
Computes the degree of similarity to another instance, with the option of more flexible type compatibility (e.g. treat 'cm' and 'ft' as same type, because both measure length)
Declaration
public virtual Task<SegmentElement.Similarity> GetSimilarityAsync(SegmentElement other, bool allowCompatibility)
Parameters
| Type | Name | Description |
|---|---|---|
| SegmentElement | other | The other instance. |
| System.Boolean | allowCompatibility | If True, more flexible type compatibility will be used if available for the comparison |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<SegmentElement.Similarity> |
GetWeakHashCode()
Returns a hash code which does not depend on tag anchors in the segment. This can be used for translation tracking in bilingual scenarios.
Declaration
public abstract int GetWeakHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 | A hash code which is independent of tag anchors. |