Metaphone
Metaphone es un algoritmo fonético, un algoritmo para indexar palabras por su sonido al ser pronunciadas en inglés.
Metaphone fue desarrollado por Lawrence Philips como respuesta a las deficiencias del algoritmo Soundex. Es más exacto que Soundex porque "entiende" las reglas básicas de pronunciación en inglés.
Está disponible como operador integrado en algunos sistemas, incluyendo las últimas versiones de PHP.
El autor más tarde desarrolló una nueva versión del algoritmo, al que llamó "Double Metaphone", que produce resultados más exactos que el original.
El algoritmo produce claves como salida. Palabras que suenen parecido comparten la misma clave y son de longitud variable.
Algoritmo
Desde una librería de texto en Ruby:
[ /([bcdfhjklmnpqrstvwxyz])\1+/,
'\1' ],# Remueve doubles consonantes excepto g.
# [PHP] remueve c desde regexp.
[ /^ae/, 'E' ],
[ /^[gkp]n/, 'N' ],
[ /^wr/, 'R' ],
[ /^x/, 'S' ],
[ /^wh/, 'W' ],
[ /mb$/, 'M' ],# [PHP] remueve $ desde regexp.
[ /(?!^)sch/, 'SK' ],
[ /th/, '0' ],
[ /t?ch|sh/, 'X' ],
[ /c(?=ia)/, 'X' ],
[ /[st](?=i[ao])/, 'X' ],
[ /s?c(?=[iey])/, 'S' ],
[ /[cq]/, 'K' ],
[ /dg(?=[iey])/, 'J' ],
[ /d/, 'T' ],
[ /g(?=h[^aeiou])/, '' ],
[ /gn(ed)?/, 'N' ],
[ /([^g]|^)g(?=[iey])/,
'\1J' ],
[ /g+/, 'K' ],
[ /ph/, 'F' ],
[ /([aeiou])h(?=\b|[^aeiou])/,
'\1' ],
[ /[wy](?![aeiou])/, '' ],
[ /z/, 'S' ],
[ /v/, 'F' ],
[ /(?!^)[aeiou]+/, '' ],
Enlaces externos
- Survey of Phonetic Matching (en inglés)
- Open Source Spell Checker (en inglés)
- Page for PHP implementation of Metaphone (en inglés)
Herramientas
- Soundex, Metaphone, and Double Metaphone implementation in Java (en inglés)
- PHP implementation by Stephen Woodbridge PHP (en inglés)
- OCaml implementation of Double Metaphone OCaml (en inglés)
- 4GL implementation by Robert Minter 4GL (en inglés)
- CodeProject's article about double metaphone implementations (en inglés)
- FileMaker Pro custom function, requiere FileMaker Pro Advanced para implementar (en inglés)
- Text::DoubleMetaphone Módulo Perl en CPAN (en inglés)
- Implementación del Metáfono en Python (Español)
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.