Text::Metaphone(3pm)

Text::Metaphone3pm

A modern soundex. phonetic encoding of words.

Usage

  use Text::Metaphone;
  # XWRN
  my $phoned_word = Metaphone('Schwern');

Overview

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.

Functions

Metaphone

    $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.

Caveats

Metaphone algorithm changes

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).

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 version.

Releases

5 releases since Debian 9 (Stretch); the text changed 4 times.

  1. 9
  2. 10
  3. 11
  4. 12
  5. 13

Author

Michael G Schwern <[email protected]>

From libtext-metaphone-perl 20160805-2+b4 in Debian 13 (Trixie). Parsed by carta from the page's man source.