Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix parsing spaces in russian language PDFs (#1987) (#2427)

Vitaliy Groshev7e75b9d77846
diff --git a/deepdoc/parser/pdf_parser.py b/deepdoc/parser/pdf_parser.py
index 0afc67ab16..5723ad6184 100644
--- a/deepdoc/parser/pdf_parser.py
+++ b/deepdoc/parser/pdf_parser.py
@@ -299,7 +299,7 @@ class RAGFlowPdfParser:
self.lefted_chars.append(c)
continue
if c["text"] == " " and bxs[ii]["text"]:
- if re.match(r"[0-9a-zA-Z,.?;:!%%]", bxs[ii]["text"][-1]):
+ if re.match(r"[0-9a-zA-Zа-яА-Я,.?;:!%%]", bxs[ii]["text"][-1]):
bxs[ii]["text"] += " "
else:
bxs[ii]["text"] += c["text"]