public class Hyphenator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log
logging instance
|
Constructor and Description |
---|
Hyphenator(java.lang.String lang,
java.lang.String country,
int leftMin,
int rightMin)
Creates a new hyphenator.
|
Modifier and Type | Method and Description |
---|---|
static HyphenationTree |
getFopHyphenationTree(java.lang.String key)
Returns a hyphenation tree.
|
static HyphenationTree |
getHyphenationTree(java.lang.String lang,
java.lang.String country)
Returns a hyphenation tree for a given language and country.
|
static HyphenationTree |
getHyphenationTree(java.lang.String lang,
java.lang.String country,
HyphenationTreeResolver resolver)
Returns a hyphenation tree for a given language and country.
|
static HyphenationTreeCache |
getHyphenationTreeCache() |
static HyphenationTree |
getUserHyphenationTree(java.lang.String key,
HyphenationTreeResolver resolver)
Load tree from serialized file or xml file
using configuration settings
|
static HyphenationTree |
getUserHyphenationTree(java.lang.String key,
java.lang.String hyphenDir)
Load tree from serialized file or xml file
using configuration settings
|
Hyphenation |
hyphenate(char[] word,
int offset,
int len)
Hyphenates a word.
|
Hyphenation |
hyphenate(java.lang.String word)
Hyphenates a word.
|
static Hyphenation |
hyphenate(java.lang.String lang,
java.lang.String country,
char[] word,
int offset,
int len,
int leftMin,
int rightMin)
Hyphenates a word.
|
static Hyphenation |
hyphenate(java.lang.String lang,
java.lang.String country,
HyphenationTreeResolver resolver,
char[] word,
int offset,
int len,
int leftMin,
int rightMin)
Hyphenates a word.
|
static Hyphenation |
hyphenate(java.lang.String lang,
java.lang.String country,
HyphenationTreeResolver resolver,
java.lang.String word,
int leftMin,
int rightMin)
Hyphenates a word.
|
static Hyphenation |
hyphenate(java.lang.String lang,
java.lang.String country,
java.lang.String word,
int leftMin,
int rightMin)
Hyphenates a word.
|
void |
setLanguage(java.lang.String lang,
java.lang.String country)
Sets the language and country for the hyphenation process.
|
void |
setMinPushCharCount(int min)
Sets the minimum number of characters after the hyphenation point
|
void |
setMinRemainCharCount(int min)
Sets the minimum number of characters before the hyphenation point
|
public Hyphenator(java.lang.String lang, java.lang.String country, int leftMin, int rightMin)
lang
- the languagecountry
- the country (may be null or "none")leftMin
- the minimum number of characters before the hyphenation pointrightMin
- the minimum number of characters after the hyphenation pointpublic static HyphenationTreeCache getHyphenationTreeCache()
public static HyphenationTree getHyphenationTree(java.lang.String lang, java.lang.String country)
lang
- the languagecountry
- the country (may be null or "none")public static HyphenationTree getHyphenationTree(java.lang.String lang, java.lang.String country, HyphenationTreeResolver resolver)
lang
- the languagecountry
- the country (may be null or "none")resolver
- resolver to find the hyphenation filespublic static HyphenationTree getFopHyphenationTree(java.lang.String key)
key
- the language/country keypublic static HyphenationTree getUserHyphenationTree(java.lang.String key, java.lang.String hyphenDir)
key
- language key for the requested hyphenation filehyphenDir
- base directory to find hyphenation files inpublic static HyphenationTree getUserHyphenationTree(java.lang.String key, HyphenationTreeResolver resolver)
key
- language key for the requested hyphenation fileresolver
- resolver to find the hyphenation filespublic static Hyphenation hyphenate(java.lang.String lang, java.lang.String country, HyphenationTreeResolver resolver, java.lang.String word, int leftMin, int rightMin)
lang
- the languagecountry
- the optional country code (may be null or "none")resolver
- resolver to find the hyphenation filesword
- 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(java.lang.String lang, java.lang.String country, java.lang.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 static Hyphenation hyphenate(java.lang.String lang, java.lang.String country, HyphenationTreeResolver resolver, char[] word, int offset, int len, int leftMin, int rightMin)
lang
- the languagecountry
- the optional country code (may be null or "none")resolver
- resolver to find the hyphenation filesword
- the word to hyphenateoffset
- the offset of the first character in the "word" character arraylen
- the length of the wordleftMin
- the minimum number of characters before the hyphenation pointrightMin
- the minimum number of characters after the hyphenation pointpublic static Hyphenation hyphenate(java.lang.String lang, java.lang.String country, char[] word, int offset, int len, int leftMin, int rightMin)
lang
- the languagecountry
- the optional country code (may be null or "none")word
- the word to hyphenateoffset
- the offset of the first character in the "word" character arraylen
- the length of the wordleftMin
- the minimum number of characters before the hyphenation pointrightMin
- the minimum number of characters after the hyphenation pointpublic void setMinRemainCharCount(int min)
min
- the number of characterspublic void setMinPushCharCount(int min)
min
- the number of characterspublic void setLanguage(java.lang.String lang, java.lang.String country)
lang
- the languagecountry
- the country (may be null or "none")public Hyphenation hyphenate(char[] word, int offset, int len)
word
- the word to hyphenateoffset
- the offset of the first character in the "word" character arraylen
- the length of the wordpublic Hyphenation hyphenate(java.lang.String word)
word
- the word to hyphenateCopyright 1999-2010 The Apache Software Foundation. All Rights Reserved.