相关疑难解决方法(0)

在C#中匹配的模糊文本(句子/标题)

嘿,我正在使用Levenshteins算法来获得源和目标字符串之间的距离.

我也有从0到1返回值的方法:

/// <summary>
/// Gets the similarity between two strings.
/// All relation scores are in the [0, 1] range, 
/// which means that if the score gets a maximum value (equal to 1) 
/// then the two string are absolutely similar
/// </summary>
/// <param name="string1">The string1.</param>
/// <param name="string2">The string2.</param>
/// <returns></returns>
public static float CalculateSimilarity(String s1, String s2)
{
    if ((s1 == null) || (s2 == null)) return 0.0f;

    float dis = LevenshteinDistance.Compute(s1, s2); …
Run Code Online (Sandbox Code Playgroud)

c# string algorithm fuzzy-search

22
推荐指数
3
解决办法
2万
查看次数

比较两个字符串产生数字增量

有没有人知道一种简单的方法来比较两个字符串,以产生两者之间的"差异"?(在一个数值)我一直在抓住谷歌运气不好.在做了一些编码后,它并不像我想象的那么简单.有线索吗?

string comparison

4
推荐指数
1
解决办法
1150
查看次数

标签 统计

string ×2

algorithm ×1

c# ×1

comparison ×1

fuzzy-search ×1