Machine recognition of text using contextual postprocessing