Prechádzať zdrojové kódy

add space between index num and title text

gaotingquan 8 mesiacov pred
rodič
commit
1650693161

+ 3 - 0
paddlex/inference/pipelines/layout_parsing/result_v2.py

@@ -242,6 +242,9 @@ class LayoutParsingResultV2(BaseCVResult, HtmlMixin, XlsxMixin, MarkdownMixin):
 
             def format_title(content_value):
                 content_value = content_value.rstrip(".")
+                content_value = re.sub(
+                    r"(\d+|[一二三四五六七八九十]+)([.、]?)\s*", r"\1\2 ", content_value
+                )
                 level = (
                     content_value.count(
                         ".",