From ed5f81b02e8237c303be48cae1be8aef910156ca Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Mon, 14 Apr 2025 11:00:11 +0800 Subject: [PATCH] Fix: abnormal cell mergeing. (#6991) ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- deepdoc/vision/table_structure_recognizer.py | 2 +- rag/app/manual.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/deepdoc/vision/table_structure_recognizer.py b/deepdoc/vision/table_structure_recognizer.py index 64ad8b92..470abc3b 100644 --- a/deepdoc/vision/table_structure_recognizer.py +++ b/deepdoc/vision/table_structure_recognizer.py @@ -133,7 +133,7 @@ class TableStructureRecognizer(Recognizer): return "Ot" @staticmethod - def construct_table(boxes, is_english=False, html=False, **kwargs): + def construct_table(boxes, is_english=False, html=True, **kwargs): cap = "" i = 0 while i < len(boxes): diff --git a/rag/app/manual.py b/rag/app/manual.py index 5de782d6..a05670a0 100644 --- a/rag/app/manual.py +++ b/rag/app/manual.py @@ -162,6 +162,8 @@ class Docx(DocxParser): if c.text == r.cells[j].text: span += 1 i = j + else: + break i += 1 html += f"{c.text}" if span == 1 else f"{c.text}" html += ""