o
    ¹i6  ã                   @   s6   d dl Z d dlZd dlmZmZ G dd„ de jƒZdS )é    N)ÚConditionalFreqDistÚtokenizec                   @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )ÚTestEmptyCondFreqc                 C   s`   t ƒ }|  | ¡ g ¡ t t¡ |jdd W d   ƒ n1 s!w   Y  |  | ¡ g ¡ d S ©NÚBUG)Ú
conditions)r   ÚassertEqualr   ÚpytestÚraisesÚ
ValueErrorÚtabulate©ÚselfÚempty© r   ú[/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/nltk/test/unit/test_cfd_mutation.pyÚtest_tabulate	   s   ÿzTestEmptyCondFreq.test_tabulatec                 C   s8   t ƒ }|  | ¡ g ¡ |jdgd |  | ¡ g ¡ d S r   )r   r   r   Úplotr   r   r   r   Ú	test_plot   s   zTestEmptyCondFreq.test_plotc                 C   sŠ   d}t ƒ }t |¡D ]}t|ƒ}|| |  d7  < q
|  | ¡ ddg¡ |d d  d7  < |  | ¡ g d¢¡ |  |d d d¡ d S )Nzcow cat mouse cat tigeré   é   é   é   Úhi)r   r   r   )r   r   Úword_tokenizeÚlenr   r   ÚassertCountEqual)r   ÚtextÚcfdÚwordÚ	conditionr   r   r   Útest_increment   s   ÿz TestEmptyCondFreq.test_incrementN)Ú__name__Ú
__module__Ú__qualname__r   r   r!   r   r   r   r   r      s    r   )Úunittestr	   Únltkr   r   ÚTestCaser   r   r   r   r   Ú<module>   s    