ó
    ÎN„iÂ  ã                   óš   • S SK JrJrJrJrJ	r
JrJrJr  SSKJr  S rS rS rSS jrSS jrSS	 jrSS
 jr	SS jrSS jrSS jrSS jrg)é    )ÚratioÚpartial_ratioÚtoken_set_ratioÚtoken_sort_ratioÚpartial_token_set_ratioÚpartial_token_sort_ratioÚWRatioÚQRatioé   )Úutilsc                 ó¢   • U(       a/  Ub  Uc  g[         R                  " XS9n[         R                  " X#S9n[        [        U " X5      5      5      $ )zL
wrapper around rapidfuzz function to be compatible with the API of thefuzz
r   )Úforce_ascii)r   Úfull_processÚintÚround)ÚscorerÚs1Ús2r   r   s        ÚK/var/www/html/land-tabula/venv/lib/python3.13/site-packages/thefuzz/fuzz.pyÚ_rapidfuzz_scorerr      sG   € ö Ø‰:˜™Øä×Ò Ñ<ˆÜ×Ò Ñ<ˆäŒu‘V˜B“^Ó$Ó%Ð%ó    c                 ó&   • [        [        XSS5      $ )NF)r   Ú_ratio©r   r   s     r   r   r   #   s   € ÜœV R¨U°EÓ:Ð:r   c                 ó&   • [        [        XSS5      $ )zO
Return the ratio of the most similar substring
as a number between 0 and 100.
F)r   Ú_partial_ratior   s     r   r   r   '   s   € ô
 œ^¨R°U¸EÓBÐBr   c                 ó$   • [        [        XX#5      $ )zi
Return a measure of the sequences' similarity between 0 and 100
but sorting the token before comparing.
)r   Ú_token_sort_ratio©r   r   r   r   s       r   r   r   7   s   € ô
 Ô.°¸ÓRÐRr   c                 ó$   • [        [        XX#5      $ )zv
Return the ratio of the most similar substring as a number between
0 and 100 but sorting the token before comparing.
)r   Ú_partial_token_sort_ratior   s       r   r   r   ?   s   € ô
 Ü! 2¨;óð r   c                 ó$   • [        [        XX#5      $ ©N)r   Ú_token_set_ratior   s       r   r   r   I   s   € ÜÔ-¨r°{ÓQÐQr   c                 ó$   • [        [        XX#5      $ r#   )r   Ú_partial_token_set_ratior   s       r   r   r   M   s   € ÜÜ  "¨+óð r   c                 ó$   • [        [        XX#5      $ )ax  
Quick ratio comparison between two strings.

Runs full_process from utils on both strings
Short circuits if either of the strings is empty after processing.

:param s1:
:param s2:
:param force_ascii: Allow only ASCII characters (Default: True)
:full_process: Process inputs, used here to avoid double processing in extract functions (Default: True)
:return: similarity ratio
)r   Ú_QRatior   s       r   r
   r
   X   s   € ô œW b¨kÓHÐHr   c                 ó   • [        XSUS9$ )zr
Unicode quick ratio

Calls QRatio with force_ascii set to False

:param s1:
:param s2:
:return: similarity ratio
F©r   r   )r
   ©r   r   r   s      r   ÚUQRatior,   h   s   € ô " e¸,ÑGÐGr   c                 ó$   • [        [        XX#5      $ )aþ  
Return a measure of the sequences' similarity between 0 and 100, using different algorithms.

**Steps in the order they occur**

#. Run full_process from utils on both strings
#. Short circuit if this makes either string empty
#. Take the ratio of the two processed strings (fuzz.ratio)
#. Run checks to compare the length of the strings
    * If one of the strings is more than 1.5 times as long as the other
      use partial_ratio comparisons - scale partial results by 0.9
      (this makes sure only full results can return 100)
    * If one of the strings is over 8 times as long as the other
      instead scale by 0.6

#. Run the other ratio functions
    * if using partial ratio functions call partial_ratio,
      partial_token_sort_ratio and partial_token_set_ratio
      scale all of these by the ratio based on length
    * otherwise call token_sort_ratio and token_set_ratio
    * all token based comparisons are scaled by 0.95
      (on top of any partial scalars)

#. Take the highest value from these results
   round it and return it as an integer.

:param s1:
:param s2:
:param force_ascii: Allow only ascii characters
:type force_ascii: bool
:full_process: Process inputs, used here to avoid double processing in extract functions (Default: True)
:return:
)r   Ú_WRatior   s       r   r	   r	   v   s   € ôD œW b¨kÓHÐHr   c                 ó   • [        XSUS9$ )z…
Return a measure of the sequences' similarity between 0 and 100,
using different algorithms. Same as WRatio but preserving unicode.
Fr*   )r	   r+   s      r   ÚUWRatior0   ›   s   € ô
 " e¸,ÑGÐGr   N)TT)T)Úrapidfuzz.fuzzr   r   r   r   r   r$   r   r   r   r&   r   r!   r	   r.   r
   r(   Ú r   r   r,   r0   © r   r   Ú<module>r4      sX   ð÷	÷ 	ó 	õ ò&ò;òCô SôôRôôIô 
Hô"IõJHr   