§
    'ê[fx(  ã                   óÚ   — d dl mZmZ d dlmZ d dlmZ e G d„ de¬¦  «        ¦   «         Z G d„ de¦  «        Ze G d	„ d
¦  «        ¦   «         Z	 G d„ de¦  «        Z
 G d„ de¦  «        ZdS )é    )ÚABCMetaÚabstractmethod)Útotal_ordering)Úraise_unorderable_typesc                   ó®   — e Zd ZdZed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Z	ed„ ¦   «         Z
d„ Zd	„ Zd
„ Zd„ ZdS )ÚAbstractCCGCategoryz;
    Interface for categories in combinatory grammars.
    c                 ó   — dS )z<
        Returns true if the category is primitive.
        N© ©Úselfs    ú@/var/www/piapp/venv/lib/python3.11/site-packages/nltk/ccg/api.pyÚis_primitivez AbstractCCGCategory.is_primitive   ó   € € € ó    c                 ó   — dS )zI
        Returns true if the category is a function application.
        Nr
   r   s    r   Úis_functionzAbstractCCGCategory.is_function   r   r   c                 ó   — dS )z=
        Returns true if the category is a variable.
        Nr
   r   s    r   Úis_varzAbstractCCGCategory.is_var    r   r   c                 ó   — dS )z–
        Takes a set of (var, category) substitutions, and replaces every
        occurrence of the variable with the corresponding category.
        Nr
   )r   Úsubstitutionss     r   Ú
substitutezAbstractCCGCategory.substitute&   r   r   c                 ó   — dS )z·
        Determines whether two categories can be unified.
         - Returns None if they cannot be unified
         - Returns a list of necessary substitutions if they can.
        Nr
   ©r   Úothers     r   Ú	can_unifyzAbstractCCGCategory.can_unify-   r   r   c                 ó   — d S ©Nr
   r   s    r   Ú__str__zAbstractCCGCategory.__str__6   s   € àˆr   c                 ó>   — | j         |j         u o| j        |j        k    S r   ©Ú	__class__Ú_comparison_keyr   s     r   Ú__eq__zAbstractCCGCategory.__eq__:   ó&   € àŒN˜eœoÐ-ð >ØÔ$¨Ô(=Ò=ð	
r   c                 ó   — | |k     S r   r
   r   s     r   Ú__ne__zAbstractCCGCategory.__ne__@   ó   € Ø˜5’=Ð Ð r   c                 ó¾   — t          |t          ¦  «        st          d| |¦  «         | j        |j        u r| j        |j        k     S | j        j        |j        j        k     S ©NÚ<)Ú
isinstancer   r   r!   r"   Ú__name__r   s     r   Ú__lt__zAbstractCCGCategory.__lt__C   s\   € Ý˜%Õ!4Ñ5Ô5ð 	6Ý# C¨¨uÑ5Ô5Ð5ØŒ>˜Uœ_Ð,Ð,ØÔ'¨%Ô*?Ò?Ð?à”>Ô*¨U¬_Ô-EÒEÐEr   c                 ór   — 	 | j         S # t          $ r# t          | j        ¦  «        | _         | j         cY S w xY wr   ©Ú_hashÚAttributeErrorÚhashr"   r   s    r   Ú__hash__zAbstractCCGCategory.__hash__K   óJ   € ð	Ø”:ÐøÝð 	ð 	ð 	Ý˜dÔ2Ñ3Ô3ˆDŒJØ”:ÐÐÐð	øøøó   ‚	 ‰*6µ6N)r,   Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r#   r&   r-   r3   r
   r   r   r   r      sÿ   € € € € € ðð ð ðð ñ „^ðð
 ðð ñ „^ðð
 ðð ñ „^ðð
 ðð ñ „^ðð ðð ñ „^ðð ðð ñ „^ðð
ð 
ð 
ð!ð !ð !ðFð Fð Fðð ð ð ð r   r   )Ú	metaclassc                   ót   — e Zd ZdZdZdd„Zed„ ¦   «         Zed„ ¦   «         Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ ZdS )ÚCCGVarz�
    Class representing a variable CCG category.
    Used for conjunctions (and possibly type-raising, if implemented as a
    unary rule).
    r   Fc                 ó^   — |                       ¦   «         | _        || _        | j        | _        dS )z×Initialize a variable (selects a new identifier)

        :param prim_only: a boolean that determines whether the variable is
                          restricted to primitives
        :type prim_only: bool
        N)Únew_idÚ_idÚ
_prim_onlyr"   )r   Ú	prim_onlys     r   Ú__init__zCCGVar.__init__\   s*   € ð —;’;‘=”=ˆŒØ#ˆŒØ#œxˆÔÐÐr   c                 ó4   — | j         dz   | _         | j         dz
  S )zT
        A class method allowing generation of unique variable identifiers.
        é   ©Ú_maxID©Úclss    r   r=   zCCGVar.new_idg   s   € ð
 ”Z !‘^ˆŒ
ØŒz˜A‰~Ðr   c                 ó   — d| _         d S )Nr   rD   rF   s    r   Úreset_idzCCGVar.reset_ido   s   € àˆŒ
ˆ
ˆ
r   c                 ó   — dS ©NFr
   r   s    r   r   zCCGVar.is_primitives   ó   € Øˆur   c                 ó   — dS rK   r
   r   s    r   r   zCCGVar.is_functionv   rL   r   c                 ó   — dS ©NTr
   r   s    r   r   zCCGVar.is_vary   ó   € Øˆtr   c                 ó*   — |D ]\  }}|| k    r|c S Œ| S )zlIf there is a substitution corresponding to this variable,
        return the substituted category.
        r
   )r   r   ÚvarÚcats       r   r   zCCGVar.substitute|   s3   € ð (ð 	ð 	‰JˆS�#Ø�dŠ{ˆ{Ø�
�
�
ð àˆr   c                 óF   — |                      ¦   «         s| j        s| |fgS dS )zWIf the variable can be replaced with other
        a substitution is returned.
        N)r   r?   r   s     r   r   zCCGVar.can_unify…   s2   € ð ×ÒÑÔð 	# t¤ð 	#Ø˜5�M�?Ð"Øˆtr   c                 ó   — | j         S r   )r>   r   s    r   Úidz	CCGVar.id�   s	   € ØŒxˆr   c                 ó0   — dt          | j        ¦  «        z   S )NÚ_var)Ústrr>   r   s    r   r   zCCGVar.__str__�   s   € Ø�˜DœH™œÑ%Ð%r   N)F)r,   r6   r7   r8   rE   rA   Úclassmethodr=   rI   r   r   r   r   r   rV   r   r
   r   r   r;   r;   S   sØ   € € € € € ðð ð €Fð	(ð 	(ð 	(ð 	(ð ðð ñ „[ðð ðð ñ „[ððð ð ðð ð ðð ð ðð ð ðð ð ðð ð ð&ð &ð &ð &ð &r   r;   c                   ór   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ ZdS )Ú	Directionz¨
    Class representing the direction of a function application.
    Also contains maintains information as to which combinators
    may be used with the category.
    c                 óN   — || _         || _        |t          |¦  «        f| _        d S r   )Ú_dirÚ_restrsÚtupler"   )r   ÚdirÚrestrictionss      r   rA   zDirection.__init__œ   s+   € ØˆŒ	Ø#ˆŒØ #¥U¨<Ñ%8Ô%8Ð9ˆÔÐÐr   c                 ó   — | j         dk    S )Nú/©r^   r   s    r   Ú
is_forwardzDirection.is_forward¢   s   € ØŒy˜CÒÐr   c                 ó   — | j         dk    S )Nú\re   r   s    r   Úis_backwardzDirection.is_backward¥   s   € ØŒy˜DÒ Ð r   c                 ó   — | j         S r   re   r   s    r   ra   zDirection.dir¨   ó
   € ØŒyÐr   c                 ó   — | j         S )a8  A list of restrictions on the combinators.
        '.' denotes that permuting operations are disallowed
        ',' denotes that function composition is disallowed
        '_' denotes that the direction has variable restrictions.
        (This is redundant in the current implementation of type-raising)
        ©r_   r   s    r   ÚrestrszDirection.restrs«   s   € ð Œ|Ðr   c                 ó   — | j         dk    S ©NÚ_rm   r   s    r   Úis_variablezDirection.is_variable´   s   € ØŒ|˜sÒ"Ð"r   c                 ó
  — |                      ¦   «         rd|                      ¦   «         fgS |                       ¦   «         rd|                     ¦   «         fgS |                      ¦   «         |                     ¦   «         k    rg S d S rp   )rr   rn   r   s     r   r   zDirection.can_unifyº   s{   € Ø×ÒÑÔð 	Ø˜$Ÿ+š+™-œ-Ð(Ð)Ð)Ø×ÒÑÔð 	Ø˜%Ÿ,š,™.œ.Ð)Ð*Ð*à�{Š{‰}Œ} §¢¡¤Ò.Ð.Ø�	Øˆtr   c                 ó|   — |                       ¦   «         s| S |D ]"\  }}|dk    rt          | j        |¦  «        c S Œ#| S rp   )rr   r\   r^   )r   ÚsubsrR   rn   s       r   r   zDirection.substituteÄ   sY   € Ø×ÒÑ!Ô!ð 	ØˆKà!ð 	4ð 	4‰MˆS�&Ø�cŠzˆzÝ  ¤¨FÑ3Ô3Ð3Ð3Ð3ð àˆr   c                 ó   — d| j         vS )Nú,rm   r   s    r   Úcan_composezDirection.can_composeÎ   ó   € Ø˜$œ,Ð&Ð&r   c                 ó   — d| j         vS )Nú.rm   r   s    r   Ú	can_crosszDirection.can_crossÑ   ry   r   c                 ó>   — | j         |j         u o| j        |j        k    S r   r    r   s     r   r#   zDirection.__eq__Ô   r$   r   c                 ó   — | |k     S r   r
   r   s     r   r&   zDirection.__ne__Ú   r'   r   c                 ó¾   — t          |t          ¦  «        st          d| |¦  «         | j        |j        u r| j        |j        k     S | j        j        |j        j        k     S r)   )r+   r\   r   r!   r"   r,   r   s     r   r-   zDirection.__lt__Ý   s[   € Ý˜%¥Ñ+Ô+ð 	6Ý# C¨¨uÑ5Ô5Ð5ØŒ>˜Uœ_Ð,Ð,ØÔ'¨%Ô*?Ò?Ð?à”>Ô*¨U¬_Ô-EÒEÐEr   c                 ór   — 	 | j         S # t          $ r# t          | j        ¦  «        | _         | j         cY S w xY wr   r/   r   s    r   r3   zDirection.__hash__å   r4   r5   c                 ó@   — d}| j         D ]
}|d|z  z   }Œ| j        › |› �S )NÚ ú%s)r_   r^   )r   Úr_strÚrs      r   r   zDirection.__str__ì   s;   € ØˆØ”ð 	%ð 	%ˆAØ˜D 1™HÑ$ˆEˆEØ”)Ð$˜UÐ$Ð$Ð$r   c                 ól   — | j         dk    rt          d| j        ¦  «        S t          d| j        ¦  «        S )Nrd   rh   )r^   r\   r_   r   s    r   Ú__neg__zDirection.__neg__ó   s3   € ØŒ9˜ÒÐÝ˜T 4¤<Ñ0Ô0Ð0å˜S $¤,Ñ/Ô/Ð/r   N)r,   r6   r7   r8   rA   rf   ri   ra   rn   rr   r   r   rx   r|   r#   r&   r-   r3   r   r‡   r
   r   r   r\   r\   ”   s  € € € € € ðð ð:ð :ð :ð ð  ð  ð!ð !ð !ðð ð ðð ð ð#ð #ð #ðð ð ðð ð ð'ð 'ð 'ð'ð 'ð 'ð
ð 
ð 
ð!ð !ð !ðFð Fð Fðð ð ð%ð %ð %ð0ð 0ð 0ð 0ð 0r   r\   c                   óL   — e Zd ZdZg fd„Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ ZdS )ÚPrimitiveCategoryz«
    Class representing primitive categories.
    Takes a string representation of the category, and a
    list of strings specifying the morphological subcategories.
    c                 óN   — || _         || _        |t          |¦  «        f| _        d S r   )Ú_categr_   r`   r"   )r   Úcategrb   s      r   rA   zPrimitiveCategory.__init__  s+   € ØˆŒØ#ˆŒØ %¥u¨\Ñ':Ô':Ð;ˆÔÐÐr   c                 ó   — dS rO   r
   r   s    r   r   zPrimitiveCategory.is_primitive  rP   r   c                 ó   — dS rK   r
   r   s    r   r   zPrimitiveCategory.is_function	  rL   r   c                 ó   — dS rK   r
   r   s    r   r   zPrimitiveCategory.is_var  rL   r   c                 ó   — | j         S r   rm   r   s    r   rn   zPrimitiveCategory.restrs  s
   € ØŒ|Ðr   c                 ó   — | j         S r   )r‹   r   s    r   rŒ   zPrimitiveCategory.categ  s
   € ØŒ{Ðr   c                 ó   — | S r   r
   )r   ru   s     r   r   zPrimitiveCategory.substitute  s   € Øˆr   c                 ó  — |                      ¦   «         sd S |                     ¦   «         r|| fgS |                     ¦   «         |                      ¦   «         k    r%| j        D ]}||                     ¦   «         vr d S Œg S d S r   )r   r   rŒ   r_   rn   )r   r   Úrestrs      r   r   zPrimitiveCategory.can_unify  sŒ   € Ø×!Ò!Ñ#Ô#ð 	Ø�4Ø�<Š<‰>Œ>ð 	#Ø˜D�M�?Ð"Ø�;Š;‰=Œ=˜DŸJšJ™LœLÒ(Ð(Øœð  ð  �Ø §¢¡¤Ð.Ð.Ø˜4˜4ð /àˆIØˆtr   c                 ó�   — | j         g k    r
d| j        z  S dd                     d„ | j         D ¦   «         ¦  «        z  }| j        › |› �S )Nrƒ   z[%s]rw   c              3   ó4   K  — | ]}t          |¦  «        V — Œd S r   )Úrepr)Ú.0r…   s     r   ú	<genexpr>z,PrimitiveCategory.__str__.<locals>.<genexpr>+  s(   è è € Ð(GÐ(G°Q­¨a©¬Ð(GÐ(GÐ(GÐ(GÐ(GÐ(Gr   )r_   r‹   Újoin)r   rb   s     r   r   zPrimitiveCategory.__str__(  sV   € ØŒ<˜2ÒÐØ˜$œ+Ñ%Ð%Ø §¢Ð(GÐ(G¸$¼,Ð(GÑ(GÔ(GÑ GÔ GÑGˆØ”+Ð-˜|Ð-Ð-Ð-r   N)r,   r6   r7   r8   rA   r   r   r   rn   rŒ   r   r   r   r
   r   r   r‰   r‰   ú   s¯   € € € € € ðð ð ,.ð <ð <ð <ð <ð
ð ð ðð ð ðð ð ðð ð ðð ð ðð ð ð
ð 
ð 
ð.ð .ð .ð .ð .r   r‰   c                   óN   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ ZdS )ÚFunctionalCategoryzœ
    Class that represents a function application category.
    Consists of argument and result categories, together with
    an application direction.
    c                 óD   — || _         || _        || _        |||f| _        d S r   )Ú_resÚ_argr^   r"   )r   ÚresÚargra   s       r   rA   zFunctionalCategory.__init__6  s+   € ØˆŒ	ØˆŒ	ØˆŒ	Ø # S¨#˜ˆÔÐÐr   c                 ó   — dS rK   r
   r   s    r   r   zFunctionalCategory.is_primitive<  rL   r   c                 ó   — dS rO   r
   r   s    r   r   zFunctionalCategory.is_function?  rP   r   c                 ó   — dS rK   r
   r   s    r   r   zFunctionalCategory.is_varB  rL   r   c                 óÊ   — | j                              |¦  «        }| j                             |¦  «        }| j                             |¦  «        }t	          ||| j        ¦  «        S r   )rž   r   r^   rŸ   rœ   )r   ru   Úsub_resÚsub_dirÚsub_args        r   r   zFunctionalCategory.substituteG  sU   € Ø”)×&Ò& tÑ,Ô,ˆØ”)×&Ò& tÑ,Ô,ˆØ”)×&Ò& tÑ,Ô,ˆÝ! '¨7°D´IÑ>Ô>Ð>r   c                 óÊ  — |                      ¦   «         r|| fgS |                     ¦   «         rµ| j                             |                     ¦   «         ¦  «        }| j                             |                     ¦   «         ¦  «        }|�[|�Y| j                             |¦  «                             | 	                    ¦   «                              |¦  «        ¦  «        }|�||z   S d S r   )
r   r   rž   r   r    r^   ra   rŸ   r   r¡   )r   r   ÚsaÚsdÚsbs        r   r   zFunctionalCategory.can_unifyO  sÁ   € Ø�<Š<‰>Œ>ð 	#Ø˜D�M�?Ð"Ø×ÒÑÔð 	#Ø”×$Ò$ U§Y¢Y¡[¤[Ñ1Ô1ˆBØ”×$Ò$ U§Y¢Y¡[¤[Ñ1Ô1ˆBØˆ~ " .Ø”Y×)Ò)¨"Ñ-Ô-×7Ò7¸¿	º	¹¼×8NÒ8NÈrÑ8RÔ8RÑSÔS�Ø�>Ø ™7�NØˆtr   c                 ó   — | j         S r   )rŸ   r   s    r   r¡   zFunctionalCategory.arg\  rk   r   c                 ó   — | j         S r   )rž   r   s    r   r    zFunctionalCategory.res_  rk   r   c                 ó   — | j         S r   re   r   s    r   ra   zFunctionalCategory.dirb  rk   r   c                 ó4   — d| j         › | j        › | j        › d�S )Nú(ú))rž   r^   rŸ   r   s    r   r   zFunctionalCategory.__str__e  s#   € Ø5�4”9Ð5˜dœiÐ5¨¬Ð5Ð5Ð5Ð5r   N)r,   r6   r7   r8   rA   r   r   r   r   r   r¡   r    ra   r   r
   r   r   rœ   rœ   /  s´   € € € € € ðð ð/ð /ð /ðð ð ðð ð ðð ð ð
?ð ?ð ?ð
ð 
ð 
ðð ð ðð ð ðð ð ð6ð 6ð 6ð 6ð 6r   rœ   N)Úabcr   r   Ú	functoolsr   Únltk.internalsr   r   r;   r\   r‰   rœ   r
   r   r   ú<module>r¶      sR  ðð (Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø $Ð $Ð $Ð $Ð $Ð $à 2Ð 2Ð 2Ð 2Ð 2Ð 2ð ðAð Að Að Að A Gð Añ Aô Añ „ðAðH>&ð >&ð >&ð >&ð >&Ð ñ >&ô >&ð >&ðB ðb0ð b0ð b0ð b0ð b0ñ b0ô b0ñ „ðb0ðJ2.ð 2.ð 2.ð 2.ð 2.Ð+ñ 2.ô 2.ð 2.ðj76ð 76ð 76ð 76ð 76Ð,ñ 76ô 76ð 76ð 76ð 76r   