o
    `+ i×  ã                   @  s8   d dl mZ d dlmZ d dlmZ G dd„ deƒZdS )é    )Úannotations)ÚAny)ÚTextSplitterc                      s0   e Zd ZdZ	dd‡ fd	d
„Zddd„Z‡  ZS )ÚKonlpyTextSplitterzTSplitting text using Konlpy package.

    It is good for splitting Korean text.
    ú

Ú	separatorÚstrÚkwargsr   ÚreturnÚNonec              
     s\   t ƒ jdi |¤Ž || _zddl}W n ty% } zd}t|ƒ|‚d}~ww |j ¡ | _dS )z$Initialize the Konlpy text splitter.r   Nzv
                Konlpy is not installed, please install it with
                `pip install konlpy`
                © )ÚsuperÚ__init__Ú
_separatorÚkonlpyÚImportErrorÚtagZKkmaÚkkma)Úselfr   r	   r   ÚerrÚmsg©Ú	__class__r   úk/home/app/PaddleOCR-VL-test/.venv_paddleocr/lib/python3.10/site-packages/langchain_text_splitters/konlpy.pyr      s   
€ûzKonlpyTextSplitter.__init__Útextú	list[str]c                 C  s   | j  |¡}|  || j¡S )z&Split incoming text and return chunks.)r   Z	sentencesZ_merge_splitsr   )r   r   Zsplitsr   r   r   Ú
split_text    s   zKonlpyTextSplitter.split_text)r   )r   r   r	   r   r
   r   )r   r   r
   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Ú__classcell__r   r   r   r   r      s
    þr   N)Ú
__future__r   Útypingr   Zlangchain_text_splitters.baser   r   r   r   r   r   Ú<module>   s    