Text::Metaphone - A modern soundex. Phonetic encoding of words. |
Text::Metaphone - A modern soundex. Phonetic encoding of words.
use Text::Metaphone; $phoned_words = Metaphone('Schwern');
Metaphone()
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.
$phoned_word = Metaphone($word, $max_phone_len);
Takes a word and encodes it according to the Metaphone algorithm. The algorithm only deals with alphabetical characters, all else is ignored.
If $max_phone_len is provided, Metaphone will only encode up to that many characters for each word.
'sh' is encoded as 'X', 'th' is encoded as '0'. This can be changed in the metaphone.h header file.
My changes can be turned off by defining the USE_TRADITIONAL_METAPHONE flag in metaphone.h.
Due to these changes, any users of Metaphone v1.00 or earlier which have stored metaphonetic encodings, they should recalculate those with the new verison.
Michael G Schwern <schwern@pobox.com>
Copyright (c) 1997-1999 Michael G Schwern. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Text::Metaphone - A modern soundex. Phonetic encoding of words. |