MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / clean_pdf_line

Function clean_pdf_line

scripts/common.py:1592–1602  ·  view source on GitHub ↗
(line: str)

Source from the content-addressed store, hash-verified

1590
1591
1592def 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
1605def normalize_heading(line: str) -> str:

Callers 7

extract_raw_sectionsFunction · 0.90
pdf_coverage_summaryFunction · 0.85
appendix_section_titleFunction · 0.85
extract_pdf_sectionsFunction · 0.85
extract_caption_linesFunction · 0.85

Calls 1

Tested by

no test coverage detected