소스 검색

add space between index num and title text

gaotingquan 8 달 전
부모
커밋
1650693161
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  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(
                         ".",