a
    ±Kb]  ã                   @   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 sB0    Y  |  | ¡ g ¡ d S ©NZBUG)Ú
conditions)r   ÚassertEqualr   ÚpytestZraisesÚ
ValueErrorZtabulate©ÚselfÚempty© r   ú?lib/python3.9/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  < |  | ¡ g d¢¡ |  |d d d¡ d S )Nzcow cat mouse cat tigeré   é   é   é   Úhi)r   r   r   )r   r   Zword_tokenizeÚlenr   r   ZassertCountEqual)r   ÚtextZcfdZwordZ	conditionr   r   r   Útest_increment   s    ÿz TestEmptyCondFreq.test_incrementN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r      s   r   )Zunittestr   Znltkr   r   ZTestCaser   r   r   r   r   Ú<module>   s   