Find closest matching name

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

Hello all!
I need to display a list of names similar to a spell checker where the list
is the closest match to the name entered. Not too sure where to begin with
this - any suggestions?

Thanks,
Joe
 
Here is an approach:
Scan each name in the master list (the dictionary), and compute its
"distance" from the name entered. Display those names from the dictionary
that are reasonably "close" to the entered name.

The distance between two strings that is often used is the Levenshtein
distance. You can find information on the algorithm from Google.

Most implementations of Levenshtein will use a dynamic programming approach.
One way to implement dynamic programming as a depth first search in C# can
be found at http://www.frontiernet.net/~fredm/dps/Contents.htm chapter 5.
The recursive approach to solving dynamic programming problems can be found
on the net, or in the references cited at the above link.

A completely different approach is to find names that have a similar sound
(when pronounced) to the entered name. This is based on phonetics. A major
algorithm is Aspell, which has been implemented in Java as "Jazzy". Aspell
combines a metapone algorithm and a "near miss" strategy.

If you read the article on Jazzy,
http://www-106.ibm.com/developerworks/java/library/j-jazzy/ , it should give
you a good background for starting your research.
 
Hi Fred,

Thank you very much for your reply. I'm going to start reading those
links...

-Joe
 
Back
Top