From 33542f0c1878db545a40296f17a56bae24350c3a Mon Sep 17 00:00:00 2001 From: Konstantin Baierer Date: Thu, 6 Dec 2018 13:16:31 +0100 Subject: [PATCH] more intuitive ID for output file, #26 --- ocrd_tesserocr/recognize.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ocrd_tesserocr/recognize.py b/ocrd_tesserocr/recognize.py index 79b7af4..db506ae 100644 --- a/ocrd_tesserocr/recognize.py +++ b/ocrd_tesserocr/recognize.py @@ -113,11 +113,11 @@ def process(self): if not regions: log.warning("Page contains no text regions") self._process_regions(regions, maxlevel, tessapi) - ID = concat_padded(self.output_file_grp, n) + ID = concat_padded(self.output_file_grp, int(re.replace('[^\d]', '', input_file.ID))) self.workspace.add_file( ID=ID, file_grp=self.output_file_grp, - basename=ID + '.xml', + basename="%s.xml" % ID, mimetype=MIMETYPE_PAGE, content=to_xml(pcgts), )