Package snap.text
Class TextHyphenDict
java.lang.Object
snap.text.TextHyphenDict
Module to load and process an OpenOffice.org-style hyphenation dictionary.
This module is essentially a translation into Java of C code developed
for OpenOffice.org by Peter Novodvorsky, which was in turn based on
Raph Levien's linhnj, which was in turn based on Knuth's TeX algorithm.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getHyphen
(CharSequence anInput, int aStart, int anEnd) Returns the hyphen just prior to line end given chars, start index, chars end and line end.int
int[]
getHyphens
(String aWord) getHyphensBuffer
(String aWord) Perform hyphenation on a word.static TextHyphenDict
Return the shared instance of the HyphenDict.
-
Constructor Details
-
TextHyphenDict
public TextHyphenDict()Create an instance based on the given filename. Reads and parses the given file into internal storage.
-
-
Method Details
-
getHyphen
Returns the hyphen just prior to line end given chars, start index, chars end and line end. -
getHyphen
-
getHyphens
-
getHyphensBuffer
Perform hyphenation on a word. Fills in the word's hyphenationPositions array.