§
    'ê[f   ã                   óR   — d dl Z d„ Zd„ Zd„ Zdd„Zd	„ Zed
k    r e¦   «          dS dS )é    Nc                 óN   — t          j        dd¦  «        dk    r| d d d…         S | S )Né   é   éÿÿÿÿ)ÚrandomÚrandint)Úwords    úH/var/www/piapp/venv/lib/python3.11/site-packages/nltk/misc/wordfinder.pyÚrevwordr      s.   € Ý„~�a˜ÑÔ˜qÒ Ð Ø�D�D�b�DŒzÐØ€Kó    c                 ój  — t          t          | ¦  «        ¦  «        D ]S}| ||¦  «                  ||¦  «                 dk    r-| ||¦  «                  ||¦  «                 | |         k    r dS ŒTt          t          | ¦  «        ¦  «        D ]%}| |         | ||¦  «                  ||¦  «        <   Œ&dS )NÚ FT)ÚrangeÚlen)r	   ÚxÚxfÚyÚyfÚgridÚis          r
   Ústepr      s¹   € Ý•3�t‘9”9ÑÔð ð ˆØ���1‘”Œ;�r�r˜!‘u”uÔ Ò#Ð#¨¨R¨R°©U¬U¬°B°B°q±E´EÔ(:¸dÀ1¼gÒ(EÐ(EØ�5�5øÝ•3�t‘9”9ÑÔð %ð %ˆØ! !œWˆˆRˆR�‰UŒUŒ�B�B�q‘E”EÑÐØˆ4r   c                 ó(  ‡‡— |dk    rH‰t          | ¦  «        z
  dk     s‰t          | ¦  «        z
  dk     rdS t          | ‰ˆfd„‰ˆfd„|¦  «        S |dk    r2‰t          | ¦  «        z
  dk     rdS t          | ‰ˆfd„‰ˆfd„|¦  «        S |d	k    rK‰t          | ¦  «        z
  dk     s‰t          | ¦  «        dz
  z   |k    rdS t          | ‰ˆfd
„‰ˆfd„|¦  «        S |dk    r2‰t          | ¦  «        z
  dk     rdS t          | ‰ˆfd„‰ˆfd„|¦  «        S d S )Nr   r   Fc                 ó   •— ‰| z
  S ©N© ©r   r   s    €r
   ú<lambda>zcheck.<locals>.<lambda>$   ó   ø€  q¨1¡u€ r   c                 ó   •— ‰| z
  S r   r   ©r   r   s    €r
   r   zcheck.<locals>.<lambda>$   ó   ø€ ¸1¸q¹5€ r   r   c                 ó   •— ‰| z
  S r   r   r   s    €r
   r   zcheck.<locals>.<lambda>(   r   r   c                 ó   •— ‰S r   r   r    s    €r
   r   zcheck.<locals>.<lambda>(   s   ø€ ¸1€ r   é   c                 ó   •— ‰| z
  S r   r   r   s    €r
   r   zcheck.<locals>.<lambda>,   r   r   c                 ó   •— ‰| z   S r   r   r    s    €r
   r   zcheck.<locals>.<lambda>,   r!   r   é   c                 ó   •— ‰S r   r   r   s    €r
   r   zcheck.<locals>.<lambda>0   s   ø€  q€ r   c                 ó   •— ‰| z
  S r   r   r    s    €r
   r   zcheck.<locals>.<lambda>0   s   ø€ °q¸1±u€ r   )r   r   )r	   Údirr   r   r   ÚrowsÚcolss     ``   r
   Úcheckr-       sT  øø€ Ø
ˆa‚x€xØ�s�4‰yŒy‰=˜1ÒÐ ¥C¨¡I¤I¡°Ò 1Ð 1Ø�5Ý�D˜!˜_˜_˜_˜_¨a°°°°À$ÑGÔGÐGØ	�ŠˆØ�s�4‰yŒy‰=˜1ÒÐØ�5Ý�D˜!˜_˜_˜_˜_¨a°°°°¸dÑCÔCÐCØ	�ŠˆØ�s�4‰yŒy‰=˜1ÒÐ ¥S¨¡Y¤Y°¡]Ñ 3°tÒ ;Ð ;Ø�5Ý�D˜!˜_˜_˜_˜_¨a°°°°À$ÑGÔGÐGØ	�ŠˆØ�s�4‰yŒy‰=˜1ÒÐØ�5Ý�D˜!˜[˜[˜[˜[¨!¨_¨_¨_¨_¸dÑCÔCÐCð 
ˆr   é   é2   ÚABCDEFGHIJKLMNOPQRSTUVWXYZc                 óª  — t          | t          d¬¦  «        } g }g }t          |¦  «        D ]}|                     dg|z  ¦  «         Œ| D �]3}|                     ¦   «                              ¦   «         }|}	t          |¦  «        }t          |¦  «        D ]é}
t          j        dt          |¦  «        ¦  «        }t          j	        g d¢¦  «        }t          j        d|¦  «        }t          j        d|¦  «        }|dk    r||z  }||z  }n(|dk    r||z  }n|dk    r||z  }||z  }n|d	k    r||z  }d|cxk    r|k     r?n Œ­d|cxk    r|k     r/n Œ½t          |||||||¦  «        r|                     |	¦  «          nŒê�Œ5t          |¦  «        D ]C}t          |¦  «        D ]1}||         |         dk    rt          j	        |¦  «        ||         |<   Œ2ŒD||fS )
a  
    Attempt to arrange words into a letter-grid with the specified
    number of rows and columns.  Try each word in several positions
    and directions, until it can be fitted into the grid, or the
    maximum number of allowable attempts is exceeded.  Returns a tuple
    consisting of the grid and the words that were successfully
    placed.

    :param words: the list of words to be put into the grid
    :type words: list
    :param rows: the number of rows in the grid
    :type rows: int
    :param cols: the number of columns in the grid
    :type cols: int
    :param attempts: the number of times to attempt placing a word
    :type attempts: int
    :param alph: the alphabet, to be used for filling blank cells
    :type alph: list
    :rtype: tuple
    T)ÚkeyÚreverser   r   )r   r   r$   r'   r   r   r$   r'   )Úsortedr   r   ÚappendÚstripÚupperr   r   r   Úchoicer-   )Úwordsr+   r,   ÚattemptsÚalphr   Úusedr   r	   ÚsaveÚattemptÚrr*   r   r   Újs                   r
   Ú
wordfinderrA   3   s  € õ. �5�c¨4Ð0Ñ0Ô0€Eà€DØ€Dõ �4‰[Œ[ð !ð !ˆØ�Š�R�D˜4‘KÑ Ô Ð Ð ð ð ñ ˆØ�zŠz‰|Œ|×!Ò!Ñ#Ô#ˆØˆÝ�t‰}Œ}ˆÝ˜X‘”ð 	ð 	ˆGÝ”˜q¥# d¡)¤)Ñ,Ô,ˆAÝ”-   Ñ-Ô-ˆCÝ”˜q $Ñ'Ô'ˆAÝ”˜q $Ñ'Ô'ˆAØ�aŠxˆxØ�Q‘�Ø�Q‘��Ø˜’�Ø�Q‘��Ø˜’�Ø�Q‘�Ø�Q‘��Ø˜’�Ø�Q‘�Ø�Aˆ}ˆ}Š}ˆ}˜Š}ˆ}ˆ}ˆ}ˆ}  a  ¢ ¨$¢    Ý˜˜s A q¨$°°dÑ;Ô;ð à—K’K Ñ%Ô%Ð%Ø�Eøùõ �4‰[Œ[ð 1ð 1ˆÝ�t‘”ð 	1ð 	1ˆAØ�AŒw�qŒz˜RÒÐÝ#œ]¨4Ñ0Ô0��Q”˜‘
øð	1ð �ˆ:Ðr   c                  ó@  — ddl m}  |                      ¦   «         }t          j        |¦  «         |d d…         }d„ |D ¦   «         }t	          |¦  «        \  }}t          d¦  «         t          t          |¦  «        ¦  «        D ]R}t          t          ||         ¦  «        ¦  «        D ]}t          ||         |         d¬¦  «         Œ t          ¦   «          ŒSt          ¦   «          t          t          |¦  «        ¦  «        D ]}t          d|d	z   z  ||         ¦  «         Œd S )
Nr   )r9   éÈ   c                 óL   — g | ]!}d t          |¦  «        cxk    rdk    ¯n n|‘Œ"S )r$   é   )r   )Ú.0Úws     r
   ú
<listcomp>zword_finder.<locals>.<listcomp>|   s?   € Ð9Ð9Ð9�a q­C°©F¬FÐ'8Ð'8Ò'8Ð'8°bÒ'8Ð'8Ð'8Ð'8Ð'8�Ð'8Ð'8Ð'8r   zWord Finder
Ú )Úendz%d:r   )Únltk.corpusr9   r   ÚshufflerA   Úprintr   r   )r9   Úwordlistr   r<   r   r@   s         r
   Úword_finderrO   v   s&  € Ø!Ð!Ð!Ð!Ð!Ð!à�{Š{‰}Œ}€HÝ
„N�8ÑÔÐØ˜˜˜Œ~€HØ9Ð9˜8Ð9Ñ9Ô9€HÝ˜HÑ%Ô%�J€Dˆ$å	ˆ/ÑÔÐÝ•3�t‘9”9ÑÔð ð ˆÝ•s˜4 œ7‘|”|Ñ$Ô$ð 	'ð 	'ˆAÝ�$�q”'˜!”* #Ð&Ñ&Ô&Ð&Ð&Ý‰ŒˆˆÝ	�G„G€Gå•3�t‘9”9ÑÔð (ð (ˆÝˆe�q˜1‘u‰o˜t AœwÑ'Ô'Ð'Ð'ð(ð (r   Ú__main__)r.   r.   r/   r0   )r   r   r   r-   rA   rO   Ú__name__r   r   r
   ú<module>rR      sŒ   ðð €€€ðð ð ðð ð ðDð Dð Dð&@ð @ð @ð @ðF(ð (ð (ð( ˆzÒÐØ€K�M„M€M€M€Mð Ðr   