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

Function _classify_caption_kind

scripts/extract_pdf_assets.py:215–221  ·  view source on GitHub ↗

Return 'table' if the caption label starts with 'Table', else 'figure'.

(label: str)

Source from the content-addressed store, hash-verified

213
214
215def _classify_caption_kind(label: str) -> str:
216 """Return 'table' if the caption label starts with 'Table', else 'figure'."""
217 return (
218 "table"
219 if re.match(r"^(?:(?:supplementary|extended\s+data)\s+)?table\b", label.strip(), re.IGNORECASE)
220 else "figure"
221 )
222
223
224def parser() -> argparse.ArgumentParser:

Calls

no outgoing calls