o
    Pεi                     @   sB   d Z ddlZddlmZ G dd dejZedkre  dS dS )zTests for Phonemes class    N)Phonemesc                   @   s@   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d Zdd Z	dS )PhonemesTestCasezTest cases for Phonemes classc                 C   >   d}t d}|j|dd}dd |D }| |g d dS )	zTest Phonemes.from_stringu   /dʒʌst ə kˈaʊ/zen-usTkeep_stressc                 S      g | ]}|j qS  text.0pr   r   G/home/ubuntu/.local/lib/python3.10/site-packages/tests/test_phonemes.py
<listcomp>       z/PhonemesTestCase.test_split.<locals>.<listcomp>)u   d͡ʒu   ʌstu   əku   ˈaʊNr   from_languagesplitassertEqualselfpron_strlang_phonemespron_phonemesphoneme_strsr   r   r   
test_split   s
   
zPhonemesTestCase.test_splitc                 C   r   )	z0Test Phonemes.split with a substring replacementu   /viːtɛt͡ʃnaː/cs-czFr   c                 S   r   r   r	   r   r   r   r   r      r   z9PhonemesTestCase.test_split_substring.<locals>.<listcomp>)vu   iːr   u   ɛ   t͡ʃnu   aːNr   r   r   r   r   test_split_substring   
   
z%PhonemesTestCase.test_split_substringc                 C   s>   d}t d}|j|dd}dd |D }| |ddg d	S )
z:Test Phonemes.split with a diacritic substring replacementu   /ɑɑ̃/zfr-frFr   c                 S   r   r   r	   r   r   r   r   r   *   r   z:PhonemesTestCase.test_split_diacritics.<locals>.<listcomp>au   ɑ̃Nr   r   r   r   r   test_split_diacritics"   r$   z&PhonemesTestCase.test_split_diacriticsc                 C   :   d}t d}||}dd |D }| |g d dS )z)Test Phonemes.from_string with a dipthongu   /ɐ̃pliɐ̃w̃/ptc                 S   r   r   r	   r   r   r   r   r   6   r   z2PhonemesTestCase.test_dipthong.<locals>.<listcomp>)u   ɐ̃r   liu   ɐ̃w̃Nr   r   r   r   r   test_dipthong-   
   

zPhonemesTestCase.test_dipthongc                 C   r   )	z#Test Phonemes.split with a dipthongu   /neu̯rt͡ʃɪtou̯/r   Fr   c                 S   r   r   r	   r   r   r   r   r   A   r   z8PhonemesTestCase.test_split_dipthong.<locals>.<listcomp>)r"   u   eu̯rr!   u   ɪr   u   ou̯Nr   r   r   r   r   test_split_dipthong9   r$   z$PhonemesTestCase.test_split_dipthongc                 C   r'   )zTest Phonemes.split with tonesu   /a˨˦xoj˧˧/zvi-nc                 S   r   r   r	   r   r   r   r   r   M   r   z/PhonemesTestCase.test_tones.<locals>.<listcomp>)u   a˨˦xu   oj˧˧Nr   r   r   r   r   
test_tonesD   r,   zPhonemesTestCase.test_tonesN)
__name__
__module____qualname____doc__r   r#   r&   r+   r.   r0   r   r   r   r   r      s    r   __main__)r4   unittest	gruut_ipar   TestCaser   r1   mainr   r   r   r   <module>   s   K