|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.extex.language.hyphenation.base.BaseHyphenationTable
public class BaseHyphenationTable
This class stores the values for hyphenations and hyphenates words.
| Field Summary | |
|---|---|
protected static long |
serialVersionUID
The constant serialVersionUID contains the id for serialization. |
| Constructor Summary | |
|---|---|
BaseHyphenationTable()
Creates a new object. |
|
| Method Summary | |
|---|---|
void |
addHyphenation(UnicodeCharList word,
TypesetterOptions options)
Add a user-defined hyphenation. |
void |
addPattern(Tokens pattern)
Add a pattern to the hyphenation table. |
protected static boolean[] |
createHyphenation(UnicodeCharList pattern,
TypesetterOptions context,
UnicodeCharList key)
Create the name for the HyphenationTable. |
int |
findWord(NodeList nodes,
int start,
UnicodeCharList word)
Extract a word from a node list. |
long |
getLeftHyphenMin()
Return the value for the minimum number of characters before a hyphenation on the left hand side of a word. |
UnicodeChar |
getLigature(UnicodeChar c1,
UnicodeChar c2,
Font f)
Get a single ligature of to characters. |
java.lang.String |
getName()
Getter for the name. |
long |
getRightHyphenMin()
Return the value for the minimum number of characters before a hyphenation on the right hand side of a word. |
boolean |
hyphenate(NodeList nodes,
TypesetterOptions context,
UnicodeChar hyphen,
int start,
boolean forall,
NodeFactory nodeFactory)
Insert the hyphenation marks for a horizontal list of nodes. |
boolean |
hyphenateOne(NodeList nodes,
TypesetterOptions context,
int start,
UnicodeCharList word,
CharNode hyphenNode)
Hyphenate a single word. |
int |
insertLigatures(NodeList list,
int start)
Take a node list and transform character sequences into ligatures where appropriate. |
void |
insertShy(NodeList nodes,
int insertionPoint,
boolean[] spec,
CharNode hyphenNode)
Insert hyphenation points into a list of nodes. |
boolean |
isHyphenating()
Return true, if hyphenation is active,
otherwise false; |
UnicodeCharList |
normalize(UnicodeCharList word,
TypesetterOptions options)
Normalize a word for the lookup. |
protected java.lang.Object |
readResolve()
Magic method for deserialization. |
void |
setHyphenating(boolean active)
Activate or deactivate the hyphenation for this language. |
void |
setLeftHyphenMin(long left)
Set the value for the minimum number of characters before a hyphenation on the left hand side of a word. |
void |
setLigatureBuilder(LigatureBuilder builder)
Setter for the ligature builder. |
void |
setName(java.lang.String name)
Setter for the name. |
void |
setRightHyphenMin(long right)
Set the value for the minimum number of characters before a hyphenation on the right hand side of a word. |
void |
setWordTokenizer(WordTokenizer wordTokenizer)
Setter for the word tokenizer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final long serialVersionUID
| Constructor Detail |
|---|
public BaseHyphenationTable()
| Method Detail |
|---|
protected static boolean[] createHyphenation(UnicodeCharList pattern,
TypesetterOptions context,
UnicodeCharList key)
HyphenationTable.
pattern - the patterncontext - the interpreter contextkey - the container to store the key in
public void addHyphenation(UnicodeCharList word,
TypesetterOptions options)
throws HyphenationException
The hyphenation template consists of a word of characters. The Unicode soft hyphenation character has a special meaning. This character is used to indicate places where a hyphenation is permitted. The other characters – i.e. normal Unicode characters – are used as-is.
addHyphenation in interface Hyphenatorword - the word with the hyphenation marksoptions - the interpreter context
HyphenationException - in case of an errorHyphenator.addHyphenation(
org.extex.core.UnicodeCharList,
org.extex.typesetter.TypesetterOptions)
public void addPattern(Tokens pattern)
throws HyphenationException
addPattern in interface Hyphenatorpattern - the pattern word with numbers
HyphenationException - in case of an errorHyphenator.addPattern(
Tokens)
public int findWord(NodeList nodes,
int start,
UnicodeCharList word)
throws HyphenationException
findWord in interface WordTokenizernodes - the nodes to extract the word fromstart - the start indexword - the target list for the letters of the word
HyphenationException - in case of an errorWordTokenizer.findWord(
org.extex.typesetter.type.NodeList,
int,
org.extex.core.UnicodeCharList)
public long getLeftHyphenMin()
throws HyphenationException
getLeftHyphenMin in interface HyphenatorHyphenationException - in case of an errorHyphenator.getLeftHyphenMin()
public UnicodeChar getLigature(UnicodeChar c1,
UnicodeChar c2,
Font f)
throws HyphenationException
getLigature in interface LigatureBuilderc1 - the first characterc2 - the second characterf - the current font
null if none exists
HyphenationException - in case of an errorLigatureBuilder.getLigature(
org.extex.core.UnicodeChar,
org.extex.core.UnicodeChar,
org.extex.typesetter.tc.font.Font)public java.lang.String getName()
getName in interface LanguageLanguage.getName()
public long getRightHyphenMin()
throws HyphenationException
getRightHyphenMin in interface HyphenatorHyphenationException - in case of an errorHyphenator.getRightHyphenMin()
public boolean hyphenate(NodeList nodes,
TypesetterOptions context,
UnicodeChar hyphen,
int start,
boolean forall,
NodeFactory nodeFactory)
throws HyphenationException
hyphenate in interface Hyphenatornodes - the horizontal node listcontext - the contexthyphen - the tokens to be inserted for hyphensstart - the start indexforall - the indicator that all words to the end should be
processed. if false then only the next word is hyphenated.nodeFactory - the node factory
true iff the hyphenator is responsible for this
word. Usually this means that some hyphenation marks have been inserted.
HyphenationException - in case of an errorHyphenator.hyphenate(
org.extex.typesetter.type.NodeList,
org.extex.typesetter.TypesetterOptions,
org.extex.core.UnicodeChar,
int,
boolean,
org.extex.typesetter.type.node.factory.NodeFactory)
public boolean hyphenateOne(NodeList nodes,
TypesetterOptions context,
int start,
UnicodeCharList word,
CharNode hyphenNode)
throws HyphenationException
nodes - the node list to considercontext - the options to usestart - the start index in the nodesword - the word to hyphenatehyphenNode - the node to use as hyphen
true iff the the word has been found
HyphenationException - in case of an error
public int insertLigatures(NodeList list,
int start)
throws HyphenationException
insertLigatures in interface LigatureBuilderlist - the node list to create ligatures forstart - the index in the list to start processing
HyphenationException - in case of an errorLigatureBuilder.insertLigatures(
org.extex.typesetter.type.NodeList, int)
public void insertShy(NodeList nodes,
int insertionPoint,
boolean[] spec,
CharNode hyphenNode)
throws HyphenationException
insertShy in interface WordTokenizernodes - the node list to modifyinsertionPoint - the index to insert something into the nodesspec - the specification where to insert hyphenation marks.
If spec[i] is true then a hyphen needs to be
inserted before the ith character at or after insertionPoint
in nodeshyphenNode - the hyphen as node
HyphenationException - in case of an errorWordTokenizer.insertShy(
org.extex.typesetter.type.NodeList,
int,
boolean[],
org.extex.typesetter.type.node.CharNode)
public boolean isHyphenating()
throws HyphenationException
true, if hyphenation is active,
otherwise false;
isHyphenating in interface Hyphenatortrue iff the hyphenation for this language is
enabled
HyphenationException - in case of an errorHyphenator.isHyphenating()
public UnicodeCharList normalize(UnicodeCharList word,
TypesetterOptions options)
throws HyphenationException
normalize in interface WordTokenizerword - the word to normalizeoptions - the options to use
HyphenationException - in case of an errorWordTokenizer.normalize(
org.extex.core.UnicodeCharList,
org.extex.typesetter.TypesetterOptions)
protected java.lang.Object readResolve()
throws java.io.ObjectStreamException
java.io.ObjectStreamException - in case of an error
public void setHyphenating(boolean active)
throws HyphenationException
setHyphenating in interface Hyphenatoractive - the indicator that the hyphenation is activated
HyphenationException - in case of an errorHyphenator.setHyphenating(boolean)
public void setLeftHyphenMin(long left)
throws HyphenationException
setLeftHyphenMin in interface Hyphenatorleft - the new value
HyphenationException - in case of an errorHyphenator.setLeftHyphenMin(long)public void setLigatureBuilder(LigatureBuilder builder)
setLigatureBuilder in interface ModifiableLanguagebuilder - the ligature builderModifiableLanguage.setLigatureBuilder(
org.extex.language.ligature.LigatureBuilder)public void setName(java.lang.String name)
setName in interface Languagename - the nameLanguage.setName(java.lang.String)
public void setRightHyphenMin(long right)
throws HyphenationException
setRightHyphenMin in interface Hyphenatorright - the new value
HyphenationException - in case of an errorHyphenator.setRightHyphenMin(long)public void setWordTokenizer(WordTokenizer wordTokenizer)
setWordTokenizer in interface ModifiableLanguagewordTokenizer - the word tokenizerModifiableLanguage.setWordTokenizer(
org.extex.language.word.WordTokenizer)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||