style: fix lint issues in ocr_blocks.py and ocr_pdf_spans.py

This commit is contained in:
Research Assistant 2026-06-17 15:48:38 +08:00
parent ccd08abb58
commit fe5e7bc0e2
2 changed files with 9 additions and 3 deletions

View file

@ -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

View file

@ -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