Metaphone is a phonetic algorithm, an algorithm published in 1990 for indexing words by their English pronunciation. The algorithm produces variable length keys as its output, as opposed to Soundex's fixed-length keys. Similar sounding words share the same keys.

metaphone(str) → returns string

This function requires Lucee. Not supported on Adobe ColdFusion.

metaphone Argument Reference

str string

Links more information about metaphone

Examples sample code invoking the metaphone function

Metaphone long words

This compound word is the longest word published with 79 letters according to the 1996 Guinness Book of World Records


Expected Result: TNTM

Different words with the same metaphone


Expected Result: TRK/TRK

Metaphone of a word and then same word with prefix

Adding a word changes the whole metaphone

Metaphone("Trek")&"/"&Metaphone("Star Trek")

Expected Result: TRK/STRT

Fork me on GitHub