Skip to content

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

fix divide by zero bug (#447)

KevinHuSh962c66714e73
diff --git a/deepdoc/parser/pdf_parser.py b/deepdoc/parser/pdf_parser.py
index b3528581c6..b8a69245a3 100644
--- a/deepdoc/parser/pdf_parser.py
+++ b/deepdoc/parser/pdf_parser.py
@@ -64,7 +64,7 @@ class HuParser:
"""
def __char_width(self, c):
- return (c["x1"] - c["x0"]) // len(c["text"])
+ return (c["x1"] - c["x0"]) // max(len(c["text"]), 1)
def __height(self, c):
return c["bottom"] - c["top"]