Tuesday, April 15, 2008

Double Metaphone

Found a really nice search function which allows for "Sounds like" searchs in C#. It's called the Double Metaphone (http://en.wikipedia.org/wiki/Double_Metaphone
) which breaks the name down into a small 4 char fild which you can match.

The source code can be found from the CodeProject website (http://www.codeproject.com/KB/recipes/dmetaphone5.aspx). simply include this in you VS2005 project (it should convert without any issues).

using using nullpointer.Metaphone;
....
DoubleMetaphone mphone = new DoubleMetaphone(_surname);
string mphone_Surname = mphone.PrimaryKey;
....