
    g                     X    d dl mZ d dlmZ dZdj                         Zd Zd Zd Z	d Z
y	)
    )BigramCollocationFinder)BigramAssocMeasuresg:0yE>zthis this is is a a test testc                 :    t        d t        | |      D              S )zbVerify that two sequences of n-gram association values are within
    _EPSILON of each other.
    c              3   X   K   | ]"  \  }}t        |d    |d    z
        t        k   $ yw)   N)abs_EPSILON).0x1y1s      U/var/www/openai/venv/lib/python3.12/site-packages/nltk/test/unit/test_collocations.py	<genexpr>zclose_enough.<locals>.<genexpr>   s+     FI&"bs2a52a5=!X-Is   (*)allzip)xys     r   close_enoughr   
   s    
 FC1IFFF    c                     t        j                  t              } t        | j                  j                               g dk(  sJ t        | j                  j                               g dk(  sJ t        t              t        | j                  j                               cxk(  r*t        | j                  j                               dz   k(  sJ  J t        t        | j                  t        j                              g d      sJ y )N)ar   r   )r   testr   )isr   r   r   r   r   r   r   r   )thisr   r   r"   r"   r   )r      )r   r&   )r   r&   )r"   r&   r   ))r         ?r   r'   r   r'   )r   r'   )r    r'   r!   r'   )r$   r'   r   
from_wordsSENTsortedngram_fditemsword_fdlensumvaluesr   score_ngramsr   pmibs    r   test_bigram2r9      s    **40A!**""$% *    !))//#$(WWWWt9AII,,./O3qzz7H7H7J3Ka3OOOOOOq~~15567	
  r   c                  T   t        j                  t        d      } t        | j                  j                               t        g d      k(  sJ t        | j                  j                               t        g d      k(  sJ t        t              t        | j                  j                               cxk(  r0t        | j                  j                               dz   dz   dz  k(  sJ  J t        t        | j                  t        j                              t        g d            sJ y )	N   window_size))r   r;   )r   r;   )r!   r;   r   r   r   r#   r%   r&   r   g       @))r   h\?)r   r>   )r!   r>   )r           )r   r?   )r    r?   )r$   r?   r+   r7   s    r   test_bigram3r@   /   s   **4Q?A!**""$%	

* 
 
 
 !))//#$7)   
 	D	S))+,XQZZ5F5F5H1IA1MPQ1QUX0XXXXq~~15567
	
  r   c                  h   t        j                  t        d      } t        | j                  j                               t        g d      k(  sJ t        | j                  j                               t        g d      k(  sJ t        | j                  j                               }t        | j                  j                               dz   dz   dz   dz   d	z  }t        t              |cxk(  r|k(  sJ  J t        t        | j                  t        j                              t        g d
            sJ y )N   r<   )	)r      )r   rC   )r!   rC   )r   r   r;   )r"   r   r;   r   r   r   r#   r%   rC   r;   r&   r   g      @)	r(   r)   r*   )rD   z?G?)rE   rF   )r         )r   rG   )r    rG   )r$   rG   )r   r,   r-   r.   r/   r0   r1   r3   r4   r2   r   r5   r   r6   )r8   	n_word_fd
n_ngram_fds      r   test_bigram5rJ   T   s   **4Q?A!**""$%
	
*    !))//#$7)    AII$$&'Iajj'')*Q.2Q6:cAJt9	/Z/////q~~15567
	
  r   N)nltk.collocationsr   nltk.metricsr   r	   splitr-   r   r9   r@   rJ    r   r   <module>rO      s6    5 , &,,.G:"J$r   