MCPcopy Index your code
hub / github.com/OpenBMB/ChatDev / _parse_header

Function _parse_header

functions/function_calling/deep_research.py:187–192  ·  view source on GitHub ↗

Returns (level, title) if line is a header, else (0, "").

(line: str)

Source from the content-addressed store, hash-verified

185
186
187def _parse_header(line: str) -> Tuple[int, str]:
188 """Returns (level, title) if line is a header, else (0, "")."""
189 match = re.match(r"^(#+)\s+(.+)$", line)
190 if match:
191 return len(match.group(1)), match.group(2).strip()
192 return 0, ""
193
194
195def _find_chapter_range(lines: List[str], title_path: str) -> Tuple[int, int]:

Callers 3

_find_chapter_rangeFunction · 0.85
report_outlineFunction · 0.85
report_create_chapterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected