Home / Function/ test_iterative_text_splitter() — langchain Function Reference

test_iterative_text_splitter() — langchain Function Reference

Architecture documentation for the test_iterative_text_splitter() function in test_text_splitters.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  79f650e3_5879_2de7_1e28_4f7981f94ca5["test_iterative_text_splitter()"]
  6d6b8ad4_1cfe_fbb0_e58e_76a50487c135["test_text_splitters.py"]
  79f650e3_5879_2de7_1e28_4f7981f94ca5 -->|defined in| 6d6b8ad4_1cfe_fbb0_e58e_76a50487c135
  style 79f650e3_5879_2de7_1e28_4f7981f94ca5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/text-splitters/tests/unit_tests/test_text_splitters.py lines 419–447

def test_iterative_text_splitter() -> None:
    """Test iterative text splitter."""
    text = """Hi.\n\nI'm Harrison.\n\nHow? Are? You?\nOkay then f f f f.
This is a weird text to write, but gotta test the splittingggg some how.

Bye!\n\n-H."""
    splitter = RecursiveCharacterTextSplitter(chunk_size=10, chunk_overlap=1)
    output = splitter.split_text(text)
    expected_output = [
        "Hi.",
        "I'm",
        "Harrison.",
        "How? Are?",
        "You?",
        "Okay then",
        "f f f f.",
        "This is a",
        "weird",
        "text to",
        "write,",
        "but gotta",
        "test the",
        "splitting",
        "gggg",
        "some how.",
        "Bye!",
        "-H.",
    ]
    assert output == expected_output

Domain

Subdomains

Frequently Asked Questions

What does test_iterative_text_splitter() do?
test_iterative_text_splitter() is a function in the langchain codebase, defined in libs/text-splitters/tests/unit_tests/test_text_splitters.py.
Where is test_iterative_text_splitter() defined?
test_iterative_text_splitter() is defined in libs/text-splitters/tests/unit_tests/test_text_splitters.py at line 419.

Analyze Your Own Codebase

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

Try Supermodel Free