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

Function section_id

scripts/extract_source_text.py:86–90  ·  view source on GitHub ↗
(base: str, seen: dict[str, int])

Source from the content-addressed store, hash-verified

84
85
86def section_id(base: str, seen: dict[str, int]) -> str:
87 safe = re.sub(r"[^a-z0-9]+", "-", normalize_heading(base)).strip("-") or "section"
88 seen[safe] = seen.get(safe, 0) + 1
89 suffix = "" if seen[safe] == 1 else f"-{seen[safe]}"
90 return f"sec:{safe}{suffix}"
91
92
93def text_hash(text: str) -> str:

Callers 1

new_recordFunction · 0.85

Calls 1

normalize_headingFunction · 0.90

Tested by

no test coverage detected