MCPcopy Create free account
hub / github.com/VectifyAI/PageIndex / remove_first_physical_index_section

Function remove_first_physical_index_section

pageindex/page_index.py:494–504  ·  view source on GitHub ↗

Removes the first section between and tags, and returns the remaining text.

(text)

Source from the content-addressed store, hash-verified

492
493
494def remove_first_physical_index_section(text):
495 """
496 Removes the first section between <physical_index_X> and <physical_index_X> tags,
497 and returns the remaining text.
498 """
499 pattern = r'<physical_index_\d+>.*?<physical_index_\d+>'
500 match = re.search(pattern, text, re.DOTALL)
501 if match:
502 # Remove the first matched section
503 return text.replace(match.group(0), '', 1)
504 return text
505
506### add verify completeness
507def generate_toc_continue(toc_content, part, model=None):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected