This class implements word-hyphenation
Word-hyphenation is implemented on the basis of the algorithms developed by Franklin Mark Liang for LaTeX as described in his dissertation at the department of computer science at stanford university.
This package is based on an idea of Mathias Nater<mnater@mac.com> who implemented this word-hyphenation-algorithm for javascript.
Hyphenating means in this case, that all possible hypheantions in a word are marked using the soft-hyphen character (ASCII-Caracter 173) or any other character set via the setHyphen() method.
A complete text will first be divided into words via a regular expression that takes all characters that the \w-Special-Character specifies as well as the '@'-Character and possible other - language-specific - characters that can be set via the setSpecialChars() method.
Hyphenation is done using a set of files taken from a current TeX-Distribution that are matched using the method getTexFile().
So here is an example for the usage of the class:
Located in /src/Org/Heigl/Hyphenator.php (line 89)
This method gets the hyphenator-instance for the language $language
If no instance exists, it is created and stored.
This method returns the name of a TeX-Hyphenation file to a language code
This is the static way of hyphenating a string.
This method gets the appropriate Hyphenator-object and calls the method hyphenate() on it.
This method parses a TEX-Hyphenation file and creates the appropriate PHP-Hyphenation file
Set an instance of Zend_Cache as Caching-Backend.
Set the default Language
This is the constructor, that initialises the hyphenator for the given language $language
This constructor is declared private to ensure, that it is only called via the getInstance() method, so we only initialize the stuff only once for each language.
Get the cached string to a key
Write string to the cache.
string can be retrieved using key
Enable or disable caching of hyphenated texts
Get the string that shall be prepend to a customized word.
This method does the actual hyphenation.
The given $string is splitted into chunks (i.e. Words) at every blank.
After that every chunk is hyphenated and the array of chunks is merged into a single string using blanks again.
This method does not take into account other word-delimiters than blanks (eg. returns or tabstops) and it will fail with texts containing markup in any way.
This method hyphenates a single word
Set and retrieve whether or not to mark custom hyphenations
This method always returns the current setting, so you can set AND retrieve the value with this method.
Set a string that will be replaced with the soft-hyphen before Hyphenation actualy starts.
If this string is found in a word no hyphenation will be done except for the place where the custom hyphen has been found
Set the string that shall be prepend to a customized word.
This method sets the Hyphenation-Character.
This method sets the minimum Characters, that have to stay to the left of a hyphenation
Set a string that marks a words not to hyphenate
Set the quality that the Hyphenation needs to have minimum
The lower the number, the better is the quality
This method sets the minimum Characters, that have to stay to the right of a hyphenation
This method sets the special Characters for a specified language
This method sets the minimum Characters a word has to have before being hyphenated
Documentation generated on Mon, 07 Jun 2010 12:01:07 +0200 by phpDocumentor 1.4.3