.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" 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::Syllable 3pm" .TH Lingua::EN::Syllable 3pm "2022-10-13" "perl v5.34.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::Syllable \- count the number of syllables in English words .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Lingua::EN::Syllable; \& \& $count = syllable(\*(Aqsupercalifragilisticexpialidocious\*(Aq); # 14 .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBLingua::EN::Syllable::syllable()\fR estimates the number of syllables in the word passed to it. .PP Note that it isn't entirely accurate... it fails (by one syllable) for about 10\-15% of my /usr/dict/words. The only way to get a 100% accurate count is to do a dictionary lookup, so this is a small and fast alternative where more-or-less accurate results will suffice, such as estimating the reading level of a document. .PP I welcome pointers to more accurate algorithms, since this one is pretty quick-and-dirty. This was designed for English (well, American at least) words, but sometimes guesses well for other languages. .SH "KNOWN LIMITATIONS" .IX Header "KNOWN LIMITATIONS" Accuracy for words with non-alpha characters is somewhat undefined. In general, punctuation characters, et al, should be trimmed off before handing the word to \fBsyllable()\fR, and hyphenated compounds should be broken into their separate parts. .PP Syllables for all-digit words (eg, \*(L"1998\*(R"; some call them \*(L"numbers\*(R") are often counted as the number of digits. A cooler solution would be converting \&\*(L"1998\*(R" to \*(L"nineteen eighty eight\*(R" (or \*(L"one thousand nine hundred eighty eight\*(R", or...), but that is left as an exercise for the reader. .PP Contractions are not well supported. .PP Compound words (like \*(L"lifeboat\*(R"), where the first word ends in a silent 'e' are counted with an extra syllable. .SH "SEE ALSO" .IX Header "SEE ALSO" Lingua::Phonology \- a framework of classes that provide \&\*(L"an object model for lingistic phonology and sound change\*(R". That includes syllables, and it looks like you can use it to get syllables for words, but from a quick skim of the doc I can't see exactly how. .PP Text::Info \- a new module (as of late 2015) that provides information about text in Germanic languages, including syllable count. .SH "REPOSITORY" .IX Header "REPOSITORY" .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 1999 by Greg Fast .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. .SH "AUTHOR" .IX Header "AUTHOR" Greg Fast (gdf@imsa.edu)