MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / is_toc_table

Function is_toc_table

scripts/postprocess_fulltext.py:58–61  ·  view source on GitHub ↗

Return True if this table block is a table-of-contents.

(table_lines: list[str])

Source from the content-addressed store, hash-verified

56
57
58def is_toc_table(table_lines: list[str]) -> bool:
59 """Return True if this table block is a table-of-contents."""
60 dot_lines = sum(1 for l in table_lines if is_toc_table_line(l))
61 return dot_lines >= 2 # at least 2 rows with dot-fills = TOC
62
63
64# Headings that precede a TOC table and should be removed with it

Callers 1

remove_toc_tablesFunction · 0.85

Calls 1

is_toc_table_lineFunction · 0.85

Tested by

no test coverage detected