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

Function _looks_like_data_row

scripts/extract_pdf_assets.py:80–86  ·  view source on GitHub ↗

Heuristic: a data row from a tabular layout, not part of a caption.

(text: str)

Source from the content-addressed store, hash-verified

78
79
80def _looks_like_data_row(text: str) -> bool:
81 """Heuristic: a data row from a tabular layout, not part of a caption."""
82 tokens = text.split()
83 if len(tokens) < 3:
84 return False
85 numeric_tokens = sum(1 for tok in tokens if _NUMERIC_TOKEN_RE.match(tok))
86 return numeric_tokens >= max(2, len(tokens) // 2)
87
88
89def _looks_like_text_table_row(text: str) -> bool:

Callers 5

_find_caption_blocksFunction · 0.85
_find_paragraph_blocksFunction · 0.85
_row_is_table_likeFunction · 0.85
_grow_table_regionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected