Robustly correcting mistakes made by OCR software