
    11i7                     <    S r SSKJrJr   " S S5      r\" SSSS9rg)	z2Provides the Separator tuple and its default value    )OptionalUnionc                       \ rS rSrSr   SS\S\\   S\\   4S jjrSS jrS	 r	\
S
 5       r\
S 5       r\
S 5       rS\4S jrS\\\4   S\\\4   4S jrSrg)	Separator   z0Defines phone, syllable and word boundary tokensNwordsyllablephonec                 \   [        S X2U4 5       5      n[        S X2U4 5       5      n[        U5      [        U5      :w  a  [        SR	                  X2U5      5      eU(       a  [        U5      OSU l        U(       a  [        U5      OSU l        U(       a  [        U5      U l        g SU l        g )Nc              3   6   #    U  H  o(       d  M  Uv   M     g 7fN .0seps     N/home/james-whalen/.local/lib/python3.13/site-packages/phonemizer/separator.py	<genexpr>%Separator.__init__.<locals>.<genexpr>   s     B#:CcCC#:   
	c              3   6   #    U  H  o(       d  M  Uv   M     g 7fr   r   r   s     r   r   r      s     A"93S33"9r   zcillegal separator with word="{}", syllable="{}" and phone="{}", must be all differents if not empty )	listsetlen
ValueErrorformatstr_phone	_syllable_word)selfr   r	   r
   sep1sep2s         r   __init__Separator.__init__   s     BET#:BBA5D"9AAt9D	!BVET24 4
 %*c%jr*2X"&SY
B
    c                     U R                   UR                   :H  =(       a9    U R                  UR                  :H  =(       a    U R                  UR                  :H  $ r   r
   r	   r   )r!   others     r   __eq__Separator.__eq__&   sA    

ekk) ,MMU^^3,II+	-r&   c                 V    SU R                    SU R                   SU R                   S3$ )Nz	(phone: "z", syllable: "z
", word: "z")r(   r!   s    r   __str__Separator.__str__,   s5    

| $-- )ii[$	%r&   c                     U R                   $ )zPhones separator)r   r-   s    r   r
   Separator.phone2   s     {{r&   c                     U R                   $ )zSyllables separator)r   r-   s    r   r	   Separator.syllable7   s     ~~r&   c                     U R                   $ )zWords separator)r    r-   s    r   r   Separator.word<   s     zzr&   valuec                 L    XR                   U R                  U R                  1;   $ )z=Returns True if the separator has `value` as token separationr(   )r!   r6   s     r   __contains__Separator.__contains__A   s    T]]DII>>>r&   field_separatorreturnc                     U(       d  g[        U[        5      (       a  X;   a  [        SU SU  35      eU$ USL a  SnX;   a  US-  nX;   a  M  U$ [        SU 35      e)av  Returns a suitable input/output separator based on token separator

The input/output separator split orthographic and phonetic texts when
using the --prepend-text option from command-line.

Parameters
----------

field_separator: bool or str
    If str, ensures it's value is not
    already defined as a token separator. If True choose one of "|",
    "||", "|||", "||||" (the first one that is not defined as a token
    separator)

Returns
-------
The input/output separator, or False if ``field_separator`` is False

Raises
------
RuntimeError
    if ``field_separator`` is a str but is already registered as token separator

Fzcannot prepend input with "z+" because it is already a token separator: T|z:invalid input/output separator, must be bool or str but is)
isinstancer   RuntimeError)r!   r:   s     r   input_output_separator Separator.input_output_separatorE   s    4 os++&"1/1B C88<v?@ @ #"d"!O!)3& ")"" H!" 	"r&   )r   r   r    ) NN)r)   r   )__name__
__module____qualname____firstlineno____doc__r   r   r$   r*   r.   propertyr
   r	   r   r8   r   boolr@   __static_attributes__r   r&   r   r   r      s    :#&+/(,/S /#C=/ / -%      ?# ?-"eCI6F -"S$Y-"r&   r   r   rB   r(   N)rG   typingr   r   r   default_separatorr   r&   r   <module>rM      s.    9 "_" _"D B#>  Ir&   