public class HyphenatorImpl extends AbstractHyphenator
Hyphenator
interface. It uses a list of rules to
determine hyphenation-points.Modifier and Type | Field and Description |
---|---|
private Map<String,HyphenationImpl> |
exceptionMap
The
Map with explicit exceptions. |
private StringHasher |
hasher |
private int |
maxPatternLength
The maximum length of the
patterns . |
private HyphenationPattern[] |
patterns
The
patterns . |
private StringUtil |
stringUtil |
Constructor and Description |
---|
HyphenatorImpl(Locale locale,
char hyphen,
List<String> patternList,
List<String> exceptionList,
StringHasher hasher,
StringUtil stringUtil)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
Hyphenation |
hyphenate(String word) |
protected String |
normalize(String word)
This method normalizes the given
word . |
private static HyphenationPattern[] |
sortPatterns(HyphenationPattern[] patternArray)
|
String |
toString() |
getHyphen, getLocale, hyphenate, hyphenate
createLogger, doInitialize, getLogger
doInitialized, getInitializationState, initialize
private final Map<String,HyphenationImpl> exceptionMap
Map
with explicit exceptions.private final HyphenationPattern[] patterns
patterns
.private final int maxPatternLength
patterns
.private final StringHasher hasher
private final StringUtil stringUtil
public HyphenatorImpl(Locale locale, char hyphen, List<String> patternList, List<String> exceptionList, StringHasher hasher, StringUtil stringUtil)
locale
- is the locale
.hyphen
- is the hyphen-character
.patternList
- is the List
of patterns
.exceptionList
- is the list of pre-hyphenated exceptions (e.g. "as-so-ciate").hasher
- is the hash-algorithm
. It should be fast.stringUtil
- is the StringUtil
to use.private static HyphenationPattern[] sortPatterns(HyphenationPattern[] patternArray)
protected String normalize(String word)
word
.word
- is the word to normalize.word
.public Hyphenation hyphenate(String word)
word
- is the word to hyphenate.Hyphenation
for the given word.Hyphenator.hyphenate(String, int, int)
Copyright © 2001–2016 mmm-Team. All rights reserved.