de.dante.extex.language.word.impl
Class ExTeXWords

java.lang.Object
  extended byde.dante.extex.language.word.impl.ExTeXWords
All Implemented Interfaces:
java.io.Serializable, WordTokenizer
Direct Known Subclasses:
TeXWords

public class ExTeXWords
extends java.lang.Object
implements WordTokenizer

This class tokenizes a list of nodes according to the rules of ExTeX.

Version:
$Revision: 1.6 $
Author:
Gerd Neugebauer
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
ExTeXWords()
          Creates a new object.
 
Method Summary
 int findWord(NodeList nodes, int start, UnicodeCharList word)
          Extract a word from a node list.
 void insertShy(NodeList nodes, int insertionPoint, boolean[] spec, CharNode hyphenNode)
          Insert hyphenation points into a list of nodes.
 UnicodeCharList normalize(UnicodeCharList word, TypesetterOptions options)
          Normalize a word for the lookup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
The constant serialVersionUID contains the id for serialization.

See Also:
Constant Field Values
Constructor Detail

ExTeXWords

public ExTeXWords()
Creates a new object.

Method Detail

findWord

public int findWord(NodeList nodes,
                    int start,
                    UnicodeCharList word)
             throws HyphenationException
Description copied from interface: WordTokenizer
Extract a word from a node list.

Specified by:
findWord in interface WordTokenizer
Parameters:
nodes - the nodes to extract the word from
start - the start index
word - the target list for the letters of the word
Returns:
the index of the first node beyond the word
Throws:
HyphenationException - in case of an error
See Also:
WordTokenizer.findWord( de.dante.extex.typesetter.type.NodeList, int, de.dante.util.UnicodeCharList)

insertShy

public void insertShy(NodeList nodes,
                      int insertionPoint,
                      boolean[] spec,
                      CharNode hyphenNode)
               throws HyphenationException
Description copied from interface: WordTokenizer
Insert hyphenation points into a list of nodes.

Specified by:
insertShy in interface WordTokenizer
Parameters:
nodes - the node list to modify
insertionPoint - the index to insert something into the nodes
spec - 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 nodes
hyphenNode - the hyphen as node
Throws:
HyphenationException - in case of an error
See Also:
WordTokenizer.insertShy( de.dante.extex.typesetter.type.NodeList, int, boolean[], de.dante.extex.typesetter.type.node.CharNode)

normalize

public UnicodeCharList normalize(UnicodeCharList word,
                                 TypesetterOptions options)
                          throws HyphenationException
Description copied from interface: WordTokenizer
Normalize a word for the lookup.

Specified by:
normalize in interface WordTokenizer
Parameters:
word - the word to normalize
options - the options to use
Returns:
the normalized word
Throws:
HyphenationException - in case of an error
See Also:
WordTokenizer.normalize( de.dante.util.UnicodeCharList, de.dante.extex.typesetter.TypesetterOptions)