mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 06:50:53 +00:00
style: fix lint issues in ocr_blocks.py and ocr_pdf_spans.py
This commit is contained in:
parent
ccd08abb58
commit
fe5e7bc0e2
2 changed files with 9 additions and 3 deletions
|
|
@ -131,7 +131,10 @@ def build_structured_blocks(
|
|||
"ocr_raw_error",
|
||||
}:
|
||||
render_default = False
|
||||
if role.role in {"noise", "frontmatter_noise", "table_html", "non_body_insert", "structured_insert", "ocr_raw_error"}:
|
||||
if role.role in {
|
||||
"noise", "frontmatter_noise", "table_html",
|
||||
"non_body_insert", "structured_insert", "ocr_raw_error",
|
||||
}:
|
||||
index_default = False
|
||||
row = {
|
||||
"paper_id": block["paper_id"],
|
||||
|
|
@ -259,7 +262,10 @@ def build_structured_blocks(
|
|||
}:
|
||||
row["render_default"] = False
|
||||
row["index_default"] = role not in _CANDIDATE_ROLES
|
||||
if role in {"noise", "frontmatter_noise", "table_html", "non_body_insert", "structured_insert", "ocr_raw_error"}:
|
||||
if role in {
|
||||
"noise", "frontmatter_noise", "table_html",
|
||||
"non_body_insert", "structured_insert", "ocr_raw_error",
|
||||
}:
|
||||
row["index_default"] = False
|
||||
|
||||
# Persist document structure artifact for downstream debugging
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ def _words_to_text(words: list[tuple]) -> str:
|
|||
current_y: float | None = None
|
||||
|
||||
for w in words:
|
||||
x0, y0, x1, y1, text = w[0], w[1], w[2], w[3], str(w[4]).strip()
|
||||
x0, y0, text = w[0], w[1], str(w[4]).strip()
|
||||
if not text:
|
||||
continue
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue