| 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 : |
�
WIb�$ � � � G d � d� � Z dS )c � � e Zd ZdZdZd� Zd� Zd� Zed� � � Z ed� � � Z
ed� � � Zed � � � Zd
� Z
d� ZdS )
�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 | _ | j xj dz
c_ d S )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 � | j S # t $ r Y nw xY w| j rdnd}t t | j � � � � � � � D ]?}| j | } t |j � � }n# t $ r d}Y nw xY w||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 "{}">)�formatr r s r
�__repr__zTokenSet.__repr__3 s � � �'�'��D� � �2�2�2r c �� � t � � }|}t |� � D ]T\ }}|t |� � dz
k }|dk r||j |<