.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"));

        }
    }
}

运行效果:

.net core 字符串相似度比较算法:Jaro–Winkler similarity

 

上一篇:gfortran开启preprocessor macros


下一篇:排队打水问题