public final class Hyphenator extends Object
This work was authored by Carlos Villegas (cav@uniscope.co.jp).
| Modifier and Type | Field and Description |
|---|---|
protected String |
country |
protected String |
lang |
| Constructor and Description |
|---|
Hyphenator(String lang,
String country,
int leftMin,
int rightMin)
Creates a new hyphenator.
|
Hyphenator(String lang,
String country,
int leftMin,
int rightMin,
Map<String,String> hyphPathNames)
Creates a new hyphenator.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
clearHyphenationTreeCache()
Clears the default hyphenation tree cache.
|
static HyphenationTree |
getHyphenationTree(InputStream in,
String name)
Load tree from the stream.
|
static HyphenationTree |
getHyphenationTree(String searchDirectory,
String key)
Load tree from xml file using configuration settings.
|
static HyphenationTree |
getHyphenationTree(String lang,
String country,
Map<String,String> hyphPathNames)
Returns a hyphenation tree for a given language and country,
with fallback from (lang,country) to (lang).
|
static HyphenationTree |
getHyphenationTree2(String lang,
String country,
Map<String,String> hyphPathNames)
Returns a hyphenation tree for a given language and country.
|
static HyphenationTreeCache |
getHyphenationTreeCache()
Returns the default hyphenation tree cache.
|
Hyphenation |
hyphenate(String word)
Hyphenates a word.
|
static Hyphenation |
hyphenate(String lang,
String country,
Map<String,String> hyphPathNames,
String word,
int leftMin,
int rightMin)
Hyphenates a word.
|
static Hyphenation |
hyphenate(String lang,
String country,
String word,
int leftMin,
int rightMin)
Hyphenates a word.
|
static void |
registerAdditionalHyphenationFileDirectory(String directory)
Registers additional file directories.
|
public Hyphenator(String lang, String country, int leftMin, int rightMin)
lang - the languagecountry - the optional country code (may be null or "none")leftMin - the minimum number of characters before the hyphenation pointrightMin - the minimum number of characters after the hyphenation pointpublic Hyphenator(String lang, String country, int leftMin, int rightMin, Map<String,String> hyphPathNames)
lang - the languagecountry - the optional country code (may be null or "none")hyphPathNames - the map with user-configured hyphenation pattern file namesleftMin - the minimum number of characters before the hyphenation pointrightMin - the minimum number of characters after the hyphenation pointpublic static void registerAdditionalHyphenationFileDirectory(String directory)
directory - directory to registerpublic static HyphenationTreeCache getHyphenationTreeCache()
public static void clearHyphenationTreeCache()
public static HyphenationTree getHyphenationTree(String lang, String country, Map<String,String> hyphPathNames)
lang - the languagecountry - the country (may be null or "none")hyphPathNames - the map with user-configured hyphenation pattern file namespublic static HyphenationTree getHyphenationTree2(String lang, String country, Map<String,String> hyphPathNames)
lang - the languagecountry - the country (may be null or "none")hyphPathNames - the map with user-configured hyphenation pattern file namespublic static HyphenationTree getHyphenationTree(String searchDirectory, String key)
searchDirectory - the directory to search the file intokey - language key for the requested hyphenation filepublic static HyphenationTree getHyphenationTree(InputStream in, String name)
in - the input stream to load the tree fromname - unique key representing country-language combinationpublic static Hyphenation hyphenate(String lang, String country, Map<String,String> hyphPathNames, String word, int leftMin, int rightMin)
lang - the languagecountry - the optional country code (may be null or "none")hyphPathNames - the map with user-configured hyphenation pattern file namesword - the word to hyphenateleftMin - the minimum number of characters before the hyphenation pointrightMin - the minimum number of characters after the hyphenation pointpublic static Hyphenation hyphenate(String lang, String country, String word, int leftMin, int rightMin)
lang - the languagecountry - the optional country code (may be null or "none")word - the word to hyphenateleftMin - the minimum number of characters before the hyphenation pointrightMin - the minimum number of characters after the hyphenation pointpublic Hyphenation hyphenate(String word)
word - the word to hyphenateCopyright © 1998–2020 iText Group NV. All rights reserved.