Example #1
0
 /// <summary>
 /// Get the edit distance between two strings; adjust the result depending on length of the first.
 /// Weights in the function are heristically adjusted to improve duplicate finding.
 /// </summary>
 private double GetScaledDistance(string stringA, string stringB)
 {
     return(_editDist.GetDistance(stringA, stringB) * 7.0 / (stringA.Length + 1.0));
 }
Example #2
0
 public void GetDistanceEmptyWordTest()
 {
     Assert.That(_levDist.GetDistance("", ""), Is.EqualTo(0));
     Assert.That(_levDist.GetDistance(BaseWord, ""), Is.EqualTo(DelCost * BaseWord.Length));
     Assert.That(_levDist.GetDistance("", BaseWord), Is.EqualTo(InsCost * BaseWord.Length));
 }