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 :  /lib/python3/dist-packages/lunr/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/lunr/__pycache__/token_set.cpython-311.pyc
�

WIb�$�� �Gd�d��ZdS)c��eZdZdZdZd�Zd�Zd�Zed���Z	ed���Z
ed���Zed	���Zd
�Z
d�ZdS)
�TokenSeta�
    A token set is used to store the unique list of all tokens
    within an index. Token sets are also used to represent an
    incoming query to the index, this query token set and index
    token set are then intersected to find which tokens to look
    up in the inverted index.

    A token set can hold multiple tokens, as in the case of the
    index token set, or it can hold a single token as in the
    case of a simple query token set.

    Additionally token sets are used to perform wildcard matching.
    Leading, contained and trailing wildcards are supported, and
    from this edit distance matching can also be provided.

    Token sets are implemented as a minimal finite state automata,
    where both common prefixes and suffixes are shared between tokens.
    This helps to reduce the space used for storing the token set.

    TODO: consider https://github.com/glyph/automat
    �c�d�d|_i|_|j|_|jxjdz
c_dS)NFr)�final�edges�_next_id�id�	__class__��selfs �0/usr/lib/python3/dist-packages/lunr/token_set.py�__init__zTokenSet.__init__s5����
���
��-�������1�$�����c�2�	|jS#t$rYnwxYw|jrdnd}tt	|j�������D]?}|j|}	t|j��}n#t$rd}YnwxYw||z|z}�@|S)N�1�0�)	�_string�AttributeErrorr�sorted�listr�keys�strr	)r�string�label�node�node_ids     r
�__str__zTokenSet.__str__ s���	��<����	�	�	��D�	�����
�+������D�����!2�!2�3�3�4�4�	.�	.�E��:�e�$�D�
��d�g�,�,����!�
�
�
�����
�����e�^�g�-�F�F��
s�	�
��'A<�<B�
Bc�F�d�t|����S)Nz<TokenSet "{}">)�formatrrs r
�__repr__zTokenSet.__repr__3s�� �'�'��D�	�	�2�2�2rc���t��}|}t|��D]T\}}|t|��dz
k}|dkr||j|<||_�3t��}||_||j|<|}�U|S)z�Creates a TokenSet from a string.

        The string may contain one or more wildcard characters (*) that will
        allow wildcard matching when intersecting with another TokenSet
        r�*)r�	enumerate�lenrr)rrr�root�i�charr�next_s        r
�from_stringzTokenSet.from_string6s����z�z����!��(�(�		�		�G�A�t���V���q��(�E��s�{�{�#'��
�4� �"��
�
� �
�
��#���#(��
�4� �����rc���t��}|||d�g}|�rV|���}t|d��dkr�|dd}d}||djvr|dj|}nt��}||dj|<t|d��dkrd|_|�||d|ddd�d���|ddkr��d	|djvr|djd	}nt��}||djd	<t|d��dkrd|_|�||ddz
|dd���t|d��dkr6|�|d|ddz
|ddd�d���t|d��dkr
d|d_t|d��dkr�d	|djvr|djd	}	nt��}	|	|djd	<t|d��dkrd|	_|�|	|ddz
|ddd�d���|dr�t|d��dkr�|dd}
|dd}d}||djvr|dj|}nt��}||dj|<t|d��dkrd|_|�||ddz
|
|dd
d�zd���|��V|S)a�Creates a token set representing a single string with a specified
        edit distance.

        Insertions, deletions, substitutions and transpositions are each
        treated as an edit distance of 1.

        Increasing the allowed edit distance will have a dramatic impact
        on the performance of both creating and intersecting these TokenSets.
        It is advised to keep the edit distance less than 3.
        )r�edits_remainingrr�NrrTr,r#�)r�popr%rr�append)
�clsr�
edit_distancer&�stack�framer(�no_edit_node�insertion_node�substitution_node�char_a�char_b�transpose_nodes
             r
�from_fuzzy_stringzTokenSet.from_fuzzy_stringQs����z�z���=�F�S�S�T���e	��I�I�K�K�E��5��?�#�#�a�'�'��X��q�)��#���5��=�.�.�.�#(��=�#6�t�#<�L�L�#+�:�:�L�0<�E�&�M�'��-��u�X��'�'�1�,�,�)-�L�&���� ,�+0�1B�+C�"'��/�!�"�"�"5�������&�'�1�,�,���e�F�m�)�)�)�!&�v��!4�S�!9���!)����+9��f�
�#�C�(��5��?�#�#�q�(�(�'+��$��L�L�*�',�->�'?�!�'C�#�H�o���
�
�
��5��?�#�#�a�'�'���� %�f�
�+0�1B�+C�a�+G�"'��/�!�"�"�"5�������5��?�#�#�q�(�(�&*��f�
�#��5��?�#�#�q�(�(��%��-�-�-�-�(-�f�
�(;�C�(@�%�%�(0�
�
�%�/@�E�&�M�'��,��u�X��'�'�1�,�,�.2�%�+���� 1�+0�1B�+C�a�+G�"'��/�!�"�"�"5�������&�'�
�C��h��,@�,@�1�,D�,D��x���+���x���+��!%���U�6�]�0�0�0�%*�6�]�%8��%@�N�N�%-�Z�Z�N�2@�E�&�M�'��/��u�X��'�'�1�,�,�+/�N�(���� .�+0�1B�+C�a�+G�"(�5��?�1�2�2�+>�">�������e	�N�rc��ddlm}|��}|D]}|�|���|���|jS)Nr-)�TokenSetBuilder)�lunr.token_set_builderr=�insert�finishr&)r1�
list_of_wordsr=�builder�words     r
�	from_listzTokenSet.from_list�s]��:�:�:�:�:�:�!�/�#�#��!�	!�	!�D��N�N�4� � � � ��������|�rc��|jr |�|j|j��S|�|j��S)N)r2r;�termr*)r1�clauses  r
�from_clausezTokenSet.from_clause�s<����	0��(�(���f�6J�K�K�K��?�?�6�;�/�/�/rc�X�g}d|d�g}|r�|���}|djr|�|d��|dj���D]A}|�|dt|��z|dj|d����B|��|S)Nr)�prefixrrrJ)r/rr0rrr)r�wordsr3r4�edges     r
�to_listzTokenSet.to_list�s�������-�-�.���	��I�I�K�K�E��V�}�"�
.����U�8�_�-�-�-��f�
�+�0�0�2�2�
�
�����"'��/�C��I�I�"=� %�f�
� 3�D� 9�������
�	��rc�N�t��}|||d�g}|�r|���}|dj���D]�}|dj���D]�}||ks|dkr�|dj|}|dj|}|jo|j}	d}
||djvr"|dj|}
|
jp|	|
_n%t��}
|	|
_|
|dj|<|�|||
d�������|��|S)z�Returns a new TokenSet that is the intersection of this TokenSet
        and the passed TokenSet.

        This intersection will take into account any wildcards contained within
        the TokenSet.
        )r�q_node�outputrOrr#NrP)rr/rrrr0)r�otherrPr3r4�q_edge�n_edgerrOrr)s           r
�	intersectzTokenSet.intersect�sO�������%�6�B�B�C���	X��I�I�K�K�E���/�/�4�4�6�6�
X�
X��#�F�m�1�6�6�8�8�X�X�F���'�'�6�S�=�=�$�V�}�2�6�:��!&�x��!6�v�!>�� $�
� ;�v�|�� $��!�U�8�_�%:�:�:�$)�(�O�$9�&�$A�E�*/�+�*>��E�K�K�$,�J�J�E�*/�E�K�<A�E�(�O�1�&�9����d�f�PU�%V�%V�W�W�W��X��	X�(�
rN)�__name__�
__module__�__qualname__�__doc__rrrr!�classmethodr*r;rDrHrMrT�rr
rrs���������,�H�%�%�%����&3�3�3�����[��4�v�v��[�v�p����[���0�0��[�0����&����rrN)rrZrr
�<module>r[sA��L�L�L�L�L�L�L�L�L�Lr

Youez - 2016 - github.com/yon3zu
LinuXploit