Click here to Skip to main content
15,894,297 members
Articles / Programming Languages / C++

Implement Phonetic ("Sounds-like") Name Searches with Double Metaphone Part I: Introduction & C++ Implementation

Rate me:
Please Sign up or sign in to vote.
4.91/5 (21 votes)
19 Mar 2007CPOL15 min read 149K   2.8K   60  
Introduces the Double Metaphone algorithm for phonetic comparison of proper names, and provides a practical C++ implementation for use in the reader's projects.
7-22-03
Adam Nelson <anelson@apocryph.org>
http://www.apocryph.org

This zip archive contains source code and release binaries for each of the
sample applications included in my "Implement Phonetic Matching ("Sounds-like") 
Name Searches with the Double Metaphone Algorithm" article series.

Note that the sample applications are dependent upon the Double Metaphone
implementations for their respective languages, therefore make sure that you
download the Double Metaphone implementation source archive and extract it to
the same folder as this zip archive.  For those implementations that require
registration of some sort (COM, and SQL Server Extended Stored Procedure impls
for example), follow the registration instructions in the appropriate article 
before attempting to use the samples associated with those implementations.

The contents of this archive are as follows:
* namelist.txt - A list of proper names, "borrowed" from the Moby project.
Used as test data for the sample applications.

* namelist.mdb - The names from namelist.txt, imported into an MS Access 2002
database for use by the ASPWordDBLookup and VBWordDBLookup samples.

* ASPWordDBLookup - ASP source code which uses MetaphoneCOM to search an Access
database of proper names

* CSWordLookup - C# implementation of the WordLookupSample, which uses Metaphone.NET.

* VBWordLookup - Visual Basic implementation of WordLookupSample, using MetaphoneCOM

* VBWordDBLookup - Visual Basic implementation of WordLookupSample which demonstrates
phonetically searching a SQL database (Access in this case) with Metaphone.COM

* WordLookupSample - Simple C++ console application which loads namelist.txt
into an STL container, and phonetically searches the names for phonetic matches
to user-defined search terms.

------------------------------------------------------------------------------
All source code and articles are Copyright (C) 2003 Adam J. Nelson.  

The author grants unrestricted license to copy, modify, and redistribute the source
code contained herein, provided you do not misrepresent yourself as the author.

This software is provided by Adam Nelson "as is" and
any express or implied warranties, including, but not limited to, the
implied warranties of merchantability and fitness for a particular purpose
are disclaimed.  In no event shall the author be liable
for any direct, indirect, incidental, special, exemplary, or consequential
damages (including, but not limited to, procurement of substitute goods
or services; loss of use, data, or profits; or business interruption)
however caused and on any theory of liability, whether in contract, strict
liability, or tort (including negligence or otherwise) arising in any way
out of the use of this software, even if advised of the possibility of
such damage.

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
My name is Adam Nelson. I've been a professional programmer since 1996, working on everything from database development, early first-generation web applications, modern n-tier distributed apps, high-performance wireless security tools, to my last job as a Senior Consultant at BearingPoint posted in Baghdad, Iraq training Iraqi developers in the wonders of C# and ASP.NET. I am currently an Engineering Director at Dell.

I have a wide range of skills and interests, including cryptography, image processing, computational linguistics, military history, 3D graphics, database optimization, and mathematics, to name a few.

Comments and Discussions