Classification and postprocessing of documents using an error-correcting parser