Search code examples
ocrmetricslevenshtein-distance

OCR: weighted Levenshtein distance


I'm trying to create an optical character recognition system with the dictionary.

In fact I don't have an implemented dictionary yet=)

I've heard that there are simple metrics based on Levenstein distance which take in account different distance between different symbols. E.g. 'N' and 'H' are very close to each other and d("THEATRE", "TNEATRE") should be less than d("THEATRE", "TOEATRE") which is impossible using basic Levenstein distance.

Could you help me locating such metric, please.


Solution

  • This might be what you are looking for: http://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance (and kindly some working code is included in the link)

    Update:

    http://nlp.stanford.edu/IR-book/html/htmledition/edit-distance-1.html