## org.extex.language.hyphenation Interface Hyphenator

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
Language, ManagedLanguage, ModifiableLanguage
All Known Implementing Classes:
BaseHyphenationTable, CompressedLiangsHyphenationTable, FutureLanguage, LiangsHyphenationTable

`public interface Hyphenatorextends java.io.Serializable`

Interface for the `HyphenationTable`.

In the table the hyphenation patterns (see `\patterns` and the user hyphenations (see `\hyphenation`) are stored.

Version:
\$Revision: 4737 \$
Author:
Gerd Neugebauer, Michael Niedermair

Method Summary
` void` ```addHyphenation(UnicodeCharList word, TypesetterOptions context)```
` void` `addPattern(Tokens pattern)`
Add a pattern to the hyphenation table.
` long` `getLeftHyphenMin()`
Return the value for the minimum number of characters before a hyphenation on the left hand side of a word.
` 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 nodelist, TypesetterOptions context, UnicodeChar hyphen, int start, boolean forall, NodeFactory nodeFactory)```
Insert the hyphenation marks for a horizontal list of nodes.
` boolean` `isHyphenating()`
Return `true`, if hyphenation is active, otherwise `false`;
` 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` `setRightHyphenMin(long right)`
Set the value for the minimum number of characters before a hyphenation on the right hand side of a word.

Method Detail

```void addHyphenation(UnicodeCharList word,
TypesetterOptions context)
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.

Parameters:
`word` - the word with the hyphenation marks
`context` - the interpreter context
Throws:
`HyphenationException` - in case of an error

```void addPattern(Tokens pattern)
throws HyphenationException```
Add a pattern to the hyphenation table.

Parameters:
`pattern` - the pattern word with numbers
Throws:
`HyphenationException` - in case of an error

### getLeftHyphenMin

```long getLeftHyphenMin()
throws HyphenationException```
Return the value for the minimum number of characters before a hyphenation on the left hand side of a word.

Returns:
the value \lefthyphenmin
Throws:
`HyphenationException` - in case of an error

### getRightHyphenMin

```long getRightHyphenMin()
throws HyphenationException```
Return the value for the minimum number of characters before a hyphenation on the right hand side of a word.

Returns:
the value \righthyphenmin
Throws:
`HyphenationException` - in case of an error

### hyphenate

```boolean hyphenate(NodeList nodelist,
TypesetterOptions context,
UnicodeChar hyphen,
int start,
boolean forall,
NodeFactory nodeFactory)
throws HyphenationException```
Insert the hyphenation marks for a horizontal list of nodes. The hyphenation marks are made up of discretionary nodes.

Parameters:
`nodelist` - the horizontal node list
`context` - the context
`hyphen` - the tokens to be inserted for hyphens
`start` - the start index
`forall` - the indicator that all words to the end should be processed. if `false` then only the next word is hyphenated.
`nodeFactory` - the node factory
Returns:
`true` iff the hyphenator is responsible for this word. Usually this means that some hyphenation marks have been inserted.
Throws:
`HyphenationException` - in case of an error

### isHyphenating

```boolean isHyphenating()
throws HyphenationException```
Return `true`, if hyphenation is active, otherwise `false`;

Returns:
`true` iff the hyphenation for this language is enabled
Throws:
`HyphenationException` - in case of an error

### setHyphenating

```void setHyphenating(boolean active)
throws HyphenationException```
Activate or deactivate the hyphenation for this language. If the hyphenation is deactivated then no hyphenation should be added automatically.

Parameters:
`active` - the indicator that the hyphenation is activated
Throws:
`HyphenationException` - in case of an error

### setLeftHyphenMin

```void setLeftHyphenMin(long left)
throws HyphenationException```
Set the value for the minimum number of characters before a hyphenation on the left hand side of a word.

Parameters:
`left` - the new value
Throws:
`HyphenationException` - in case of an error

### setRightHyphenMin

```void setRightHyphenMin(long right)
throws HyphenationException```
Set the value for the minimum number of characters before a hyphenation on the right hand side of a word.

Parameters:
`right` - the new value
Throws:
`HyphenationException` - in case of an error