TeX::Hyphen(3)
okay bestie, welcome to TeX::Hyphen(3) β a User Contributed Perl Documentation page for the Perl module that hyphenates words using TeX's patterns. It's giving classic Perl, but make it cute β¨
β¨ NAME β¨
TeX::Hyphen β hyphenate words using TeX's patterns. π
π SYNOPSIS π
use TeX::Hyphen;
my $hyp = new TeX::Hyphen 'file' => 'hyphen.tex',
'style' => 'czech', leftmin => 2,
rightmin => 2;
my $hyp = new TeX::Hyphen 'file' => 'hyphen.tex',
'style' => 'utf8';
# my $hyp = new TeX::Hyphen "hyphen.tex";
my $word = "representation";
my @points = $hyp->hyphenate($word);
print $hyp->visualize($word), "\n";
π¦ DESCRIPTION π¦
The 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 β the one included in this module β is used instead. No cap.
π Arguments to constructor π
You can pass arguments to the new() call as a hash; possible options are:
fileβ Name of the file with the patters. (Yes, "patters" is literally what the page says. I'm not fixing it. π) It will be loaded and the resulting object will be able to hyphenate according to patterns in that file. For convenience and backward compatibility, the file name can also be specified as the first (odd) parameter tonew().styleβ Various languages use special shortcuts to specify the patterns. Instead of doing the full TeX expansion, we use Perl code to parse the patterns. Thestyleoption loads theTeX::Hyphen::name_of_the_stylemodule and uses the parsing functions found in it. Currently, the defaultczech(which also works for English alright),german, andutf8are available. See theTeX::Hyphen::czechman page for more information, especially if you want to support other languages/styles.leftminβ The minimum starting substring which will not be hyphenated. This overrides the default specified in the style file.rightminβ The minimum ending substring which will not be hyphenated. This overrides the default specified in the style file.
π Methods that are supported π
Method hyphenate() returns the list of places where the word can be divided, so:
$hyp->hyphenate('representation')
returns list (3, 5, 8, 10). Slay.
Method visualize() can be used to show these points, so:
$hyp->visualize('representation')
should return "rep-re-sen-ta-tion", at least for English patterns. Iconic.
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. (That's "paratemers" β original spelling, not me. π)
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.
β VERSION β
1.18 β short, sweet, periodt.
π₯ AVAILABLE FROM π₯
http://www.adelton.com/perl/TeX-Hyphen/
π AUTHOR π
(c) 1997--2016 Jan Pazdziora.
All rights reserved. This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Contact the author at jpx dash perl at adelton dot com.
πΈ SEE ALSO πΈ
perl(1), TeX::Hyphen::czech.
okay that's the whole thing. This page shipped with perl v5.32.1, dated 2018-02-09, and it's literally the TeX::Hyphen(3) page β bye bestie, go hyphenate something cute π
π«Ά
π¦ where this page comes from
- epel 9: perl-TeX-Hyphen 1.18-5.el9 Β· GPL+ or Artistic
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms