
    [ǻi                    v    d Z ddlmZ ddlmZ ddlmZ ddlmZ 	 ddl	Z	dZ
 G d	 d
e      Zy# e$ r dZ
Y w xY w)zKonlpy text splitter.    )annotations)Any)override)TextSplitterNTFc                  D     e Zd ZdZ	 d	 	 	 	 	 d fdZedd       Z xZS )KonlpyTextSplitterzTSplitting text using Konlpy package.

    It is good for splitting Korean text.
    c                    t        |   di | || _        t        sd}t	        |      t
        j                  j                         | _        y)zInitialize the Konlpy text splitter.

        Args:
            separator: The separator to use when combining splits.

        Raises:
            ImportError: If Konlpy is not installed.
        zv
                Konlpy is not installed, please install it with
                `pip install konlpy`
                N )	super__init__
_separator_HAS_KONLPYImportErrorkonlpytagKkmakkma)self	separatorkwargsmsg	__class__s       ]/opt/lhia/marcimex/agent/venv/lib/python3.12/site-packages/langchain_text_splitters/konlpy.pyr   zKonlpyTextSplitter.__init__   sE     	"6"#C c""JJOO%	    c                p    | j                   j                  |      }| j                  || j                        S )N)r   	sentences_merge_splitsr   )r   textsplitss      r   
split_textzKonlpyTextSplitter.split_text0   s-    $$T*!!&$//::r   )z

)r   strr   r   returnNone)r   r!   r"   z	list[str])__name__
__module____qualname____doc__r   r   r    __classcell__)r   s   @r   r   r      sB      && & 
	&. ; ;r   r   )r'   
__future__r   typingr   typing_extensionsr   langchain_text_splitters.baser   r   r   r   r   r
   r   r   <module>r-      sC     "  & 6K
 ;  ;	  Ks   . 88