Soundex

Soundex

Soundex — один из алгоритмов сравнения двух строк по их звучанию. Он устанавливает одинаковый индекс для строк, имеющих схожее звучание в английском языке.

Soundex был разработан Робертом Расселлом (Robert Russel) и Маргарет Обелл (Margaret Obell) и запатентован в 1918 и 1922 годах (U.S. Patent 1 261 167 и U.S. Patent 1 435 663). Этот алгоритм стал популярным в 1960-х годах, после того как стал темой нескольких статей в журналах «Communications of the Association for Computing Machinery» и «Journal of the Association for Computing Machinery» (CACM и JACM). Еще большую популярность этот алгоритм получил после того, как был опубликован в книге Дональда Кнута Искусство программирования, том 1. Основные алгоритмы.

Содержание

Описание алгоритма

  • Первая буква сохраняется
  • В остальной части слова:
    • Буквы, обозначающие, как правило, гласные звуки: a, e, h, i, o, u, w и y — отбрасываются
    • Оставшиеся буквы (согласные) заменяются на цифры от 1 до 6, причём похожим по звучанию буквам соответствуют одинаковые цифры:
      • 1: b, f, p, v
      • 2: c, g, j, k, q, s, x, z
      • 3: d, t
      • 4: l
      • 5: m, n
      • 6: r
    • Любая последовательность одинаковых цифр сокращается до одной такой цифры.
  • Итоговая строка обрезается до первых четырёх символов. Если длина строки меньше требуемой, недостающие символы заменяются знаком 0.

Примеры:

  • аmmonium → ammnm → a5555 → a5 → a500
  • implementation → implmnttn → i51455335 → i514535 → i514

Пример исполнения

Ниже приведен пример реализации алгоритма на языке программирования Perl.

sub soundex
{
  my $word = lc (shift // $_);  
  $word =~ tr/\t //d;
 
  my $fl = substr $word, 0, 1;
  $word  = substr $word, 1;
 
  $word =~ tr/bfpvcgjkqsxzdtlmnraehiouwy/111122222222334556/ds;
  $word = "$fl$word";
  return substr($word, 0, 4)."0" x (4 - length($word));
}

См. также

Ссылки на попытки создания soundex для русского языка


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Полезное


Смотреть что такое "Soundex" в других словарях:

  • Soundex — is a phonetic algorithm for indexing names by sound, as pronounced in English. The goal is for names with the same pronunciation to be encoded to the same representation so that they can be matched despite minor differences in spelling. Soundex… …   Wikipedia

  • Soundex — est un algorithme phonétique d indexation de noms par leur prononciation en anglais britannique. L objectif basique est que les noms ayant la même prononciation soient codés avec la même chaîne de manière à pouvoir trouver une correspondance… …   Wikipédia en Français

  • Soundex — es un algoritmo fonético, un algoritmo para indexar nombre por su sonido, al ser pronunciados en Inglés. El objetivo básico de este algoritmo es codificar de la misma forma los nombres con la misma pronunciación. Soundex es el algoritmo fonético… …   Wikipedia Español

  • Soundex — Algorithmus Soundex ist ein phonetischer Algorithmus zur Indizierung von Wörtern und Phrasen nach ihrem Klang in der englischen Sprache. Gleichklingende Wörter sollen dabei zu einer identischen Zeichenfolge kodiert werden. Der Soundex Algorithmus …   Deutsch Wikipedia

  • Soundex — es un algoritmo fonético, un algoritmo para indexar nombre por su sonido, al ser pronunciados en Inglés. El objetivo básico de este algoritmo es codificar de la misma forma los nombres con la misma pronunciación. Soundex es el algoritmo fonético… …   Enciclopedia Universal

  • Soundex — noun A phonetic algorithm for indexing names by their English pronunciation, based on the most probably significant consonants, so that a search for a misspelled name may find the desired one …   Wiktionary

  • Soundex — ● np. m. ►PAO (++) …   Dictionnaire d'informatique francophone

  • soundex — n. algorithm used to encode words in way that enables words with identical sounds to be encoded in the same manner (Computers) …   English contemporary dictionary

  • Soundex — …   Useful english dictionary

  • Daitch–Mokotoff Soundex — (D–M Soundex) is a phonetic algorithm invented in 1985 by Jewish genealogists Gary Mokotoff and Randy Daitch. It is a refinement of the Russell and American Soundex algorithms designed to allow greater accuracy in matching of Slavic and Yiddish… …   Wikipedia


Поделиться ссылкой на выделенное

Прямая ссылка:
Нажмите правой клавишей мыши и выберите «Копировать ссылку»