Ejemplo n.º 1
0
 private static void AddMisspellingsTo(IDictionary<Tuple<string, string>, int> missIndex, LevensteinInfo info)
 {
     var misspelling = info.GetMisspelling();
     if (!missIndex.ContainsKey(misspelling))
         missIndex[misspelling] = 0;
     missIndex[misspelling]++;
 }
Ejemplo n.º 2
0
 public void TestGettingMisspellings(string s1, string s2, string c1, string c2)
 {
     var levensteinInfo = new LevensteinInfo(s1, s2);
     var misspelling = levensteinInfo.GetMisspelling();
     Assert.AreEqual(misspelling.Item1, c1);
     Assert.AreEqual(misspelling.Item2, c2);
 }
Ejemplo n.º 3
0
 private void AddMisspellingsWords(LevensteinInfo info)
 {
     var misspelling = info.GetMisspelling();
     if (!misspellingsToWords.ContainsKey(misspelling))
         misspellingsToWords[misspelling] = new List<Tuple<string, string>>();
     misspellingsToWords[misspelling].Add(Tuple.Create(info.GetDictionaryWord(), info.GetWord()));
 }
Ejemplo n.º 4
0
 public void TestLevenstein(string s1, string s2, int answer)
 {
     var levensteinInfo = new LevensteinInfo(s1, s2);
     Assert.AreEqual(answer, levensteinInfo.GetDistance());
 }