Patent ID: 7406201

Claim:
A method, implemented by a computer, for encoding characters appearing in an area of an image in order to generate a corresponding output string of character codes, the method comprising the following steps, carried out by the computer: identifying one or more sequences of the character codes that are known to result frequently due a segmentation error in application of a pattern recognition process, and associating a respective extension character code with each of the sequences, wherein each of the one or more sequences of the character codes is generated due to incorrect segmentation of a respective original character having a respective original character code; dividing the area of the image into segments such that each segment contains approximately one character; applying the pattern recognition process to each of the segments in order to generate an input string of character codes, the input string comprising a respective character code for each of the segments; locating at least one of the sequences of the character codes in the input string, and replacing the at least one of the sequences with the respective extension character code so as to generate a modified string; and determining the output string by finding an approximate match between the modified string and a known string in a directory of known strings by computing respective edit distances between the modified string and a plurality of the known strings based on respective costs of edit operations involving the extension character code, and selecting the one of the known strings responsively to the respective edit distances, wherein a cost of zero is assigned to a transformation of the respective extension character code associated with each of the sequences to the respective original character code.