A chain CRF for OCR