Home / Function/ test_cobol_code_splitter() — langchain Function Reference

test_cobol_code_splitter() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/text-splitters/tests/unit_tests/test_text_splitters.py lines 798–830

def test_cobol_code_splitter() -> None:
    splitter = RecursiveCharacterTextSplitter.from_language(
        Language.COBOL, chunk_size=CHUNK_SIZE, chunk_overlap=0
    )
    code = """
IDENTIFICATION DIVISION.
PROGRAM-ID. HelloWorld.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 GREETING           PIC X(12)   VALUE 'Hello, World!'.
PROCEDURE DIVISION.
DISPLAY GREETING.
STOP RUN.
    """
    chunks = splitter.split_text(code)
    assert chunks == [
        "IDENTIFICATION",
        "DIVISION.",
        "PROGRAM-ID.",
        "HelloWorld.",
        "DATA DIVISION.",
        "WORKING-STORAGE",
        "SECTION.",
        "01 GREETING",
        "PIC X(12)",
        "VALUE 'Hello,",
        "World!'.",
        "PROCEDURE",
        "DIVISION.",
        "DISPLAY",
        "GREETING.",
        "STOP RUN.",
    ]

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free