Explorar o código

add space between index num and title text

gaotingquan hai 8 meses
pai
achega
1650693161
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      paddlex/inference/pipelines/layout_parsing/result_v2.py

+ 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(
                         ".",