Heuristic: a data row from a tabular layout, not part of a caption.
(text: str)
| 78 | |
| 79 | |
| 80 | def _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 | |
| 89 | def _looks_like_text_table_row(text: str) -> bool: |
no outgoing calls
no test coverage detected