|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.component.base.AbstractComponent
net.sf.mmm.util.component.base.AbstractLoggableComponent
net.sf.mmm.util.text.base.AbstractHyphenator
net.sf.mmm.util.text.base.HyphenatorImpl
public class HyphenatorImpl
This is the implementation of the Hyphenator
interface. It uses a list of rules to determine hyphenation-points.
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
HyphenatorImpl(Locale locale,
char hyphen,
List<String> patternList,
List<String> exceptionList,
StringHasher hasher,
StringUtil stringUtil)
The constructor. |
|
| Method Summary | |
|---|---|
Hyphenation |
hyphenate(String word)
|
protected String |
normalize(String word)
This method normalizes the given word. |
private static HyphenationPattern[] |
sortPatterns(HyphenationPattern[] patternArray)
This method sorts the given patterns according
to the length of their
word-part. |
String |
toString()
|
| Methods inherited from class net.sf.mmm.util.text.base.AbstractHyphenator |
|---|
getHyphen, getLocale, hyphenate, hyphenate |
| Methods inherited from class net.sf.mmm.util.component.base.AbstractLoggableComponent |
|---|
doInitialize, getLogger, setLogger |
| Methods inherited from class net.sf.mmm.util.component.base.AbstractComponent |
|---|
doInitialized, getInitializationState, initialize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final Map<String,HyphenationImpl> exceptionMap
Map with explicit exceptions.
private final HyphenationPattern[] patterns
patterns.
private final int maxPatternLength
patterns.
private final StringHasher hasher
StringHasherprivate final StringUtil stringUtil
StringUtil| Constructor Detail |
|---|
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.| Method Detail |
|---|
private static HyphenationPattern[] sortPatterns(HyphenationPattern[] patternArray)
patterns according
to the length of their
word-part.
patternArray - are the unsorted patterns.
patterns.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)public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||