NAME
TeX::Hyphen -- hyphenate words using TeX's patterns
SYNOPSIS
use TeX::Hyphen;
my $hyp = new TeX::Hyphen "hyphen.tex";
my $word = "representation";
my @points = $hyp->hyphenate($word);
print $hyp->visualize($word), "\n";
DESCRIPTION
Constructor new() creates a new Hyphen object and loads the file with patterns into memory. Then you can ask it for hyphenation of a word by calling a method of this object. If no file is specified, the default Donald E. Knuth's hyphen.tex, that is included in this module, is used instead.
Method hyphenate() returns list of places where the word can be divided, so
$hyp->visualize('representation')
returns list (3, 5, 8, 10). Method visualize() can be used to show these poins, so
$hyp->visualize('representation')
should give rep-re-sen-ta-tion
.
Variables $TeX::Hyphen::LEFTMIN and $TeX::Hyphen::RIGHTMIN can be used to restrict minimal starting and ending substring where it is not possible to hyphenate. They both default to 2 but should be changed to match the paratemers used to generate the patterns.
Variable $TeX::Hyphen::DEBUG can be set to see some statistics and processing.
The file with hyphenation patterns may contain \'
and \v
accents, used in the Czech (and other) languages.
CHANGES
- 0.101 trial Wed Nov 3 16:06:02 MET 1999
-
Parsing of patterns extended to allow other styles as well -- Spanish pattern file provided by Adrian Perez Jorge.
- 0.10 Fri Dec 11 10:58:01 MET 1998
-
Bug fixes concering LEFTMIN and RIGHTMIN values and use of exceptions (thanks go to Vladimir Volovich).
- 0.06 Mon Jul 21 18:53:26 MET DST 1997
-
Exception table handling added -- error spotted by Jon Orwant.
- 0.05 Wed Jul 9 14:49:42 MET DST 1997
-
Added the default hyphen.tex into the module and possibility to call the constructior without argument to get this default pattern file.
- 0.04 Wed Apr 9 15:41:32 MET DST 1997
-
Hash lookup made faster.
Method TeX::Hyphen::visualize() only takes one argument, it calls hyphenate().
- 0.03 Sun Feb 16 13:55:26 MET 1997
-
Hash lookup made faster.
Original name Hyphen chaged to TeX::Hyphen.
VERSION
0.101
SEE ALSO
perl(1).
AUTHOR
(c) 1997, 1999 Jan Pazdziora, adelton@fi.muni.cz at Faculty of Informatics, Masaryk University, Brno