Search Results for

    Show / Hide Table of Contents

    Class SegmentElement

    Base abstract class representing a segment element. A Segment consists of a sequence of segment elements.

    Inheritance
    object
    SegmentElement
    Tag
    Text
    Token
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Sdl.LanguagePlatform.Core
    Assembly: Sdl.LanguagePlatform.Core.dll
    Syntax
    [DataContract]
    [KnownType(typeof(Tag))]
    [KnownType(typeof(Text))]
    [KnownType(typeof(Token))]
    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 null)

    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, bool)

    Declaration
    public SegmentElement.Similarity GetSimilarity(SegmentElement other, bool allowCompatibility)
    Parameters
    Type Name Description
    SegmentElement other
    bool allowCompatibility
    Returns
    Type Description
    SegmentElement.Similarity

    GetSimilarityAsync(SegmentElement)

    Computes the degree of similarity to another instance.

    Declaration
    public Task<SegmentElement.Similarity> GetSimilarityAsync(SegmentElement other)
    Parameters
    Type Name Description
    SegmentElement other

    The other instance.

    Returns
    Type Description
    Task<SegmentElement.Similarity>

    A value indicating the degree of similarity to the provided segment element.

    GetSimilarityAsync(SegmentElement, bool)

    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 Task<SegmentElement.Similarity> GetSimilarityAsync(SegmentElement other, bool allowCompatibility)
    Parameters
    Type Name Description
    SegmentElement other

    The other instance.

    bool allowCompatibility

    If True, more flexible type compatibility will be used if available for the comparison

    Returns
    Type Description
    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
    int

    A hash code which is independent of tag anchors.

    In this article
    • Constructors
      • SegmentElement()
    • Methods
      • AcceptSegmentElementVisitor(ISegmentElementVisitor)
      • Duplicate()
      • GetSimilarity(SegmentElement)
      • GetSimilarity(SegmentElement, bool)
      • GetSimilarityAsync(SegmentElement)
      • GetSimilarityAsync(SegmentElement, bool)
      • GetWeakHashCode()
    Back to top Generated by DocFX