TX Spell .NET for WPF

GetHyphenationPoint Method

Method|Introduced in 4.0
Namespace
TXTextControl.WPF.Proofing
Package
TXTextControl.TXSpell.WPF.SDK as TXSpell.WPF.dll from the private NuGet feed or Text Control Offline Packages

Description

Returns the next hyphenation point for a specific word right before a defined divide position. Using the first implementation that point is caluclated by applying the default hyphenation list. The second implementation uses a hyphenation list of the TXSpellChecker.HyphenationLists collection or a list from the default hyphenation lists folder that corresponds to the specified language parameter (second implementation). If there is no hyphenation point before that divide position and the position is less the word length, the method returns 0. For divide positions greater than or equal to the number of word characters, the method returns the word length.

Syntax

GetHyphenationPoint(string, int)

Returns the next hyphenation point for a specific word right before a defined divide position. That point is calculated by using the default hyphenation list.

public int GetHyphenationPoint(string word, int devidePosition);
ParameterDescription
word

The word to hyphenate.

devidePosition

The defined divide position.

GetHyphenationPoint(string, int, CultureInfo)

Returns the next hyphenation point for a specific word right before a defined divide position. That point is calculated by using the hyphenation list that corresponds to the specified language parameter

public int GetHyphenationPoint(string word, int devidePosition, CultureInfo language);
ParameterDescription
word

The word to hyphenate.

devidePosition

The defined divide position.

language

The language, which is used to calculate the hyphenation point. If the TXSpellChecker.HyphenationLists collection does not contain a hyphenation list, where its language does not equal exactly to the defined language parameter, the default hyphenation lists folder is examined for such a list. In case no corresponding list was found, both, first the TXSpellChecker.HyphenationLists collection and finally the default hyphenation lists folder, are examined for a hyphenation list that equals roughly to specified language (e.g. the language parameter stands for English (USA) and the hyphenation list's language property represents English (Great Britain)).

Return Value

The next hyphenation point right before the defined divide position.

Examples

The following example retrieves hyphenation point from the txspell checker.

var result = tXSpellChecker.GetHyphenationPoint("Quarterly report", 100);
Console.WriteLine($"Get Hyphenation Point result: {result}");