o
    
j                     @   s*   d dl Z dadd ZdedefddZdS )    Nc                  C   s   z
dd l } dd l} W n ty   tdw ztjd }W n ty(   tdw | j|gd ddlm}m	} |
 }||ad S )Nr   z]Belarusian phonemizer requires to install module 'jpype1' manually. Try `pip install jpype1`.BEL_FANETYKA_JARz[You need to define 'BEL_FANETYKA_JAR' environment variable as path to the fanetyka.jar file)	classpath)
GrammarDB2GrammarFinder)jpypejpype.importsModuleNotFoundErrorosenvironKeyErrorstartJVMorg.alex73.korpus.baser   r   initializeFromJarfinder)r   jar_pathr   r   
grammar_db r   [/home/kuhnn/.local/lib/python3.10/site-packages/TTS/tts/utils/text/belarusian/phonemizer.pyinit   s"   r   textreturnc                 C   s*   t d u rt  ddlm} t|t | jS )Nr   )FanetykaText)r   r   org.alex73.fanetyka.implr   stripa)r   r   r   r   r   belarusian_text_to_phonemes   s   r   )r	   r   r   r   r   r   r   r   r   <module>   s    