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
stringthe language
country
stringthe optional country code (may be null or "none")
leftMin
intthe minimum number of characters before the hyphenation point
rightMin
intthe 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
stringthe language
country
stringthe optional country code (may be null or "none")
leftMin
intthe minimum number of characters before the hyphenation point
rightMin
intthe 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
lang
protected string lang
Field Value
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
Streamthe input stream to load the tree from
name
stringunique 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
stringthe directory to search the file into
key
stringlanguage 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
stringthe language
country
stringthe 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
stringthe language
country
stringthe 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
stringthe 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
stringthe language
country
stringthe optional country code (may be null or "none")
hyphPathNames
IDictionary<string, string>the map with user-configured hyphenation pattern file names
word
stringthe word to hyphenate
leftMin
intthe minimum number of characters before the hyphenation point
rightMin
intthe 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
stringthe language
country
stringthe optional country code (may be null or "none")
word
stringthe word to hyphenate
leftMin
intthe minimum number of characters before the hyphenation point
rightMin
intthe 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
stringdirectory to register