<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="http://www.heigl.org/docbook/xsl/html/chunk.xsl" ?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.heigl.org/docbook/dtd/docbookx.dtd"[
<!ENTITY prerequisites SYSTEM "prerequisites.xml">
<!ENTITY installation SYSTEM "installation.xml">
<!ENTITY upgrade SYSTEM "upgrading.xml">
<!ENTITY examples SYSTEM "examples.xml">
<!ENTITY configuration SYSTEM "configuration.xml">
<!ENTITY licenses SYSTEM "license.xml">
]>
<book id="hyphenator" lang="en">
    <bookinfo>
        <title>Org\Heigl\Hyphenator - Manual</title>
        <author><firstname>Andreas</firstname><surname>Heigl</surname></author>
        <copyright><year>2011</year><holder>Andreas Heigl</holder></copyright>
    </bookinfo>
    <chapter id="hyphenator.introduction">
    <title>Introduction</title>
    <para>
        <classname>Org\Heigl\Hyphenator</classname> is a package to enable 
        word-hyphenation in PHP. It uses the algorithms described by Marc Liang
        in his thesis <ulink url="http://www.tug.org/docs/liang/liang-thesis.pdf">
        Word Hyphenation by computer</ulink> and the extensions described
        by László Németh in his work <ulink url="http://www.tug.org/TUGboat/tb27-1/tb86nemeth.pdf">
        Automatic non-standard hyphenation in OpenOffice.org</ulink>. 
    </para>
    <para>
        These algorithms are based on matching words against certain patterns 
        that describe places inside a word where hyphenation is possible or 
        must not occur. This Hyphenator uses the pattern-files from OpenOffice
        which are based on the pattern-files created for TeX.
    </para> 
    <sect1>
        <title>Theory of operation</title>
        <para>Only words can be hyphenated and the beginning and the end of a word 
        are special boundaries that have to be considered for hyphenation. Therefore 
        the first part of the hyphenation-process is to split up any string into 
        words that can be hyphenated and other stuff. In this <package>Hyphenator</package>-package
        that ist done by using special <classname>Tokenizers</classname>. These split the given 
        string according to their special Task. So the <classname>WhitespaceTokenizer</classname> 
        uses whitespace-characters as split-point whereas the <classname>PunctuationTokenizer</classname>
        uses common punktuation.characters.
        </para>
        <para>
            The next step in the hyphenation process is to determin the possible hyphenation-places 
            using special hyphenation-pattern. These patterns have been used in the 
            TeX-language  for a long time now and are widely used in other OpenSource-Projects.
            The pattern files used for this <package>Hyphenator</package>-package are from the 
            OpenOffice.org-project. These are also based on the TeX-pattern, but are more easy 
            to parse than the original TeX-files. They are also in some cases enriched with additional information.
            These patterns are locale-dependend and are provided using a <classname>Dictionary</classname>
        </para>
        <para>
            After the patterns have been retrieved for a word, the possible hyphenation positions can be 
            defined. The word is then filtered using a <classname>Filter</classname> that handles the actual hyphenation.
            According to the selected filter it is for instance possible to mark every possible hyphenation-position  with the
            given Hyphen-string (<classname>SimpleFilter</classname>). Other Filters are possible.
        </para>
        <para>
            The last step is to merge all the bits and pieces the tokenizers left over so we can ge a final hyphenation result.
            This too is handled by the Filters as the result might be different according to the used token-filter. 
        </para>
    </sect1>
</chapter>
    &prerequisites;
    &installation;
    &upgrade;
    &examples;
    &configuration;
    &licenses;
    
</book>