|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object au.id.pbw.hyfo.hyph.HyphenationTree
public class HyphenationTree
Represents a tree of hyphenation data and associated structures.
The tree itself is an instance of a ShortTernaryTree
.
Associated with it is an Alphabet
, defining the canonical character
set and equivalents, and another ShortTernaryTree
of
hyphenation exceptions.
These structures are derived from an input file of hyphenation data. This
is an XML file conforming to hyph/hyphenation.dtd
in the
HYFo tree. The data in the hyphenation files is taken from
various TeX hyphenation files. The character set of all hyphenation files
is UTF-8.
Constructor Summary | |
---|---|
HyphenationTree(Alphabet alphabet,
TernaryTree exceptions,
HyphenDataCache exception_data,
TernaryTree patterns,
HyphenDataCache pattern_data)
Creates a new instance of HyphenationTree, from a set of components which have been constructed by processing a hyphenation pattern file. |
Method Summary | |
---|---|
static HyphenationTree |
deserialize_tree(String id)
Deserializes a HyphenationTree , given an id, normally
a language or language_country specifier, by which a serialized tree
can be identified. |
void |
dump_exceptions(PrintStream stream)
Formats and dumps the contents of the exceptions tree to the nominated PrintStream . |
void |
dump_patterns(PrintStream stream)
Formats and dumps the contents of the patterns tree to the nominated PrintStream . |
void |
dump_ternary_tree(TernaryTree tree,
HyphenDataCache data_cache,
PrintStream stream)
Formats and dumps the contents of the nominated tree to the nominated PrintStream . |
String |
format_data(HyphenBreak[] breaks)
Formats an array of HyphenBreak s into a display string. |
String |
format_key(int[] key)
Format the given key, represented as an array of codepoints, into a string. |
HyphenatedWord |
hyphenate(String word)
Gets the hyphenation data for the given word as a HyphenatedWord . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HyphenationTree(Alphabet alphabet, TernaryTree exceptions, HyphenDataCache exception_data, TernaryTree patterns, HyphenDataCache pattern_data)
exception_data
- a implementation of TernaryTreeDataStore
containing the
exception tree data.pattern_data
- a implementation of TernaryTreeDataStore
containing the
pattern tree data.alphabet
- an instance of the Alphabet
used by this tree.exceptions
- the ternary tree of exceptions defined in this tree.patterns
- the ternary tree of patterns defined in this tree.Method Detail |
---|
public HyphenatedWord hyphenate(String word)
HyphenatedWord
.
word
- the word to hyphenate.
WHyphenatedWord/CODE> containing the hyphenation data
for the word.
public String format_data(HyphenBreak[] breaks)
HyphenBreak
s into a display string.
breaks
- the array of HyphenBreak
s.
HyphenBreak
s.public void dump_exceptions(PrintStream stream)
PrintStream
.
stream
- the stream to which to dump the tree.public void dump_patterns(PrintStream stream)
PrintStream
.
stream
- the stream to which to dump the tree.public void dump_ternary_tree(TernaryTree tree, HyphenDataCache data_cache, PrintStream stream)
PrintStream
.
tree
- the tree to dump.data_cache
- the implementation of TernaryTreeDataStore
from
which tree data may be retrieved and formatted.stream
- the stream to which to dump the tree.public String format_key(int[] key)
key
- the key as an array of codepoints.
public static HyphenationTree deserialize_tree(String id) throws HyphenationException, IOException
HyphenationTree
, given an id, normally
a language or language_country specifier, by which a serialized tree
can be identified.
id
- the id of the serialized tree.
HyphenationTree
.
HyphenationException
- if the resource cannot be located, or is not a valid class.
IOException
- if an IO error occurs during deserialization.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |