其他分享
首页 > 其他分享> > .Net Core两字符串相似度比较

.Net Core两字符串相似度比较

作者:互联网

NuGet:  F23.StringSimilarity

github: https://github.com/feature23/StringSimilarity.NET

 

internal class Program
    {
        static void Main(string[] args)
        {
            var instance1 = new JaroWinkler();

            // 0.43703702092170715
            var x1 = instance1.Similarity("old mysql", "mysql");
            // 0.43703702092170715
            var x2 = instance1.Similarity("mysql", "old mysql");

            // 0.86666661500930786
            var x3 = instance1.Similarity("支付宝提现至基本户", "内部调拨(支付宝提现至基本户)");
            // 0.86666661500930786
            var x4 = instance1.Similarity("内部调拨(支付宝提现至基本户)", "支付宝提现至基本户");

            Console.WriteLine($"x1:{x1}");
            Console.WriteLine($"x2:{x2}");
            Console.WriteLine($"x3:{x3}");
            Console.WriteLine($"x4:{x4}");
        }
       
    }

 

 

 

标签:Core,Console,Similarity,var,instance1,WriteLine,mysql,字符串,Net
来源: https://www.cnblogs.com/sportsky/p/16197873.html