1. A method of character recognition comprising: capturing, by a character-recognition system, a scan of a document; segmenting, by the character-recognition system, the scan into a sequence of character images; generating, by the character-recognition system, a sequence of identifiers based on the character images, wherein each identifier in the sequence of identifiers represents a particular character, and wherein the generating comprises: assigning an identifier to a first character image in the sequence of images; for each subsequent character image in the sequence of images, comparing the subsequent character image to one or more character images that precede the subsequent character image in the sequence of character images; for each subsequent character image that matches one of the previous character images based on the comparison, assigning the identifier that is assigned to the one character image to the subsequent image; and for each subsequent character image that does not match one of the previous character images based on the comparison, assigning a new identifier that is different from each identifier previously assigned; and obtaining, by the character-recognition system, text based on the sequence of identifiers, the obtaining comprising: comparing the sequence of identifiers to a plurality of identifier sequences, each identifier sequence corresponding to a sequence of characters; and identifying as the text a sequence of characters corresponding to an identifier sequence that matches the sequence of identifiers.
1. A method of character recognition comprising: capturing, by a character-recognition system, a scan of a document; segmenting, by the character-recognition system, the scan into a sequence of character images; generating, by the character-recognition system, a sequence of identifiers based on the character images, wherein each identifier in the sequence of identifiers represents a particular character, and wherein the generating comprises: assigning an identifier to a first character image in the sequence of images; for each subsequent character image in the sequence of images, comparing the subsequent character image to one or more character images that precede the subsequent character image in the sequence of character images; for each subsequent character image that matches one of the previous character images based on the comparison, assigning the identifier that is assigned to the one character image to the subsequent image; and for each subsequent character image that does not match one of the previous character images based on the comparison, assigning a new identifier that is different from each identifier previously assigned; and obtaining, by the character-recognition system, text based on the sequence of identifiers, the obtaining comprising: comparing the sequence of identifiers to a plurality of identifier sequences, each identifier sequence corresponding to a sequence of characters; and identifying as the text a sequence of characters corresponding to an identifier sequence that matches the sequence of identifiers. 3. The method of claim 1 , wherein generating the sequence of identifiers based on the one or more character images comprises: initializing a value of an identifier; and for each character image of the character images: determining a character represented by the character image; determining whether an identifier representing the character is already stored as part of the sequence of identifiers; in response to determining that the identifier representing the character is not already stored as part of the sequence of identifiers: incrementing the value of the identifier; storing the value of the identifier as part of the sequence of identifiers; and outputting the value of the identifier.