Selectable​Words​Segmenter Selectable​Words​Segmenter Selectable​Words​Segmenter Selectable​Words​Segmenter Class

Definition

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).

public : sealed class SelectableWordsSegmenter : ISelectableWordsSegmenterpublic sealed class SelectableWordsSegmenter : ISelectableWordsSegmenterPublic NotInheritable Class SelectableWordsSegmenter Implements ISelectableWordsSegmenter// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Constructors

SelectableWordsSegmenter(String) SelectableWordsSegmenter(String) SelectableWordsSegmenter(String) SelectableWordsSegmenter(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(PlatForm::String language)public SelectableWordsSegmenter(String language)Public Sub New(language As String)// You can use this method in JavaScript.
Parameters
language
PlatForm::String String String String

A BCP-47 language tag.

Attributes

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 : PlatForm::String ResolvedLanguage { get; }public string ResolvedLanguage { get; }Public ReadOnly Property ResolvedLanguage As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The BCP-47 language tag of the rules employed.

Attributes

Methods

GetTokenAt(String, UInt32) GetTokenAt(String, UInt32) GetTokenAt(String, UInt32) GetTokenAt(String, UInt32)

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

public : SelectableWordSegment GetTokenAt(PlatForm::String text, unsigned int startIndex)public SelectableWordSegment GetTokenAt(String text, UInt32 startIndex)Public Function GetTokenAt(text As String, startIndex As UInt32) As SelectableWordSegment// You can use this method in JavaScript.
Parameters
text
PlatForm::String String String String

Provided text in which a word or word stem is to be selected.

startIndex
unsigned int UInt32 UInt32 UInt32

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

Returns
Attributes

Remarks

Note that some languages do not use spaces (such as Japanese or Chinese) and some languages may return multiple word stems for compound words (such as German).

GetTokens(String) GetTokens(String) GetTokens(String) GetTokens(String)

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

public : IVectorView<SelectableWordSegment> GetTokens(PlatForm::String text)public IReadOnlyList<SelectableWordSegment> GetTokens(String text)Public Function GetTokens(text As String) As IReadOnlyList( Of SelectableWordSegment )// You can use this method in JavaScript.
Parameters
text
PlatForm::String String String String

Provided text containing words or word stems to be selected.

Returns
IVectorView<SelectableWordSegment> IReadOnlyList<SelectableWordSegment> IReadOnlyList<SelectableWordSegment> IReadOnlyList<SelectableWordSegment>

A collection of SelectableWordSegment objects that represent the selectable words or word stems.

Attributes

Remarks

Note that some languages do not use spaces (such as Japanese or Chinese) and some languages may return multiple word stems for compound words (such as German).

Tokenize(String, UInt32, SelectableWordSegmentsTokenizingHandler) Tokenize(String, UInt32, SelectableWordSegmentsTokenizingHandler) Tokenize(String, UInt32, SelectableWordSegmentsTokenizingHandler) Tokenize(String, UInt32, 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(PlatForm::String text, unsigned int startIndex, SelectableWordSegmentsTokenizingHandler handler)public void Tokenize(String text, UInt32 startIndex, SelectableWordSegmentsTokenizingHandler handler)Public Function Tokenize(text As String, startIndex As UInt32, handler As SelectableWordSegmentsTokenizingHandler) As void// You can use this method in JavaScript.
Parameters
text
PlatForm::String String String String

Provided text containing words to be selected.

startIndex
unsigned int UInt32 UInt32 UInt32

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

Attributes

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. The handler is not called if there are no selectable words in text.

See Also