Skip to content

Commit 52ee884

Browse files
committed
fix: Docx segmented font title recognition
1 parent c39a6e8 commit 52ee884

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

apps/common/handle/impl/doc_split_handle.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,7 @@ def get_image_id(image_id):
112112

113113
title_font_list = [
114114
[36, 100],
115-
[26, 36],
116-
[24, 26],
117-
[22, 24],
118-
[18, 22],
119-
[16, 18]
115+
[30, 36]
120116
]
121117

122118

@@ -130,7 +126,7 @@ def get_title_level(paragraph: Paragraph):
130126
if len(paragraph.runs) == 1:
131127
font_size = paragraph.runs[0].font.size
132128
pt = font_size.pt
133-
if pt >= 16:
129+
if pt >= 30:
134130
for _value, index in zip(title_font_list, range(len(title_font_list))):
135131
if pt >= _value[0] and pt < _value[1]:
136132
return index + 1

0 commit comments

Comments
 (0)