You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/BuildReport/Scripts/Editor/FuzzyString/TanimotoCoefficient.cs

20 lines
396 B
C#

1 month ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FuzzyString
{
public static partial class ComparisonMetrics
{
public static double TanimotoCoefficient(this string source, string target)
{
double Na = source.Length;
double Nb = target.Length;
double Nc = source.Intersect(target).Count();
return Nc / (Na + Nb - Nc);
}
}
}