SelectableWordsSegmenter SelectableWordsSegmenter SelectableWordsSegmenter SelectableWordsSegmenter Class

A segmenter class that is able to segment provided text into units appropriate for selecting text by words.

The language supplied when this object is constructed is matched against the languages with word breakers on the system, and the best word segmentation rules available are used. The language need not be one of the app's supported languages. If there are no supported language rules available specifically for that language, the language-neutral rules are used (an implementation of Unicode Standard Annex #29 Unicode Text Segmentation), and the ResolvedLanguage property is set to "und" (undetermined language).

Syntax

Declaration

public sealed class SelectableWordsSegmenterpublic sealed class SelectableWordsSegmenterPublic NotInheritable Class SelectableWordsSegmenter

Constructors summary

Creates a SelectableWordsSegmenter object. See the introduction in SelectableWordsSegmenter for a description of how the language supplied to this constructor is used.

Properties summary

Gets the language of the rules used by this SelectableWordsSegmenter object.

"und" (undetermined) is returned if we are using language-neutral rules.

Methods summary

Determines and returns the selectable word which contains or follows a specified index into the provided text.

Determines and returns all of the selectable words in the provided text.

Calls the provided handler with two iterators that iterate through the selectable words prior to and following a given index into the provided text.

Constructors

  • SelectableWordsSegmenter(System.String)
    SelectableWordsSegmenter(System.String)
    SelectableWordsSegmenter(System.String)
    SelectableWordsSegmenter(System.String)

    Creates a SelectableWordsSegmenter object. See the introduction in SelectableWordsSegmenter for a description of how the language supplied to this constructor is used.

    public SelectableWordsSegmenter(System.String language)public SelectableWordsSegmenter(System.String language)Public Function SelectableWordsSegmenter(language As System.String) As

    Parameters

    • language
      System.String
      System.String
      System.String
      System.String

      A BCP-47 language tag.

Properties

  • ResolvedLanguage
    ResolvedLanguage
    ResolvedLanguage
    ResolvedLanguage

    Gets the language of the rules used by this SelectableWordsSegmenter object.

    "und" (undetermined) is returned if we are using language-neutral rules.

    public string ResolvedLanguage { get; }public string ResolvedLanguage { get; }Public ReadOnly Property ResolvedLanguage As string

    Property Value

    • string
      string
      string
      string

      The BCP-47 language tag of the rules employed.

Methods

  • GetTokenAt(System.String,System.UInt32)
    GetTokenAt(System.String,System.UInt32)
    GetTokenAt(System.String,System.UInt32)
    GetTokenAt(System.String,System.UInt32)

    Determines and returns the selectable word which contains or follows a specified index into the provided text.

    public SelectableWordSegment GetTokenAt(System.String text,System.UInt32 startIndex)public SelectableWordSegment GetTokenAt(System.String text,System.UInt32 startIndex)Public Function GetTokenAt(text As System.String,startIndex As System.UInt32) As SelectableWordSegment

    Parameters

    • text
      System.String
      System.String
      System.String
      System.String

      Provided text in which a word is to be selected.

    • startIndex
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      A zero-based index into text. It must be less than the length of text.

    Returns

  • GetTokens(System.String)
    GetTokens(System.String)
    GetTokens(System.String)
    GetTokens(System.String)

    Determines and returns all of the selectable words in the provided text.

    public IVectorView<SelectableWordSegment> GetTokens(System.String text)public IVectorView<SelectableWordSegment> GetTokens(System.String text)Public Function GetTokens(text As System.String) As IVectorView( Of SelectableWordSegment )

    Parameters

    • text
      System.String
      System.String
      System.String
      System.String

      Provided text containing words to be selected.

    Returns

  • Tokenize(System.String,System.UInt32,Windows.Data.Text.SelectableWordSegmentsTokenizingHandler)
    Tokenize(System.String,System.UInt32,Windows.Data.Text.SelectableWordSegmentsTokenizingHandler)
    Tokenize(System.String,System.UInt32,Windows.Data.Text.SelectableWordSegmentsTokenizingHandler)
    Tokenize(System.String,System.UInt32,Windows.Data.Text.SelectableWordSegmentsTokenizingHandler)

    Calls the provided handler with two iterators that iterate through the selectable words prior to and following a given index into the provided text.

    public void Tokenize(System.String text,System.UInt32 startIndex,Windows.Data.Text.SelectableWordSegmentsTokenizingHandler handler)public void Tokenize(System.String text,System.UInt32 startIndex,Windows.Data.Text.SelectableWordSegmentsTokenizingHandler handler)Public Function Tokenize(text As System.String,startIndex As System.UInt32,handler As Windows.Data.Text.SelectableWordSegmentsTokenizingHandler) As void

    Parameters

    Remarks

    The iterators in SelectableWordSegmentsTokenizingHandler are lazy and evaluate small chunks of text at a time.

    The handler is called at most once per call to Tokenize(System.String,System.UInt32,Windows.Data.Text.SelectableWordSegmentsTokenizingHandler). The handler is not called if there are no selectable words in text.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.ThreadingAttribute

Details

Assembly

Windows.Data.Text.dll