Search Results for

    Show / Hide Table of Contents

    Class WordCounts

    Represents the result of a word count.

    Inheritance
    System.Object
    WordCounts
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Sdl.LanguagePlatform.TranslationMemory
    Assembly: Sdl.LanguagePlatform.TranslationMemory.dll
    Syntax
    public class WordCounts

    Constructors

    WordCounts()

    Initializes a new instance with default values. All counts will be set to 0.

    Declaration
    public WordCounts()

    WordCounts(WordCounts)

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

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

    The instance to copy

    WordCounts(IList<Token>)

    Initializes a new instance from the values in the provided token collection.

    Declaration
    public WordCounts(IList<Token> tokens)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<Token> tokens

    The token collection

    WordCounts(IList<Token>, WordCountsOptions, CultureCode)

    Declaration
    [Obsolete("Use CreateWordCountsAsync")]
    public WordCounts(IList<Token> tokens, WordCountsOptions options, CultureCode culture)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<Token> tokens
    WordCountsOptions options
    Sdl.Core.Globalization.CultureCode culture

    WordCounts(IList<Token>, Boolean, Boolean, Boolean, Boolean)

    Initializes a new instance from the values in the provided token collection.

    Declaration
    public WordCounts(IList<Token> tokens, bool breakOnHyphen, bool breakOnDash, bool breakOnTag, bool breakOnApostrophe)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<Token> tokens

    The token collection

    System.Boolean breakOnHyphen

    If false, 2 words separated by a hyphen count as 1

    System.Boolean breakOnDash

    If false, 2 words separated by a dash count as 1

    System.Boolean breakOnTag

    If false, 2 words separated by a formatting tag count as 1

    System.Boolean breakOnApostrophe

    If false, 2 words separated by an apostrophe count as 1

    Properties

    Characters

    Gets or sets the character count.

    Declaration
    public int Characters { get; set; }
    Property Value
    Type Description
    System.Int32

    IsZero

    Gets a boolean value which indicates whether all count values are zero or not.

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

    Placeables

    Gets or sets the placeable count.

    Declaration
    public int Placeables { get; set; }
    Property Value
    Type Description
    System.Int32

    Segments

    Gets or sets the segment count.

    Declaration
    public int Segments { get; set; }
    Property Value
    Type Description
    System.Int32

    Tags

    Gets or sets the tag count.

    Declaration
    public int Tags { get; set; }
    Property Value
    Type Description
    System.Int32

    Words

    Gets or sets the word count.

    Declaration
    public int Words { get; set; }
    Property Value
    Type Description
    System.Int32

    Methods

    Assign(WordCounts)

    Overwrites the count values of this instance with the values of another instance.

    Declaration
    public void Assign(WordCounts other)
    Parameters
    Type Name Description
    WordCounts other

    The instance which values to assign to this instance

    CreateWordCountsAsync(IList<Token>, WordCountsOptions, CultureCode, ICultureMetadataManager)

    Declaration
    public static Task<WordCounts> CreateWordCountsAsync(IList<Token> tokens, WordCountsOptions options, CultureCode cultureCode, ICultureMetadataManager cultureMetadataManager)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<Token> tokens
    WordCountsOptions options
    Sdl.Core.Globalization.CultureCode cultureCode
    Sdl.Core.Globalization.CultureMetadataManager.ICultureMetadataManager cultureMetadataManager
    Returns
    Type Description
    System.Threading.Tasks.Task<WordCounts>

    Duplicate()

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

    Declaration
    public WordCounts Duplicate()
    Returns
    Type Description
    WordCounts

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

    Inc(WordCounts)

    Increments the count values of this instance with the count values of another instance.

    Declaration
    public void Inc(WordCounts other)
    Parameters
    Type Name Description
    WordCounts other

    The other instance

    On this page

    • Constructors
      • WordCounts()
      • WordCounts(WordCounts)
      • WordCounts(IList<Token>)
      • WordCounts(IList<Token>, WordCountsOptions, CultureCode)
      • WordCounts(IList<Token>, Boolean, Boolean, Boolean, Boolean)
    • Properties
      • Characters
      • IsZero
      • Placeables
      • Segments
      • Tags
      • Words
    • Methods
      • Assign(WordCounts)
      • CreateWordCountsAsync(IList<Token>, WordCountsOptions, CultureCode, ICultureMetadataManager)
      • Duplicate()
      • Inc(WordCounts)
    Back to top Generated by DocFX