
    ji                     B    d dl Z d dlmZ d dlmZ  G d de          ZdS )    N)partial)replace_punctuationc                       e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdS )BetweenPunctuationz(?<=\s)'(?:[^']|'[a-zA-Z])*'u$   (?<=\s)‘(?:[^’]|’[a-zA-Z])*’z"(?>[^"\\]+|\\{2}|\\.)*"z*"(?=(?P<tmp>[^\"\\]+|\\{2}|\\.)*)(?P=tmp)"u   «(?>[^»\\]+|\\{2}|\\.)*»u.   \«(?=(?P<tmp>[^»\\]+|\\{2}|\\.)*)(?P=tmp)\»u   “(?>[^”\\]+|\\{2}|\\.)*”u1   \“(?=(?P<tmp>[^”\\]+|\\{2}|\\.)*)(?P=tmp)\”z\[(?>[^\]\\]+|\\{2}|\\.)*\]z,\[(?=(?P<tmp>[^\]\\]+|\\{2}|\\.)*)(?P=tmp)\]z\((?>[^\(\)\\]+|\\{2}|\\.)*\)z.\((?=(?P<tmp>[^\(\)\\]+|\\{2}|\\.)*)(?P=tmp)\)z(?<=\s)'(?:[^']|'[a-zA-Z])*'\Sz\-\-(?>[^\-\-])*\-\-z--(?=(?P<tmp>[^--]*))(?P=tmp)--c                     || _         d S N)text)selfr	   s     c/lsinfo/ai/hellotax_ai/base_platform/venv/lib/python3.11/site-packages/pysbd/between_punctuation.py__init__zBetweenPunctuation.__init__/   s    			    c                 6    |                      | j                  S r   ))sub_punctuation_between_quotes_and_parensr	   )r
   s    r   replacezBetweenPunctuation.replace2   s    ==diHHHr   c                 V   |                      |          }|                     |          }|                     |          }|                     |          }|                     |          }|                     |          }|                     |          }|                     |          }|S r   )%sub_punctuation_between_single_quotes,sub_punctuation_between_single_quote_slanted%sub_punctuation_between_double_quotes'sub_punctuation_between_square_bracketssub_punctuation_between_parens$sub_punctuation_between_quotes_arrow!sub_punctuation_between_em_dashes&sub_punctuation_between_quotes_slantedr
   txts     r   r   z<BetweenPunctuation.sub_punctuation_between_quotes_and_parens5   s    88==??DD88==::3??11#6677<<44S9999#>>
r   c                 B    t          j        | j        t          |          S r   )resubBETWEEN_PARENS_REGEX_2r   r   s     r   r   z1BetweenPunctuation.sub_punctuation_between_parens@   s    vd13FLLLr   c                 B    t          j        | j        t          |          S r   )r   r   BETWEEN_SQUARE_BRACKETS_REGEX_2r   r   s     r   r   z:BetweenPunctuation.sub_punctuation_between_square_bracketsC   s!    vd:<O  	r   c                     t          j        | j        |          rt          j        d|          s|S t          j        | j        t          t          d          |          S )Nz'\ssingle)
match_type)r   searchWORD_WITH_LEADING_APOSTROPHEr   BETWEEN_SINGLE_QUOTES_REGEXr   r   r   s     r   r   z8BetweenPunctuation.sub_punctuation_between_single_quotesG   sa    9T6<< 	Yvs++	Jvd61hGGGN N 	Nr   c                 B    t          j        | j        t          |          S r   )r   r   "BETWEEN_SINGLE_QUOTE_SLANTED_REGEXr   r   s     r   r   z?BetweenPunctuation.sub_punctuation_between_single_quote_slantedN   s     vd=)30 0 	0r   c                 B    t          j        | j        t          |          S r   )r   r   BETWEEN_DOUBLE_QUOTES_REGEX_2r   r   s     r   r   z8BetweenPunctuation.sub_punctuation_between_double_quotesR   !    vd8:M  	r   c                 B    t          j        | j        t          |          S r   )r   r   BETWEEN_QUOTE_ARROW_REGEX_2r   r   s     r   r   z7BetweenPunctuation.sub_punctuation_between_quotes_arrowV   s    vd68KSQQQr   c                 B    t          j        | j        t          |          S r   )r   r   BETWEEN_EM_DASHES_REGEX_2r   r   s     r   r   z4BetweenPunctuation.sub_punctuation_between_em_dashesY   s    vd46I3OOOr   c                 B    t          j        | j        t          |          S r   )r   r   BETWEEN_QUOTE_SLANTED_REGEX_2r   r   s     r   r   z9BetweenPunctuation.sub_punctuation_between_quotes_slanted\   r,   r   N)__name__
__module____qualname__r'   r)   BETWEEN_DOUBLE_QUOTES_REGEXr+   BETWEEN_QUOTE_ARROW_REGEXr.   BETWEEN_QUOTE_SLANTED_REGEXr2   BETWEEN_SQUARE_BRACKETS_REGEXr!   BETWEEN_PARENS_REGEXr   r&   BETWEEN_EM_DASHES_REGEXr0   r   r   r   r   r   r   r   r   r   r   r    r   r   r   r      s6       "A)P& #> %R! !?"S #D$X! %C!&U# <N $E  6 B  I I I	 	 	M M M  N N N0 0 0  R R RP P P    r   r   )r   	functoolsr   pysbd.punctuation_replacerr   objectr   r<   r   r   <module>r@      sp    				       : : : : : :W W W W W W W W W Wr   