Search Results for

    Show / Hide Table of Contents

    Class SimpleToken

    A Token which represents a simple token, such as a word, whitespace, or punctuation.

    Inheritance
    System.Object
    SegmentElement
    Token
    SimpleToken
    GenericPlaceableToken
    Inherited Members
    Token.GetWeakHashCode()
    Token.GetBundleSimilarity(SegmentElement)
    Token.TokenizationContext
    Token.Text
    Token.Span
    Token.Type
    Token.IsWord
    Token.IsPunctuation
    Token.IsWhitespace
    Token.Culture
    SegmentElement.GetSimilarity(SegmentElement, Boolean)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Sdl.LanguagePlatform.Core.Tokenization
    Assembly: Sdl.LanguagePlatform.Core.dll
    Syntax
    public class SimpleToken : Token

    Constructors

    SimpleToken()

    Initializes a new instance with default values

    Declaration
    public SimpleToken()

    SimpleToken(SimpleToken)

    Initializes a new instance with the values from another instance, creating a deep copy.

    Declaration
    public SimpleToken(SimpleToken other)
    Parameters
    Type Name Description
    SimpleToken other

    The instance to create a copy for

    SimpleToken(String)

    Initializes a new instance with the specified token text, and a token type of Word.

    Declaration
    public SimpleToken(string text)
    Parameters
    Type Name Description
    System.String text

    SimpleToken(String, TokenType)

    Initializes a new instance with the specified values.

    Declaration
    public SimpleToken(string text, TokenType t)
    Parameters
    Type Name Description
    System.String text

    The token text

    TokenType t

    The token type

    Properties

    IsPlaceable

    IsPlaceable. Returns true if the token represents an acronym, a variable, a URI, or a generic text placeable.

    Declaration
    public override bool IsPlaceable { get; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    Token.IsPlaceable

    IsStopword

    Gets or sets whether this token is a stop word

    Declaration
    public bool IsStopword { get; set; }
    Property Value
    Type Description
    System.Boolean

    IsSubstitutable

    IsSubstitutable. Returns true if this token represents a variable.

    Declaration
    public override bool IsSubstitutable { get; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    Token.IsSubstitutable

    Stem

    An optional stem to assign to this token. Stems are used for TM search and scoring.

    Declaration
    public string Stem { get; set; }
    Property Value
    Type Description
    System.String

    Methods

    AcceptSegmentElementVisitor(ISegmentElementVisitor)

    Visitor pattern implementation. Calls VisitSimpleToken(SimpleToken).

    Declaration
    public override void AcceptSegmentElementVisitor(ISegmentElementVisitor visitor)
    Parameters
    Type Name Description
    ISegmentElementVisitor visitor

    The visitor instance

    Overrides
    SegmentElement.AcceptSegmentElementVisitor(ISegmentElementVisitor)

    Duplicate()

    See Duplicate()

    Declaration
    public override SegmentElement Duplicate()
    Returns
    Type Description
    SegmentElement

    A new instance that is a deep copy of this instance.

    Overrides
    SegmentElement.Duplicate()

    Equals(Object)

    System.Object.Equals(object)
    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj

    The object to compare with the current object.

    Returns
    Type Description
    System.Boolean

    true if the specified object is equal to the current object; otherwise, false.

    Overrides
    Token.Equals(Object)

    GetHashCode()

    System.Object.GetHashCode(object)
    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    Token.GetHashCode()

    GetSimilarity(SegmentElement)

    GetSimilarity(SegmentElement)
    Declaration
    public override SegmentElement.Similarity GetSimilarity(SegmentElement other)
    Parameters
    Type Name Description
    SegmentElement other

    The other instance.

    Returns
    Type Description
    SegmentElement.Similarity

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

    Overrides
    SegmentElement.GetSimilarity(SegmentElement)

    GetTokenType()

    Type
    Declaration
    protected override TokenType GetTokenType()
    Returns
    Type Description
    TokenType
    Overrides
    Token.GetTokenType()

    SetTokenType(TokenType)

    Overwrites the token type. This should only be done with caution, and to reclassify exchangeable token types (acronyms, words, abbreviations). In particular, do not set the token type to one of the special (localizable) token types.

    Declaration
    protected override void SetTokenType(TokenType tokenType)
    Parameters
    Type Name Description
    TokenType tokenType
    Overrides
    Token.SetTokenType(TokenType)

    ToString()

    System.Object.ToString()
    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    A string representation of the object, for display purposes.

    Overrides
    System.Object.ToString()

    On this page

    • Constructors
      • SimpleToken()
      • SimpleToken(SimpleToken)
      • SimpleToken(String)
      • SimpleToken(String, TokenType)
    • Properties
      • IsPlaceable
      • IsStopword
      • IsSubstitutable
      • Stem
    • Methods
      • AcceptSegmentElementVisitor(ISegmentElementVisitor)
      • Duplicate()
      • Equals(Object)
      • GetHashCode()
      • GetSimilarity(SegmentElement)
      • GetTokenType()
      • SetTokenType(TokenType)
      • ToString()
    Back to top Generated by DocFX