Reject prose references such as "Table 8 summarizes ...".
(line_text: str, match: re.Match[str])
| 369 | |
| 370 | |
| 371 | def _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 | |
| 383 | def _collect_xref_rects(page) -> list[tuple[float, float, float, float]]: |
no outgoing calls