Fix: adapt to old configurations. (#6321)

### What problem does this PR solve?

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu 2025-03-20 14:50:59 +08:00 committed by GitHub
parent 5b04b7d972
commit 95497b4aab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -263,6 +263,8 @@ def chunk(filename, binary=None, from_page=0, to_page=100000,
elif re.search(r"\.pdf$", filename, re.IGNORECASE):
layout_recognizer = parser_config.get("layout_recognize", "DeepDOC")
if isinstance(layout_recognizer, bool):
layout_recognizer = "DeepDOC" if layout_recognizer else "Plain Text"
callback(0.1, "Start to parse.")
if layout_recognizer == "DeepDOC":