开发者

Fuzzy match in C#

开发者 https://www.devze.com 2022-12-20 09:58 出处:网络
Does C# has its own library for Fuzzy match(Fuzzy Search) or a method that can be used directly fr开发者_Python百科om .net libraries?Not a library, but check out the Levenshtein edit distance algorith

Does C# has its own library for Fuzzy match(Fuzzy Search) or a method that can be used directly fr开发者_Python百科om .net libraries?


Not a library, but check out the Levenshtein edit distance algorithm:

http://en.wikipedia.org/wiki/Levenshtein_distance

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


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.

http://www.codeproject.com/KB/aspnet/Soundex.aspx


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号