Table of Contents

Class Hyphenator

Namespace
iText.Layout.Hyphenation
Assembly
itext.layout.dll

This class is the main entry point to the hyphenation package.

public sealed class Hyphenator
Inheritance
Hyphenator
Inherited Members

Remarks

This class is the main entry point to the hyphenation package. You can use only the static methods or create an instance.

This work was authored by Carlos Villegas (cav@uniscope.co.jp).

Constructors

Hyphenator(string, string, int, int)

Creates a new hyphenator.

public Hyphenator(string lang, string country, int leftMin, int rightMin)

Parameters

lang string

the language

country string

the optional country code (may be null or "none")

leftMin int

the minimum number of characters before the hyphenation point

rightMin int

the minimum number of characters after the hyphenation point

Hyphenator(string, string, int, int, IDictionary<string, string>)

Creates a new hyphenator.

public Hyphenator(string lang, string country, int leftMin, int rightMin, IDictionary<string, string> hyphPathNames)

Parameters

lang string

the language

country string

the optional country code (may be null or "none")

leftMin int

the minimum number of characters before the hyphenation point

rightMin int

the minimum number of characters after the hyphenation point

hyphPathNames IDictionary<string, string>

the map with user-configured hyphenation pattern file names

Fields

country

protected string country

Field Value

string

lang

protected string lang

Field Value

string

Methods

ClearHyphenationTreeCache()

Clears the default hyphenation tree cache.

public static void ClearHyphenationTreeCache()

Remarks

Clears the default hyphenation tree cache. This method can be used if the underlying data files are changed at runtime.

GetHyphenationTree(Stream, string)

Load tree from the stream.

public static HyphenationTree GetHyphenationTree(Stream @in, string name)

Parameters

in Stream

the input stream to load the tree from

name string

unique key representing country-language combination

Returns

HyphenationTree

the requested HyphenationTree or null if it is not available

GetHyphenationTree(string, string)

Load tree from xml file using configuration settings.

public static HyphenationTree GetHyphenationTree(string searchDirectory, string key)

Parameters

searchDirectory string

the directory to search the file into

key string

language key for the requested hyphenation file

Returns

HyphenationTree

the requested HyphenationTree or null if it is not available

GetHyphenationTree(string, string, IDictionary<string, string>)

Returns a hyphenation tree for a given language and country, with fallback from (lang,country) to (lang).

public static HyphenationTree GetHyphenationTree(string lang, string country, IDictionary<string, string> hyphPathNames)

Parameters

lang string

the language

country string

the country (may be null or "none")

hyphPathNames IDictionary<string, string>

the map with user-configured hyphenation pattern file names

Returns

HyphenationTree

the hyphenation tree

Remarks

Returns a hyphenation tree for a given language and country, with fallback from (lang,country) to (lang). The hyphenation trees are cached.

GetHyphenationTree2(string, string, IDictionary<string, string>)

Returns a hyphenation tree for a given language and country.

public static HyphenationTree GetHyphenationTree2(string lang, string country, IDictionary<string, string> hyphPathNames)

Parameters

lang string

the language

country string

the country (may be null or "none")

hyphPathNames IDictionary<string, string>

the map with user-configured hyphenation pattern file names

Returns

HyphenationTree

the hyphenation tree

Remarks

Returns a hyphenation tree for a given language and country. The hyphenation trees are cached.

GetHyphenationTreeCache()

Returns the default hyphenation tree cache.

public static HyphenationTreeCache GetHyphenationTreeCache()

Returns

HyphenationTreeCache

the default (static) hyphenation tree cache

Hyphenate(string)

Hyphenates a word.

public Hyphenation Hyphenate(string word)

Parameters

word string

the word to hyphenate

Returns

Hyphenation

the hyphenation result

Hyphenate(string, string, IDictionary<string, string>, string, int, int)

Hyphenates a word.

public static Hyphenation Hyphenate(string lang, string country, IDictionary<string, string> hyphPathNames, string word, int leftMin, int rightMin)

Parameters

lang string

the language

country string

the optional country code (may be null or "none")

hyphPathNames IDictionary<string, string>

the map with user-configured hyphenation pattern file names

word string

the word to hyphenate

leftMin int

the minimum number of characters before the hyphenation point

rightMin int

the minimum number of characters after the hyphenation point

Returns

Hyphenation

the hyphenation result

Hyphenate(string, string, string, int, int)

Hyphenates a word.

public static Hyphenation Hyphenate(string lang, string country, string word, int leftMin, int rightMin)

Parameters

lang string

the language

country string

the optional country code (may be null or "none")

word string

the word to hyphenate

leftMin int

the minimum number of characters before the hyphenation point

rightMin int

the minimum number of characters after the hyphenation point

Returns

Hyphenation

the hyphenation result

RegisterAdditionalHyphenationFileDirectory(string)

Registers additional file directories.

public static void RegisterAdditionalHyphenationFileDirectory(string directory)

Parameters

directory string

directory to register