
    Ng[                     L    d dl Z d dlmZmZmZ dZ G d de j                  ZdS )    N)BigramAssocMeasuresQuadgramAssocMeasuresTrigramAssocMeasuresg:0yE>c                        e Zd Zd Zd Zd ZdS )TestLikelihoodRatioc                    |                      t          j        ddd          dt                     |                      t          j        ddd          dt                      | j        t
          t          j        gd	R   d S )
N   )   r
      gwBoP@delta   )r   r           )r   )r	   r	   r	   )assertAlmostEqualr   likelihood_ratio_DELTAassertRaises
ValueErrorselfs    W/var/www/html/ai-engine/env/lib/python3.11/site-packages/nltk/test/unit/test_metrics.pytest_lr_bigramz"TestLikelihoodRatio.test_lr_bigram   s    0FB?? 	 	
 	
 	

 	0FA>>6 	 	
 	
 	
 	0	
 	
 	
 	
 	
 	
 	
    c                 
   |                      t          j        dddd          dt                     |                      t          j        dddd          dt                      | j        t
          t          j        gdR   d S )Nr   )r   r   r   r	   g9B.@r   r   )r   r   r   r	   r   r	   )r   r   r   r   r   r   r   s    r   test_lr_trigramz#TestLikelihoodRatio.test_lr_trigram   s     1!Y	1MM 	 	
 	
 	

 	 1!Y	1MM 	 	
 	
 	

 	 1	
 *	
 	
 	
 	
 	
 	
r   c           	         |                      t          j        ddddd          dt                     |                      t          j        ddddd          dt                      | j        t
          t          j        gdR   d S )	Nr   r   r   r   r   )r   r   r   r   r   r   r	   gs;? @r   r   )r   r   )r   r   r   r   r   r	   r   r   )r   r   r   r   r   r   r   s    r   test_lr_quadgramz$TestLikelihoodRatio.test_lr_quadgram/   s    !2<!3\1   	 	
 	
 	
 	!2<!3\1   	 	
 	
 	
 	!2	
 D	
 	
 	
 	
 	
 	
r   N)__name__
__module____qualname__r   r   r    r   r   r   r      sA        
 
 

 
 
"
 
 
 
 
r   r   )unittestnltk.metricsr   r   r   r   TestCaser   r#   r   r   <module>r'      s~              
4
 4
 4
 4
 4
(+ 4
 4
 4
 4
 4
r   