修复分割函数中使用的变量错误 (#1443)

* Fix force_breakdown function parameter name

* Add handling for PDFs with lowercase starting paragraphs

* Change first lowercase word in meta_txt to uppercase
This commit is contained in:
Menghuan1918
2024-01-03 19:49:17 +08:00
committed by GitHub
parent a96f842b3a
commit aba871342f
2 changed files with 5 additions and 2 deletions

View File

@@ -466,6 +466,9 @@ def read_and_clean_pdf_text(fp):
return True
else:
return False
# 对于某些PDF会有第一个段落就以小写字母开头,为了避免索引错误将其更改为大写
if starts_with_lowercase_word(meta_txt[0]):
meta_txt[0] = meta_txt[0].capitalize()
for _ in range(100):
for index, block_txt in enumerate(meta_txt):
if starts_with_lowercase_word(block_txt):