Metaphone()
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=string );
Returns: String
| Argument | Description |
|---|---|
|
str
string,
required
|
edit
The input string |
Examples
edit// reduces names to a key or code based on their English pronunciation, such that similar sounding names share the same key.
name1 = metaphone(str = "Smith");
name2 = metaphone(str = "Smythe");
name3 = metaphone(str = "Smithfield");
dump(name1); // SM0
dump(name2); // SM0
dump(name3); // SM0F
See also
- Strings
- Soundex()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)