This paper describes a method for off-line recognition of handprinted and cursive words. The module takes as input a binary word image and a lexicon of strings, and ranks the lexicon according to the likelihood of match to the given word image. To perform recognition, a set of character models is used. The models employ a graph representation. Each character model consists of a set of features in spatial relationship to one another. The character models are automatically built in a clustering process. Character merging is performed by finding the appropriate correspondences between pairs of character sample features. This is accomplished by finding a solution to the assignment problem, which is an O(n3) linear programming algorithm. The end result of the training process is a set of random graph character prototypes for each character class. Because it is not possible to clearly segment the word image into characters before recognition, segmentation and recognition are bound together in a dynamic programming process. Results are presented for a set of word images extracted from mailpieces in the live mailstream.