1

Consider the C# implementation of the LD-distance calculation-algorithm suggested on this Wiki page.

I'd like to extend it with a capability to abort the calculation-process in case a certain (pre-defined) distance-threshold has already been exceeded.

This conceptual optimization-approach was suggested by Alex Martelli on this thread.

The question is: How can this solution be implemented over the suggested C# solution? { Side-Note: Function should return the maximal distance found until its return. }

Thanks much.

Community
  • 1
  • 1
Bliss
  • 426
  • 2
  • 5
  • 19
  • @Qnan: Try **it**? If you refer to Alex's suggested solution - although I understand it conceptually, I don't know how to implement it, and specifically - on the mentioned C# implementation. I found an answer of yours to a [similar question](http://stackoverflow.com/questions/11735576/levenshtein-algorithm-fail-fast-if-edit-distance-is-bigger-than-a-given-thresh) regarding a certain Delphi implementation, but could not port it to the C# impl. under discussion, nor did I find how to retrieve the maximum distance found, to be returned by the function. Your advise would be appreciated. – Bliss Oct 25 '12 at 20:22
  • It seems that you don't really understand how the algorithm works. Try to find a good manual on dynamic programming, or something more elaborate on edit distance - the thing you want to do is fairly trivial. – Ivan Vergiliev Oct 25 '12 at 20:37
  • @YanRaf SO is a QA site, so people are expected to ask *specific* questions. If you don't quite understand the algorithm, look up a more detailed explanation, if you are not comfortable coding in C# -- find out more about the language or use another one instead. Please don't take this as criticism, but as a clarification. – Qnan Oct 25 '12 at 21:58

0 Answers0