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

 	00FA>6 	 	
 	00	
 	
    c                    | j                  t        j                  dddd      dt               | j                  t        j                  dddd      dt                | j                  t
        t        j                  gd  y )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1!Y	1M 	 	

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

 	 11	
 *	
r   c           	         | j                  t        j                  ddddd      dt               | j                  t        j                  ddddd      dt                | j                  t
        t        j                  gd  y )	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2<!3\1  	 	
 	!22<!3\1  	 	
 	!22	
 D	
r   N)__name__
__module____qualname__r   r   r    r   r   r   r      s    

"
r   r   )unittestnltk.metricsr   r   r   r   TestCaser   r#   r   r   <module>r'      s+      
4
(++ 4
r   