是否有任何的C#编写的模糊搜索或字符串相似函数库? [英] Are there any Fuzzy Search or String Similarity Functions libraries written for C#?

查看:129
本文介绍了是否有任何的C#编写的模糊搜索或字符串相似函数库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有类似的问题,但不是关于C#库,我可以在我的源$ C ​​$ C使用。

There are similar question, but not regarding C# libraries I can use in my source code.

感谢大家的帮助。

我已经看到了Lucene的,但我需要更多的东西容易搜索相似的字符串,没有索引部分的开销。

I've already saw lucene, but I need something more easy to search for similar strings and without the overhead of the indexing part.

我标志着答案得到了两个非常简单的算法,以及一个使用LINQ了,所以它的完美。

The answer I marked has got two very easy algorithms, and one uses LINQ too, so it's perfect.

推荐答案

Levenshtein距离实现:

Levenshtein distance implementation:

  • Using LINQ (not really, see comments)
  • Not using LINQ

我有一个.NET 1.1的项目中,我用的是后者。这是简单的,但完美的作品我需要的东西。从我记得它需要一些调整,但没有,是不是很明显。

I have a .NET 1.1 project in which I use the latter. It's simplistic, but works perfectly for what I need. From what I remember it needed a bit of tweaking, but nothing that wasn't obvious.

这篇关于是否有任何的C#编写的模糊搜索或字符串相似函数库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆