From 0c14306889b56152760c3f012663fbcccca99116 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Tue, 22 Apr 2025 14:51:45 +0800 Subject: [PATCH] fix: Docx segmented font title recognition (#2949) --- apps/common/handle/impl/doc_split_handle.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/common/handle/impl/doc_split_handle.py b/apps/common/handle/impl/doc_split_handle.py index 1df7b6a66..4161f13a1 100644 --- a/apps/common/handle/impl/doc_split_handle.py +++ b/apps/common/handle/impl/doc_split_handle.py @@ -112,11 +112,7 @@ def get_image_id_func(): title_font_list = [ [36, 100], - [26, 36], - [24, 26], - [22, 24], - [18, 22], - [16, 18] + [30, 36] ] @@ -130,7 +126,7 @@ def get_title_level(paragraph: Paragraph): if len(paragraph.runs) == 1: font_size = paragraph.runs[0].font.size pt = font_size.pt - if pt >= 16: + if pt >= 30: for _value, index in zip(title_font_list, range(len(title_font_list))): if pt >= _value[0] and pt < _value[1]: return index + 1