HyphenatorOptions Class

Specifies how a Hyphenator is loaded and where it allows a word to break.

public sealed class HyphenatorOptions

Remarks

The limits protect the caller from pattern files that come from an untrusted source: a file that exceeds one is rejected before memory is allocated for it.

Constructors

NameDescription
HyphenatorOptions()

HyphenatorOptions()

HyphenatorOptions.cs
public HyphenatorOptions()

No documentation is available.

Properties

NameDescription
DefaultGets the default options.
LeftHyphenMinGets the smallest number of characters before the first break of a word. The default is 2.
MaxInputLengthGets the greatest length of the patterns, and of the exceptions, in UTF-16 code units or in UTF-8 bytes. The default is 8 MiB.
MaxPatternCountGets the greatest number of patterns, and of exceptions, a hyphenator accepts. The default is 250,000.
MaxPatternLengthGets the greatest number of letters of a pattern or of an exception. The default is 64.
MaxWordLengthGets the greatest length, in UTF-16 code units, of a word that is hyphenated: a longer word has no break. The default is 255.
RightHyphenMinGets the smallest number of characters after the last break of a word. The default is 3.

Gets the default options.

public static HyphenatorOptions Default { get; }

Property value

HyphenatorOptions

Gets the smallest number of characters before the first break of a word. The default is 2.

public int LeftHyphenMin { get; init; }

Property value

int

Exceptions

ArgumentOutOfRangeException
The value is less than 1.

Remarks

The value depends on the language; it is the \lefthyphenmin of TeX. A character is an extended grapheme cluster.

MaxInputLength

HyphenatorOptions.cs

Gets the greatest length of the patterns, and of the exceptions, in UTF-16 code units or in UTF-8 bytes. The default is 8 MiB.

public long MaxInputLength { get; init; }

Property value

long

Exceptions

ArgumentOutOfRangeException
The value is less than 1.

MaxPatternCount

HyphenatorOptions.cs

Gets the greatest number of patterns, and of exceptions, a hyphenator accepts. The default is 250,000.

public int MaxPatternCount { get; init; }

Property value

int

Exceptions

ArgumentOutOfRangeException
The value is less than 1.

MaxPatternLength

HyphenatorOptions.cs

Gets the greatest number of letters of a pattern or of an exception. The default is 64.

public int MaxPatternLength { get; init; }

Property value

int

Exceptions

ArgumentOutOfRangeException
The value is less than 1 or greater than 255.

Gets the greatest length, in UTF-16 code units, of a word that is hyphenated: a longer word has no break. The default is 255.

public int MaxWordLength { get; init; }

Property value

int

Exceptions

ArgumentOutOfRangeException
The value is less than 1 or greater than 4096.

RightHyphenMin

HyphenatorOptions.cs

Gets the smallest number of characters after the last break of a word. The default is 3.

public int RightHyphenMin { get; init; }

Property value

int

Exceptions

ArgumentOutOfRangeException
The value is less than 1.

Remarks

The value depends on the language; it is the \righthyphenmin of TeX. A character is an extended grapheme cluster.