How to check if two lines are a partial match in C #?

Possible duplicate:
Are there libraries of fuzzy search functions or string functions written for C #?

I create an application that will save the user for entering the name of the song or artist or album, and then look at the String Array or ArrayList for any possible matches.

Auto offers will be calculated based on a percentage.

for example

If the user uses the prk link , he should find Linkin Park or Link 80 or Link Wray , but the percentage of compliance will be different for everyone

Assume that the collection will only search for Artist names in the Artist and Song collections in the song collection.

(Percentages are for explanation only)

 Linkin Park - 98% Link Wray -82% Link 80 - 62% 

The solution does not have to be C # code, any regular expression or pseudo code will be good, but it must be implemented in C #.

+8
string c # match partial
source share
3 answers

Usually, the Levenshtein distance implementation, also called the editing distance, is used for this. This will find matches based on the minimum number of changes needed to convert one line to another, counting all inserts, deletions, or replacing one character as a measure for "cost" - candidates are strings that have a minimum cost.

Here's a link to an article with a general implementation in C #.

+11
source share
+8
source share

In this question you can find a great example of algorithms and implementations. Are there libraries of fuzzy search functions or string functions written for C #?

0
source share

All Articles