(line: str)
| 1590 | |
| 1591 | |
| 1592 | def clean_pdf_line(line: str) -> str: |
| 1593 | line = re.sub(r"\s+", " ", normalize_pdf_text_artifacts(line or "")).strip() |
| 1594 | if not line: |
| 1595 | return "" |
| 1596 | if re.fullmatch(r"\d+", line): |
| 1597 | return "" |
| 1598 | if re.fullmatch(r"page \d+", line.lower()): |
| 1599 | return "" |
| 1600 | if len(line) <= 2 and not re.search(r"[\u3400-\u9fff]", line): |
| 1601 | return "" |
| 1602 | return line |
| 1603 | |
| 1604 | |
| 1605 | def normalize_heading(line: str) -> str: |
no test coverage detected