.net core 字符串相似度比较算法:Jaro–Winkler similarity
作者:互联网
一、新建项目:StringSimilarityDemo
<ItemGroup>
<PackageReference Include="F23.StringSimilarity" Version="4.1.0" />
</ItemGroup>
二、Program.cs
using F23.StringSimilarity;
using System;
namespace StringSimilarityDemo
{
class Program
{
static void Main(string[] args)
{
//Jaro-Winkler
var jw = new JaroWinkler();
// substitution of s and t
Console.WriteLine(jw.Similarity("My string", "My tsring"));
// substitution of s and n
Console.WriteLine(jw.Similarity("My string", "My ntrisg"));
}
}
}
运行效果:
标签:core,Console,string,Jaro,Winkler,jw,Program,My 来源: https://blog.csdn.net/xiaoxionglove/article/details/120627074