Solved

Finding duplicate records and potential mispellings in an array

Posted on 2011-02-16
5
988 Views
Last Modified: 2012-06-21
Hi There

I have an array of of peoples names

Example
string[] names = new string[] {"Jim Bean","Jack Daniels" ,"Jim Bean" ,"Tim Bean"}

How do I loop through the array to find duplicates.
I also need to know how I can find similar names in the array to find mispelt names as in the example.
pseudo-code will be good enough



Thanks
Stanton
0
Comment
Question by:Stanton_Roux
  • 5
5 Comments
 
LVL 12

Expert Comment

by:starlite551
ID: 34910707
Use can use Oracle To Solve this Issue.. There is a Function in Oracle called Soundex() which Finds Names Which Sound Similar.. So It Would be a good option for you to find duplicates in names..
0
 
LVL 12

Accepted Solution

by:
starlite551 earned 500 total points
ID: 34910738
Also, check out the Difference function in SQL to compare soundexes:

In the first part of this example, the SOUNDEX values of two very similar strings are compared, and DIFFERENCE returns a value of 4. In the second part of this example, the SOUNDEX values for two very different strings are compared, and DIFFERENCE returns a value of 0.

USE pubs
GO
-- Returns a DIFFERENCE value of 4, the least possible difference.
SELECT SOUNDEX('Green'),
  SOUNDEX('Greene'), DIFFERENCE('Green','Greene')
GO
-- Returns a DIFFERENCE value of 0, the highest possible difference.
SELECT SOUNDEX('Blotchet-Halls'),
  SOUNDEX('Greene'), DIFFERENCE('Blotchet-Halls', 'Greene')
GO
0
 
LVL 12

Expert Comment

by:starlite551
ID: 34910748
I think SOUNDEX function is also available in SQL Server.. So try searching for more info about it..
0
 
LVL 12

Expert Comment

by:starlite551
ID: 34910765
0
 
LVL 12

Expert Comment

by:starlite551
ID: 34910775
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question