o
    Xεin                     @   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 English class    N)	sentencesc                   @   s8   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d ZdS )EnglishTestCasezTest cases for Englishc                 C   2   d}t t|dd}| g ddd |D  dS )zTest text with lots of noiseuL   IT’S <a> 'test' (seNtEnce) for-only $100, Dr., & [I] ## *like* ## it 100%!en_USlang)zIT'S<a>'testr   (seNtEnce)foronlyonehundreddollars,Doctorr   and[I]*liker   itr   r   percent!c                 S      g | ]}|j qS  text.0wordr!   r!   A/home/ubuntu/.local/lib/python3.10/site-packages/tests/test_en.py
<listcomp>3       z5EnglishTestCase.test_unclean_text.<locals>.<listcomp>Nnextr   assertEqualselfr#   sentencer!   r!   r'   test_unclean_text   s    z!EnglishTestCase.test_unclean_textc                 C   s4   d}t t|ddd}| g ddd |D  dS )	z!Test spell-out in say-as SSML tagz6<say-as interpret-as="spell-out">abc@1+2-3*.*</say-as>r   T)r   ssml)r	   bcatr   plustwodashthreestardotr9   c                 S   r    r!   r"   r$   r!   r!   r'   r(   J   r)   z2EnglishTestCase.test_spell_out.<locals>.<listcomp>Nr*   r-   r!   r!   r'   test_spell_out6   s   zEnglishTestCase.test_spell_outc                 C   r   )zTest expansion of initialismszABC abc A.B.C.r   r   )ABCabcr<   r=   r>   c                 S   r    r!   r"   r$   r!   r!   r'   r(   S   r)   z4EnglishTestCase.test_initialisms.<locals>.<listcomp>Nr*   r-   r!   r!   r'   test_initialismsM   s
   z EnglishTestCase.test_initialismsc                 C   r   )zTest expansion of datesz1/4/1999 vs. 4/1/1999r   r   )Januaryfourthr   nineteenninetynineversusAprilfirstr   rC   rD   rE   c                 S   r    r!   r"   r$   r!   r!   r'   r(   k   r)   z.EnglishTestCase.test_dates.<locals>.<listcomp>Nr*   r-   r!   r!   r'   
test_datesV   s   zEnglishTestCase.test_datesc                 C   r   )zTest parsing of ordinal numbersz:1st, 2nd, 3rd, 4th, 5th, 23rd, 32nd, 44th, 121st, 5,111st.r   r   )!rH   r   secondr   thirdr   rB   r   fifthr   twentyrK   r   thirtyrJ   r   fortyrB   r   r   r   r   rM   rH   r   fivethousandr   r   r   r   eleventh.c                 S   r    r!   r"   r$   r!   r!   r'   r(      r)   z1EnglishTestCase.test_ordinals.<locals>.<listcomp>Nr*   r-   r!   r!   r'   test_ordinalsn   s   #zEnglishTestCase.test_ordinalsN)	__name__
__module____qualname____doc__r0   r;   r@   rI   rT   r!   r!   r!   r'   r      s    +	r   __main__)rX   unittestgruutr   TestCaser   rU   mainr!   r!   r!   r'   <module>   s    