
    g6                     N    d dl Z d dlZd dlmZmZ  G d de j
                        Zy)    N)ConditionalFreqDisttokenizec                       e Zd Zd Zd Zd Zy)TestEmptyCondFreqc                    t               }| j                  |j                         g        t        j                  t
              5  |j                  d       d d d        | j                  |j                         g        y # 1 sw Y   *xY wNBUG)
conditions)r   assertEqualr
   pytestraises
ValueErrortabulateselfemptys     U/var/www/openai/venv/lib/python3.12/site-packages/nltk/test/unit/test_cfd_mutation.pytest_tabulatezTestEmptyCondFreq.test_tabulate	   sd    #%))+R0]]:&NNeN, '))+R0 '&s   B  B	c                     t               }| j                  |j                         g        |j                  dg       | j                  |j                         g        y r   )r   r   r
   plotr   s     r   	test_plotzTestEmptyCondFreq.test_plot   sL    #%))+R0

ug
&))+R0    c                 ^   d}t               }t        j                  |      D ]  }t        |      }||   |xx   dz  cc<    | j	                  |j                         ddg       |d   dxx   dz  cc<   | j                  |j                         g d       | j	                  |d   d   d       y )Nzcow cat mouse cat tiger            hi)r   r   r   )r   r   word_tokenizelenr   r
   assertCountEqual)r   textcfdword	conditions        r   test_incrementz TestEmptyCondFreq.test_increment   s    (!# **40DD	I	N4 A%  1 	)Aq62 	Atcnn.	:F4L!	
r   N)__name__
__module____qualname__r   r   r&    r   r   r   r      s    11
r   r   )unittestr   nltkr   r   TestCaser   r*   r   r   <module>r.      s       .
)) 
r   