Home / Function/ _match_header() — langchain Function Reference

_match_header() — langchain Function Reference

Architecture documentation for the _match_header() function in markdown.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  e4272ad6_fa6c_2270_2b87_1b76f6930a95["_match_header()"]
  cd7394a9_9856_dc15_cb00_078cf42f0529["ExperimentalMarkdownSyntaxTextSplitter"]
  e4272ad6_fa6c_2270_2b87_1b76f6930a95 -->|defined in| cd7394a9_9856_dc15_cb00_078cf42f0529
  ca4b44a0_217b_9ee3_738c_a86f47cf5d13["split_text()"]
  ca4b44a0_217b_9ee3_738c_a86f47cf5d13 -->|calls| e4272ad6_fa6c_2270_2b87_1b76f6930a95
  style e4272ad6_fa6c_2270_2b87_1b76f6930a95 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/text-splitters/langchain_text_splitters/markdown.py lines 464–469

    def _match_header(self, line: str) -> re.Match[str] | None:
        match = re.match(r"^(#{1,6}) (.*)", line)
        # Only matches on the configured headers
        if match and match.group(1) in self.splittable_headers:
            return match
        return None

Subdomains

Called By

Frequently Asked Questions

What does _match_header() do?
_match_header() is a function in the langchain codebase, defined in libs/text-splitters/langchain_text_splitters/markdown.py.
Where is _match_header() defined?
_match_header() is defined in libs/text-splitters/langchain_text_splitters/markdown.py at line 464.
What calls _match_header()?
_match_header() is called by 1 function(s): split_text.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free