File: //home/arjun/projects/env/lib/python3.10/site-packages/fuzzywuzzy/__pycache__/fuzz.cpython-310.pyc
o
wew% � @ s d dl mZ d dlZd dlZzddlmZ W n ey0 e�� dkr(e�d� d dl mZ Y nw ddl
mZ ejej
ejd d
� ���Zejej
ejdd� ���Zd$dd�Zejd%dd��Zd&dd�Zd&dd�Zejd%dd��Zd&dd�Zd&dd�Zd&dd�Zd$dd�Zd&d d!�Zd$d"d#�ZdS )'� )�unicode_literalsN� )�
StringMatcher�PyPyzYUsing slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning)�SequenceMatcher)�utilsc C s. t �| |�\} }td | |�}t �d|�� �S )N�d )r �make_type_consistentr �intr�ratio)�s1�s2�m� r �H/home/arjun/projects/env/lib/python3.10/site-packages/fuzzywuzzy/fuzz.pyr s r c
C s� t �| |�\} }t| �t|�kr| }|}n|}| }td||�}|�� }g }|D ]8}|d |d dkr;|d |d nd}|t|� } ||| � }
td||
�}|�� }|dkrZ dS |�|� q't �dt|� �S )zR"Return the ratio of the most similar substring
as a number between 0 and 100.Nr r gףp=
��?r ) r r �lenr �get_matching_blocksr �appendr
�max)
r r
�shorter�longerr �blocks�scores�block�
long_start�long_end�long_substr�m2�rr r r �
partial_ratio s&