o
    Xεi                     @   sB  d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl	m
Z
 ddlmZmZ ddlmZmZ ddlmZmZ ddlmZ eeZed	 jd
d ZdZg dZe Ze Z 										d#de!de!de"de"de"de"de"de"de"de"de"dej#e fddZ$de!de"fdd Z%dej&e! fd!d"Z'dS )$zgruut module    N)Enum)Path)KNOWN_LANGSTextProcessorSettings)_DIR_PACKAGE)SentenceTextProcessor)resolve_langVERSIONzutf-8)encodingzMichael Hansen (synesthesiam))	sentencesis_language_supportedget_supported_languagesr	   r   en_USFTtextlangssmlespeakmajor_breaksminor_breakspunctuationsexplicit_langphonemesbreak_phonemesposreturnc                 k   s    |sdnd}t % ttdsi t_tj|}|du r't||d}|tj|< W d   n1 s1w   Y  |dus<J || f||d|\}}|j||||||||	|
d	E dH  dS )aH  
    Process text and return sentences

    Args:
        text: input text or SSML (ssml=True)
        lang: default language of input text
        ssml: True if input text is SSML
        espeak: True if eSpeak phonemes should be used
        major_breaks: False if no sentence-breaking symbols in output
        minor_breaks: False if no phrase-breaking symbols in output
        punctuations: False if no word-surrounding symbols in output
        **process_args: keyword arguments passed to TextProcessor.process

    Returns:
        sentences: iterable of Sentence objects

     r   
processorsN)default_langmodel_prefix)r   r   )r   r   r   r   r   r   r   )_PROCESSORS_LOCKhasattr_LOCALr   getr	   r   )r   r   r   r   r   r   r   r   r   r   r   process_argsr    text_processorgraphroot r)   B/home/ubuntu/.local/lib/python3.10/site-packages/gruut/__init__.pyr   $   s0   

	r   c                 C   s   t | tv S )zTrue if gruut supports lang)r
   r   )r   r)   r)   r*   r   a   s   r   c                   C   s   t tS )z Set of supported gruut languages)setr   r)   r)   r)   r*   r   f   s   r   )
r   FFTTTTTTT)(__doc__	itertoolsloggingresqlite3	threadingtypingenumr   pathlibr   gruut.constr   r   gruut.resourcesr   r   gruut.text_processorr   r	   gruut.utilsr
   	getLogger_LOGGER	read_textstrip__version__
__author____all__localr#   RLockr!   strboolIterabler   r   Setr   r)   r)   r)   r*   <module>   sp    

	

=