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

Function _line_starts

scripts/section_parser.py:66–72  ·  view source on GitHub ↗

每行起始字符偏移。lines[i] 起始于 starts[i]。

(text: str)

Source from the content-addressed store, hash-verified

64
65
66def _line_starts(text: str) -> list[int]:
67 """每行起始字符偏移。lines[i] 起始于 starts[i]。"""
68 starts = [0]
69 for i, ch in enumerate(text):
70 if ch == "\n":
71 starts.append(i + 1)
72 return starts
73
74
75def _classify_lines(lines: list[str]) -> list[str]:

Callers 1

split_blocksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected