Skip to content

Commit

Permalink
Adds docs to the Xml-Tokenizer
Browse files Browse the repository at this point in the history
  • Loading branch information
heiglandreas committed Jul 27, 2017
1 parent 4cc04aa commit 4534749
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion doc/examples.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,26 @@ echo $h->hyphenate('We have some really long words in german like sauerstofffeld
// Thanks to lsmith for the idea!]]></programlisting>
</para>
</sect1>
<sect1>
<title>Hyphenate HTML-content</title>
<para>
<programlisting language="php"><![CDATA[use \Org\Heigl\Hyphenator as h;
$o = new h\Options();
$o->setHyphen('-')
->setDefaultLocale('de_DE')
->setRightMin(2)
->setLeftMin(2)
->setWordMin(5)
->setFilters('Simple')
->setTokenizers('Xml', 'Whitespace', 'Punctuation');
$h = new h\Hyphenator();
$h->setOptions($o);
echo $h->hyphenate('<h1>Long Words</h1><p>We have some really long words in german<br />like sauerstofffeldflasche.</p>');
// prints <h1>Long Words</h1><p>We have some re-al-ly long words in ger-man<br />like sau-er-stoff-feld-fla-sche.</p>
// Thanks to mablae for the idea!]]></programlisting>
</para>
</sect1>
<caution>
<title>Performance-Hint</title>
<para>
Expand All @@ -71,4 +91,4 @@ echo $h->hyphenate('We have some really long words in german like sauerstofffeld
second on a 2.5GHz Intel Core2 Duo using 4GB RAM.
</para>
</caution>
</chapter>
</chapter>

0 comments on commit 4534749

Please sign in to comment.