Skip to content

Datasets

The tiny bundled demo text.

lexograph.datasets.load_demo_text()

Return the bundled demo text: Chapter 1 of Pride and Prejudice.

Returns:

Type Description
str

The chapter as a single string, paragraphs separated by blank lines.

Examples:

>>> text = load_demo_text()
>>> text.startswith("It is a truth universally acknowledged")
True
>>> "Bingley" in text
True
Source code in lexograph/datasets/__init__.py
def load_demo_text() -> str:
    """Return the bundled demo text: Chapter 1 of *Pride and Prejudice*.

    Returns:
        The chapter as a single string, paragraphs separated by blank lines.

    Examples:
        >>> text = load_demo_text()
        >>> text.startswith("It is a truth universally acknowledged")
        True
        >>> "Bingley" in text
        True
    """
    return PRIDE_AND_PREJUDICE_CH1