From dcd3256cc71c50bb767b3416b9f91eae902152eb Mon Sep 17 00:00:00 2001 From: zhangwei13 Date: Thu, 7 Aug 2025 16:22:23 +0800 Subject: [PATCH] fix clean text bug --- dots_ocr/utils/format_transformer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dots_ocr/utils/format_transformer.py b/dots_ocr/utils/format_transformer.py index b2a2123..de4b3e0 100755 --- a/dots_ocr/utils/format_transformer.py +++ b/dots_ocr/utils/format_transformer.py @@ -136,7 +136,8 @@ def clean_text(text: str) -> str: text = text.strip() # Replace multiple consecutive whitespace characters with a single space - text = re.sub(r'\s+', ' ', text) + if text[:2] == '`$' and text[-2:] == '$`': + text = text[1:-1] return text