
    2h                         S SK Jr  S SKJr  S SKr\R                  " SR                  \R                  " \\-   5      5      5      r
 S rS rSS jrg)	    )ALL_PUNC)
whitespaceNz^[{}]*$c                     U R                  U5      (       a  U [        U5      S n [        U 5      U:  a)   U R                  USU5      nU SU /[	        XS X5      -   $ U /$ ! [         a    Un N&f = f)a  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       B/var/www/auris/envauris/lib/python3.13/site-packages/gtts/utils.pyr
   r
      s    2 U##E
,

:!	 ##E1h7C 4C !Ij.>$PPP|  	 C	s   A   A/.A/c                     U  Vs/ s H/  n[         R                  U5      (       a  M  UR                  5       PM1     sn$ s  snf )zClean 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   s2      &Iv!-?-E-Ea-HIAGGIvIIIs   >>c                 (    SnUR                  X5      $ )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!!#,,    )com )gtts.tokenizer.symbolsr   puncstringr   wsrecompiler   escaper   r
   r   r    r   r   <module>r(      sK    3 # 	ZZ
 1 1"))D2I2F GH (VJ-r   