U
    BŒe  ã                   @   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   sL   t ƒ }|  | ¡ g ¡ t t¡ |jdd W 5 Q R X |  | ¡ g ¡ d S ©NÚBUG)Ú
conditions)r   ÚassertEqualr   ÚpytestZraisesÚ
ValueErrorÚtabulate©ÚselfÚempty© r   ú|/var/www/nmhs-web.org.in/public_html/infoladakh/backend/venv/lib/python3.8/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   Z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  < |  | ¡ dddg¡ |  |d d d¡ d S )Nzcow cat mouse cat tigeré   é   é   é   Úhi)r   r   Zword_tokenizeÚlenr   r   ÚassertCountEqual)r   ÚtextZ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   )r	   ZunittestZnltkr   r   ZTestCaser   r   r   r   r   Ú<module>   s   