c#:用于文本搜索的严格算法或库

时间:2022-09-13 08:05:33

The Problem:

问题:

I need a good free library or algorithm to determine whether a text is related to a search pattern or not. The search pattern can be an ordered or unordered list of words. For some searches the order is relevant, for some it is not. Additionally I need the ability to define aliases for searched words (e.g. "(C#|C sharp) code").

我需要一个好的免费库或算法来确定文本是否与搜索模式相关。搜索模式可以是有序或无序的单词列表。对于某些搜索,订单是相关的,有些则不是。另外,我需要能够为搜索的单词定义别名(例如“(C#| C sharp)code”)。

I doubt that there is a free cheap c# library meeting all my requests.

我怀疑有一个免费的廉价c#库符合我的所有要求。

Which libraries/algorithms would you use to implement that functionality? I´m grateful for any tip.

您将使用哪些库/算法来实现该功能?我很感激任何小费。

EDIT: I need this to filter search results from multiple specialized search services. The resulting program must be VERY strict, so false negatives are no problem.False positives should be avoided(as far as possible).

编辑:我需要这个来过滤多个专业搜索服务的搜索结果。由此产生的程序必须非常严格,因此假阴性是没有问题的。应该避免误报(尽可能)。

1 个解决方案

#1


1  

For free, start here with the builtin Regex namespace/class:

免费的,从内置的Regex命名空间/类开始:

http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.aspx

http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.aspx

More sophisticated search is unlikely to come for free (cf. Google Search Appliance or similar).

更复杂的搜索不太可能免费提供(参见Google Search Appliance或类似搜索)。

#1


1  

For free, start here with the builtin Regex namespace/class:

免费的,从内置的Regex命名空间/类开始:

http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.aspx

http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.aspx

More sophisticated search is unlikely to come for free (cf. Google Search Appliance or similar).

更复杂的搜索不太可能免费提供(参见Google Search Appliance或类似搜索)。