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

Function _caption_match_is_inline_reference

scripts/extract_pdf_assets.py:371–380  ·  view source on GitHub ↗

Reject prose references such as "Table 8 summarizes ...".

(line_text: str, match: re.Match[str])

Source from the content-addressed store, hash-verified

369
370
371def _caption_match_is_inline_reference(line_text: str, match: re.Match[str]) -> bool:
372 """Reject prose references such as "Table 8 summarizes ..."."""
373 tail = line_text[match.end():]
374 if not tail or not tail[0].isspace():
375 return False
376 rest = tail.strip()
377 if not rest:
378 return False
379 first_word = re.match(r"[A-Za-z]+", rest)
380 return bool(first_word and first_word.group(0)[0].islower())
381
382
383def _collect_xref_rects(page) -> list[tuple[float, float, float, float]]:

Calls

no outgoing calls