Clarify official and feature categories

This commit is contained in:
Jacky Ser
2026-08-11 00:14:20 +08:00
parent 0351c47684
commit 66ef28bdeb
3 changed files with 35 additions and 17 deletions

View File

@@ -142,6 +142,12 @@ def main() -> None:
with pdfplumber.open(PDF_PATH) as pdf:
for page_number, page in enumerate(pdf.pages, 1):
category = CATEGORY_BY_PAGE[page_number]
page_text = clean(page.extract_text() or "")
expected_heading = f"{category}产品明细表"
if expected_heading not in page_text:
raise RuntimeError(
f"Category heading mismatch on page {page_number}: expected {expected_heading}"
)
tables = page.find_tables()
if not tables:
raise RuntimeError(f"No table found on page {page_number}")