mirror of
https://github.com/hwchase17/langchain
synced 2024-11-02 09:40:22 +00:00
16 lines
546 B
Python
16 lines
546 B
Python
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from langchain_text_splitters.base import Language
|
|
from langchain_text_splitters.character import RecursiveCharacterTextSplitter
|
|
|
|
|
|
class LatexTextSplitter(RecursiveCharacterTextSplitter):
|
|
"""Attempts to split the text along Latex-formatted layout elements."""
|
|
|
|
def __init__(self, **kwargs: Any) -> None:
|
|
"""Initialize a LatexTextSplitter."""
|
|
separators = self.get_separators_for_language(Language.LATEX)
|
|
super().__init__(separators=separators, **kwargs)
|