19 using System.Collections.Generic;
38 public float GetDistance(String target, String other)
63 sa = target.ToCharArray();
90 for (i = 0; i <= n; i++)
95 for (j = 1; j <= m; j++)
100 for (i = 1; i <= n; i++)
102 cost = sa[i - 1] == t_j ? 0 : 1;
104 d[i] = Math.Min(Math.Min(d[i - 1] + 1, p[i] + 1), p[i - 1] + cost);
115 return 1.0f - ((float)p[n] / Math.Max(other.Length, sa.Length));