.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Lingua::EN::Hyphenate 3pm" .TH Lingua::EN::Hyphenate 3pm "2021-01-18" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Lingua::EN::Hyphenate \- Perl extension for syllable\-based hyphenation .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Lingua::EN::Hyphenate qw( hyphenate syllables def_syl def_hyph ); \& \& my $word = \*(Aqintromission\*(Aq; \& \& my $syllables = syllables($word); # \*(Aqin~tro~mis~sion\*(Aq \& my @syllables = syllables($word); # (\*(Aqin\*(Aq,\*(Aqtro\*(Aq,\*(Aqmis\*(Aq,\*(Aqsion\*(Aq) \& \& ($end_of_line_1, $start_of_line_2) # (\*(Aqintro\-\*(Aq,\*(Aqmission\*(Aq) \& = hyphenate($word, 6); # Break word at or before 6th char \& \& ($end_of_line_1, $start_of_line_2) # (\*(Aqintromis\-\*(Aq,\*(Aqsion\*(Aq) \& = hyphenate($word, 8); # Break word at or before 8th char \& \& my $hyphen = \*(Aq...\*(Aq; \& ($end_of_line_1, $start_of_line_2) # (\*(Aqintro...\*(Aq,\*(Aqmission\*(Aq) \& = hyphenate($word, 8, $hyphen); # Use specified hyphen (not \*(Aq\-\*(Aq) \& \& def_syl(\*(Aqhere~say\*(Aq); # Where the syllables are \& def_syl(\*(Aqhe~re~sy\*(Aq); # Where the syllables are \& \& def_hyph(\*(Aqhere~say\*(Aq); # Where the word may be broken \& def_hyph(\*(Aqher~esy\*(Aq); # Where the word may be broken .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The exportable subroutines of Lingua::EN::Hyphenate provide a mechanism to break words into syllables, to hyphenate words at syllable boundaries, and to redefine the syllables or hyphenation of specific words. .SS "syllables" .IX Subsection "syllables" This subroutine takes a single string argument and breaks it into syllables. In a scalar context it returns a string with the syllables separated by '~' characters. In a list context it returns a list of the syllables. .SS "hyphenate" .IX Subsection "hyphenate" This subroutine takes a word to be broken, and an integer indicating the maximum number of characters allowed before the break. An optional third argument specifies the hyphenation marker ('\-' by default). .PP The subroutine returns a list of two elements: the characters before the break (including the hyphenation marker), and the rest of the word. The first element is guaranteed to be no longer than the length specified by the second argument. .SS "def_syl and def_hyph" .IX Subsection "def_syl and def_hyph" These subroutines specify a specific syllablic decomposition or hyphenation pattern (respectively) to be used for the specified word. The syllables or hyphenation fragments are separated by '~' characters. See the examples above. .SH "AUTHOR" .IX Header "AUTHOR" Damian Conway (damian@conway.org) .SH "BUGS AND IRRITATIONS" .IX Header "BUGS AND IRRITATIONS" The syllable extraction is algorithmic, not table-driven. That means the module is very short, but also that it can be *very* inaccurate. It's okay for haiku, but shouldn't be used for serious work. Consider Lingua::EN::Syllable or TeX::Hyphen instead. .PP There are undoubtedly serious bugs lurking somewhere in this code, if only because it gives the impression of understanding a great deal more about English than it actually does. .PP Bug reports and other feedback are most welcome. .SH "COPYRIGHT" .IX Header "COPYRIGHT" .Vb 4 \& Copyright (c) 1997\-2000, Damian Conway. All Rights Reserved. \& This module is free software. It may be used, redistributed \&and/or modified under the terms of the Perl Artistic License \& (see http://www.perl.com/perl/misc/Artistic.html) .Ve