403Webshell
Server IP : 54.37.205.81  /  Your IP : 216.73.216.76
Web Server : nginx/1.22.1
System : Linux vps-249481fa 6.1.0-50-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.176-1 (2026-07-02) x86_64
User : debian ( 1000)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/nltk/ccg/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/nltk/ccg/__pycache__/api.cpython-311.pyc
�

 T�c'����ddlmZmZddlmZddlmZeGd�de�����ZGd�de��ZeGd	�d
����Z	Gd�de��Z
Gd
�de��ZdS)�)�ABCMeta�abstractmethod)�total_ordering)�raise_unorderable_typesc��eZdZdZed���Zed���Zed���Zed���Zed���Z	ed���Z
d�Zd	�Zd
�Z
d�ZdS)
�AbstractCCGCategoryz;
    Interface for categories in combinatory grammars.
    c��dS)z<
        Returns true if the category is primitive.
        N���selfs �./usr/lib/python3/dist-packages/nltk/ccg/api.py�is_primitivez AbstractCCGCategory.is_primitive�����c��dS)zI
        Returns true if the category is a function application.
        Nr
rs r
�is_functionzAbstractCCGCategory.is_functionrrc��dS)z=
        Returns true if the category is a variable.
        Nr
rs r
�is_varzAbstractCCGCategory.is_var rrc��dS)z�
        Takes a set of (var, category) substitutions, and replaces every
        occurrence of the variable with the corresponding category.
        Nr
)r�
substitutionss  r
�
substitutezAbstractCCGCategory.substitute&rrc��dS)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_unifyzAbstractCCGCategory.can_unify-rrc��dS�Nr
rs r
�__str__zAbstractCCGCategory.__str__6s���rc�>�|j|juo|j|jkSr��	__class__�_comparison_keyrs  r
�__eq__zAbstractCCGCategory.__eq__:�&���N�e�o�-�
>��$��(=�=�	
rc��||kSrr
rs  r
�__ne__zAbstractCCGCategory.__ne__@����5�=� � rc��t|t��std||��|j|jur|j|jkS|jj|jjkS�N�<)�
isinstancerrr!r"�__name__rs  r
�__lt__zAbstractCCGCategory.__lt__Cs\���%�!4�5�5�	6�#�C��u�5�5�5��>�U�_�,�,��'�%�*?�?�?��>�*�U�_�-E�E�Erc�r�	|jS#t$r#t|j��|_|jcYSwxYwr��_hash�AttributeError�hashr"rs r
�__hash__zAbstractCCGCategory.__hash__K�J��	��:����	�	�	��d�2�3�3�D�J��:����	�����	�*6�6N)r,�
__module__�__qualname__�__doc__rrrrrrrr#r&r-r3r
rr
rrs�������������^��
����^��
����^��
����^������^���
�
��^�
�
�
�
�!�!�!�F�F�F�����rr)�	metaclassc�t�eZdZdZdZdd�Zed���Zed���Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�ZdS)�CCGVarz�
    Class representing a variable CCG category.
    Used for conjunctions (and possibly type-raising, if implemented as a
    unary rule).
    rFc�^�|���|_||_|j|_dS)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__zCCGVar.__init__\s*���;�;�=�=���#���#�x����rc�4�|jdz|_|jdz
S)zT
        A class method allowing generation of unique variable identifiers.
        ���_maxID��clss r
r=z
CCGVar.new_idgs��
�Z�!�^��
��z�A�~�rc��d|_dS)NrrDrFs r
�reset_idzCCGVar.reset_idos
����
�
�
rc��dS�NFr
rs r
rzCCGVar.is_primitives����urc��dSrKr
rs r
rzCCGVar.is_functionvrLrc��dS�NTr
rs r
rz
CCGVar.is_vary����trc�*�|D]\}}||kr|cS�|S)zlIf there is a substitution corresponding to this variable,
        return the substituted category.
        r
)rr�var�cats    r
rzCCGVar.substitute|s3��(�	�	�J�S�#��d�{�{��
�
�
���rc�F�|���s|js||fgSdS)zWIf the variable can be replaced with other
        a substitution is returned.
        N)rr?rs  r
rzCCGVar.can_unify�s2�������	#�t��	#��5�M�?�"��trc��|jSr)r>rs r
�idz	CCGVar.id�s	���x�rc�0�dt|j��zS)N�_var)�strr>rs r
rzCCGVar.__str__�s����D�H�
�
�%�%rN)F)r,r6r7r8rErA�classmethodr=rIrrrrrrVrr
rr
r;r;Ss����������F�	(�	(�	(�	(�����[������[��������������������&�&�&�&�&rr;c�r�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�ZdS)�	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|_dSr)�_dir�_restrs�tupler")r�dir�restrictionss   r
rAzDirection.__init__�s+����	�#��� #�U�<�%8�%8�9����rc��|jdkS)N�/�r^rs r
�
is_forwardzDirection.is_forward�s���y�C��rc��|jdkS)N�\rers r
�is_backwardzDirection.is_backward�s���y�D� � rc��|jSrrers r
raz
Direction.dir��
���y�rc��|jS)a8A 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_rs r
�restrszDirection.restrs�s���|�rc��|jdkS�N�_rmrs r
�is_variablezDirection.is_variable�s���|�s�"�"rc�
�|���rd|���fgS|���rd|���fgS|���|���krgSdSrp)rrrnrs  r
rzDirection.can_unify�s{�������	��$�+�+�-�-�(�)�)�
�
�
�
�
�	��%�,�,�.�.�)�*�*��{�{�}�}������.�.��	��trc�|�|���s|S|D]"\}}|dkrt|j|��cS�#|Srp)rrr\r^)r�subsrRrns    r
rzDirection.substitute�sY�����!�!�	��K�!�	4�	4�M�S�&��c�z�z� ���F�3�3�3�3�3���rc��d|jvS)N�,rmrs r
�can_composezDirection.can_compose�����$�,�&�&rc��d|jvS)N�.rmrs r
�	can_crosszDirection.can_cross�ryrc�>�|j|juo|j|jkSrr rs  r
r#zDirection.__eq__�r$rc��||kSrr
rs  r
r&zDirection.__ne__�r'rc��t|t��std||��|j|jur|j|jkS|jj|jjkSr))r+r\rr!r"r,rs  r
r-zDirection.__lt__�s[���%��+�+�	6�#�C��u�5�5�5��>�U�_�,�,��'�%�*?�?�?��>�*�U�_�-E�E�Erc�r�	|jS#t$r#t|j��|_|jcYSwxYwrr/rs r
r3zDirection.__hash__�r4r5c�@�d}|jD]
}|d|zz}�|j�|��S)N��%s)r_r^)r�r_str�rs   r
rzDirection.__str__�s;������	%�	%�A��D�1�H�$�E�E��)�$�U�$�$�$rc�l�|jdkrtd|j��Std|j��S)Nrdrh)r^r\r_rs r
�__neg__zDirection.__neg__�s3���9�����T�4�<�0�0�0��S�$�,�/�/�/rN)r,r6r7r8rArfrirarnrrrrrxr|r#r&r-r3rr�r
rr
r\r\�s��������:�:�:� � � �!�!�!�������#�#�#�������'�'�'�'�'�'�
�
�
�!�!�!�F�F�F����%�%�%�0�0�0�0�0rr\c�L�eZdZdZgfd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZdS)�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|_dSr)�_categr_r`r")r�categrbs   r
rAzPrimitiveCategory.__init__s+�����#��� %�u�\�':�':�;����rc��dSrOr
rs r
rzPrimitiveCategory.is_primitiverPrc��dSrKr
rs r
rzPrimitiveCategory.is_function	rLrc��dSrKr
rs r
rzPrimitiveCategory.is_varrLrc��|jSrrmrs r
rnzPrimitiveCategory.restrss
���|�rc��|jSr)r�rs r
r�zPrimitiveCategory.categs
���{�rc��|Srr
)rrus  r
rzPrimitiveCategory.substitutes���rc��|���sdS|���r||fgS|���|���kr%|jD]}||���vrdS�gSdSr)rrr�r_rn)rr�restrs   r
rzPrimitiveCategory.can_unifys����!�!�#�#�	��4��<�<�>�>�	#��D�M�?�"��;�;�=�=�D�J�J�L�L�(�(���
 �
 ��������.�.��4�4�/��I��trc��|jgkr
d|jzSdd�d�|jD����z}|j�|��S)Nr�z[%s]rwc3�4K�|]}t|��V��dSr)�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rbs  r
rzPrimitiveCategory.__str__(sV���<�2����$�+�%�%�����(G�(G�$�,�(G�(G�(G� G� G�G���+�-�|�-�-�-rN)
r,r6r7r8rArrrrnr�rrrr
rr
r�r��s���������,.�<�<�<�<�
������������������
�
�
�.�.�.�.�.rr�c�N�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�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|_dSr)�_res�_argr^r")r�res�argras    r
rAzFunctionalCategory.__init__6s+����	���	���	� #�S�#�����rc��dSrKr
rs r
rzFunctionalCategory.is_primitive<rLrc��dSrOr
rs r
rzFunctionalCategory.is_function?rPrc��dSrKr
rs r
rzFunctionalCategory.is_varBrLrc���|j�|��}|j�|��}|j�|��}t	|||j��Sr)r�rr^r�r�)rru�sub_res�sub_dir�sub_args     r
rzFunctionalCategory.substituteGsU���)�&�&�t�,�,���)�&�&�t�,�,���)�&�&�t�,�,��!�'�7�D�I�>�>�>rc���|���r||fgS|���r�|j�|�����}|j�|�����}|�[|�Y|j�|���|�	���|����}|�||zSdSr)
rrr�rr�r^rar�rr�)rr�sa�sd�sbs     r
rzFunctionalCategory.can_unifyOs����<�<�>�>�	#��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��trc��|jSr)r�rs r
r�zFunctionalCategory.arg\rkrc��|jSr)r�rs r
r�zFunctionalCategory.res_rkrc��|jSrrers r
razFunctionalCategory.dirbrkrc�4�d|j�|j�|j�d�S)N�(�))r�r^r�rs r
rzFunctionalCategory.__str__es#��5�4�9�5�d�i�5���5�5�5�5rN)r,r6r7r8rArrrrrr�r�rarr
rr
r�r�/s���������/�/�/����������
?�?�?�
�
�
����������6�6�6�6�6rr�N)�abcrr�	functoolsr�nltk.internalsrrr;r\r�r�r
rr
�<module>r�sR��(�'�'�'�'�'�'�'�$�$�$�$�$�$�2�2�2�2�2�2��A�A�A�A�A�G�A�A�A���A�H>&�>&�>&�>&�>&�
 �>&�>&�>&�B�b0�b0�b0�b0�b0�b0�b0���b0�J2.�2.�2.�2.�2.�+�2.�2.�2.�j76�76�76�76�76�,�76�76�76�76�76r

Youez - 2016 - github.com/yon3zu
LinuXploit