Last Modified
2015-08-25 11:51:53 -0400
Requires

Description

An implementation of the Metaphone phonetic coding system in Ruby.

Metaphone encodes names into a phonetic form such that similar-sounding names have the same or similar Metaphone encodings.

The original system was described by Lawrence Philips in Computer Language Vol. 7 No. 12, December 1990, pp 39-43.

As there are multiple implementations of Metaphone, each with their own quirks, I have based this on my interpretation of the algorithm specification. Even LP's original BASIC implementation appears to contain bugs (specifically with the handling of CC and MB), when compared to his explanation of the algorithm.

I have also compared this implementation with that found in PHP's standard library, which appears to mimic the behaviour of LP's original BASIC implementation. For compatibility, these rules can also be used by passing :buggy=>true to the methods.

Author: Paul Battley (pbattley@gmail.com)