MCPcopy Create free account
hub / github.com/Qinbf/groundmap / has_anchors

Function has_anchors

scripts/postprocess.py:81–84  ·  view source on GitHub ↗

启发式:文本中有 ≥3 处形如 ` ^h-2-1-abcdef` / ` ^p-12-7d8e9a` 的尾巴 → 视为已加锚。

(text: str)

Source from the content-addressed store, hash-verified

79
80
81def has_anchors(text: str) -> bool:
82 """启发式:文本中有 ≥3 处形如 ` ^h-2-1-abcdef` / ` ^p-12-7d8e9a` 的尾巴 → 视为已加锚。"""
83 matches = ANCHOR_DETECT_RE.findall(text)
84 return len(matches) >= 3
85
86
87def add_anchors(text: str) -> tuple[str, list[Block]]:

Callers 4

should_convertFunction · 0.90
test_no_anchorsMethod · 0.90
test_with_anchorsMethod · 0.90

Calls

no outgoing calls

Tested by 3

test_no_anchorsMethod · 0.72
test_with_anchorsMethod · 0.72