
    i                         d dl mZ d dlmZ d dlZ ej                  dj                   ej                  eez                     Z
	 d Zd ZddZy)	    )ALL_PUNC)
whitespaceNz^[{}]*$c                     | j                  |      r| t        |      d } t        |       |kD  r+	 | j                  |d|      }| d| gt	        | |d ||      z   S | gS # t        $ r |}Y 'w xY w)aF  Recursively split a string in the largest chunks
    possible from the highest position of a delimiter all the way
    to a maximum size

    Args:
        the_string (string): The string to split.
        delim (string): The delimiter to split on.
        max_size (int): The maximum size of a chunk.

    Returns:
        list: the minimized string in tokens

    Every chunk size will be at minimum ``the_string[0:idx]`` where ``idx``
    is the highest index of ``delim`` found in ``the_string``; and at maximum
    ``the_string[0:max_size]`` if no ``delim`` was found in ``the_string``.
    In the latter case, the split will occur at ``the_string[max_size]``
    which can be any character. The function runs itself again on the rest of
    ``the_string`` (``the_string[idx:]``) until no chunk is larger than
    ``max_size``.

    Nr   )
startswithlenrindex
ValueError	_minimize)
the_stringdelimmax_sizeidxs       H/var/www/auto_recruiter/arenv/lib/python3.12/site-packages/gtts/utils.pyr
   r
      s    2 U#E
,

:!	 ##E1h7C 4C !Ij.>x$PPP|  	 C	s   A A*)A*c                 t    | D cg c](  }t         j                  |      r|j                         * c}S c c}w )a  Clean a list of strings

    Args:
        tokens (list): A list of strings (tokens) to clean.

    Returns:
        list: Stripped strings ``tokens`` without the original elements
            that only consisted of whitespace and/or punctuation characters.

    )_ALL_PUNC_OR_SPACEmatchstrip)tokensts     r   _clean_tokensr   8   s,      &I!-?-E-Ea-HAGGIIIIs   55c                 *    d}|j                  | |      S )a  Generates a Google Translate URL

    Args:
        tld (string): Top-level domain for the Google Translate host,
            i.e ``https://translate.google.<tld>``. Default is ``com``.
        path: (string): A path to append to the Google Translate host,
            i.e ``https://translate.google.com/<path>``. Default is ``""``.

    Returns:
        string: A Google Translate URL `https://translate.google.<tld>/path`
    zhttps://translate.google.{}/{})format)tldpath_GOOGLE_TTS_URLs      r   _translate_urlr   F   s     7O!!#t,,    )com )gtts.tokenizer.symbolsr   puncstringr   wsrecompiler   escaper   r
   r   r    r   r   <module>r(      sO    3 # 	RZZ
 1 1)"))D2I2F GH (VJ-r   