Does C# has its own library for Fuzzy match(Fuzzy Search) or a method that can be used directly from .net libraries?
+4
A:
Not a library, but check out the Levenshtein edit distance algorithm:
http://www.merriampark.com/ldcsharp.htm
It's well known and established and excellent for fuzzy matching text. There are many other examples out there besides the link i provided in case it doesn't suit you: Google Search
Paul Sasik
2010-02-18 19:15:25
I know Levenshtein edit distance algorithm and I already used it but I'm wondering if .net has one.
Eyla
2010-02-18 19:32:18
Not built in. Not as of 3.5 anyway. Though it's fairly trivial to implement as is. Why not just reuse what you already know? Btw. You can add it as an extension method and make it feel like a .Net library function. ;-)
Paul Sasik
2010-02-18 20:06:19
+1
A:
Current versions don't have it built in.
I have seen and used Soundex (a method for fuzzy matching) operations for this in the past. Here's an article on how to implement Soundex in .Net.
David Stratton
2010-02-18 19:18:06
Thanks. I've bookmarked this because I want to try the Levenshtein next time I have a need for such logic.
David Stratton
2010-02-19 02:46:51
+1
A:
If its for a kindof "did you mean" function you could have a look at Lorenzo Stoakes C# implementation of Peter Norvig's Spelling Corrector.
If you need more elaborate search features like ranking and such, you could also take at look at Lucene.Net
Luhmann
2010-02-18 19:24:56