Skip to content

Commit

Permalink
Update symspell.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgarbe committed Mar 25, 2014
1 parent f8f3465 commit 89635a5
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions symspell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ private class editItem
public string term = "";
public int distance = 0;



public override bool Equals(object obj)
{
return Equals(term, ((editItem)obj).term);
Expand Down Expand Up @@ -136,7 +134,6 @@ private static bool CreateDictionaryEntry(string key, string language)
suggestion.term = key;
suggestion.distance = delete.distance;


dictionaryItem value2;
if (dictionary.TryGetValue(language+delete.term, out value2))
{
Expand Down Expand Up @@ -195,7 +192,6 @@ private static List<editItem> Edits(string word, int editDistance, bool recursio
{
editItem delete = new editItem();
delete.term=word.Remove(i, 1);

delete.distance=editDistance;
if (!deletes.Contains(delete))
{
Expand All @@ -217,17 +213,6 @@ private static List<editItem> Edits(string word, int editDistance, bool recursio

private static int TrueDistance(editItem dictionaryOriginal, editItem inputDelete, string inputOriginal)
{











//We allow simultaneous edits (deletes) of editDistanceMax on on both the dictionary and the input term.
//For replaces and adjacent transposes the resulting edit distance stays <= editDistanceMax.
//For inserts and deletes the resulting edit distance might exceed editDistanceMax.
Expand Down Expand Up @@ -335,7 +320,6 @@ private static void Correct(string input, string language)
List<suggestItem> suggestions = null;

/*
//Benchmark: 1000 x Lookup
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
Expand All @@ -346,7 +330,6 @@ private static void Correct(string input, string language)
stopWatch.Stop();
Console.WriteLine(stopWatch.ElapsedMilliseconds.ToString());
*/


//check in dictionary for existence and frequency; sort by edit distance, then by word frequency
suggestions = Lookup(input, language, editDistanceMax);
Expand Down

0 comments on commit 89635a5

Please sign in to comment.