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

Herramientas

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.

  1. 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:
  2. 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.
  3. 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.
  4. 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.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.