.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" 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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 "Metaphone 3pm" .TH Metaphone 3pm 2024-03-07 "perl v5.38.2" "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 Text::Metaphone \- A modern soundex. Phonetic encoding of words. .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Text::Metaphone; \& \& # XWRN \& my $phoned_word = Metaphone(\*(AqSchwern\*(Aq); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" \&\f(CWMetaphone()\fR is a function whereby a string/word is broken down into a rough approximation of its english phonetic pronunciation. Very similar in concept and purpose to soundex, but much more comprehensive in its approach. .SH FUNCTIONS .IX Header "FUNCTIONS" \fIMetaphone\fR .IX Subsection "Metaphone" .PP .Vb 1 \& $phoned_word = Metaphone($word, $max_phone_len); .Ve .PP Takes a word and encodes it according to the Metaphone algorithm. The algorithm only deals with alphabetical characters, all else is ignored. .PP If \f(CW$max_phone_len\fR is provided, Metaphone will only encode up to that many characters for each word. .PP \&'sh' is encoded as 'X', 'th' is encoded as '0'. This can be changed in the metaphone.h header file. .SH CAVEATS .IX Header "CAVEATS" \fIMetaphone algorithm changes\fR .IX Subsection "Metaphone algorithm changes" .PP I have made a few minor changes to the traditional metaphone algorithm found in the books. The most significant one is that it will differenciate between SCH and SCHW making the former K (As in School) and the latter sh (as in Schwartz and Schwern). .PP My changes can be turned off by defining the USE_TRADITIONAL_METAPHONE flag in metaphone.h. .PP Due to these changes, any users of Metaphone v1.00 or earlier which have stored metaphonetic encodings, they should recalculate those with the new version. .SH AUTHOR .IX Header "AUTHOR" Michael G Schwern .SH "SEE ALSO" .IX Header "SEE ALSO" .SS "Man pages" .IX Subsection "Man pages" Text::Soundex \- A simpler word hashing algorithm Text::DoubleMetaphone \- Improved metaphone Text::Phonetic \- A collection of phonetic algorithms .SS "Books, Journals and Magazines" .IX Subsection "Books, Journals and Magazines" \fIBinstock, Andrew & Rex, John. "Metaphone: A Modern Soundex." Practical Algorithms For Programmers. Reading, Mass: Addion-Wesley, 1995 pp160\-169\fR .IX Subsection "Binstock, Andrew & Rex, John. ""Metaphone: A Modern Soundex."" Practical Algorithms For Programmers. Reading, Mass: Addion-Wesley, 1995 pp160-169" .PP Contains an explanation of the basic metaphone concept & algorithm and C code from which I learned of Metaphone and ported this module. .PP \fIParker, Gary. "A Better Phonetic Search." C Gazette, Vol. 5, No. 4 (June/July), 1990.\fR .IX Subsection "Parker, Gary. ""A Better Phonetic Search."" C Gazette, Vol. 5, No. 4 (June/July), 1990." .PP This is the public-domain C version of metaphone from which Binstock & Rex based their own.. I haven't actually read it. .PP \fIPhilips, Lawrence. Computer Language, Vol. 7, No. 12 (December), 1990.\fR .IX Subsection "Philips, Lawrence. Computer Language, Vol. 7, No. 12 (December), 1990." .PP And here's the original Metaphone algorithm as presented in Pick BASIC. .SH "COPYRIGHT and LICENSE" .IX Header "COPYRIGHT and LICENSE" Copyright (c) 1997, 1999, 2007\-2008 Michael G Schwern. All Rights Reserved. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.