+
    ʇi                    |    ^ RI Ht ^ RIHt ^ RIHtHt R tRRRR/R ltRRRR/R	 lt	RRRR/R
 lt
RRRR/R ltR# )    )annotations)conv_sequences)is_nonesetupPandasc                   \        \        V 4      \        V4      4      ^,           p/ pVP                  p\        V4      ^,           pV.V,          pV.V,          p\        \	        V4      4      pW(R&   \	        ^\        V 4      ^,           4       EFf  p	YxrxRp
V^ ,          pW^ &   Tp\	        ^\        V4      ^,           4       EF  pW}^,
          ,          W	^,
          ,          W^,
          ,          8g  ,           pW^,
          ,          ^,           pW},          ^,           p\        WV4      pW	^,
          ,          W^,
          ,          8X  d   Tp
W}^,
          ,          Wm&   TpMrV! W^,
          ,          R4      pT
pVV,
          ^8X  d$   Wm,          V	V,
          ,           p\        VV4      pM)V	V,
          ^8X  d   WV,
          ,           p\        VV4      pW,          pVW&   EK   	  WW	^,
          ,          &   EKi  	  V\        V4      ,          # )   )maxlengetlistrangemin)s1s2maxVallast_row_idlast_row_id_getsizeFRR1Rilast_col_id	last_i2l1Tjdiagleftuptempkl	transposes   &&                   }/Users/max/.openclaw/workspace/postharvest/merge_env/lib/python3.14/site-packages/rapidfuzz/distance/DamerauLevenshtein_py.py"_damerau_levenshtein_distance_zhaor&   	   s   R#b'"Q&FK!ooOr7Q;D
DB
DBU4[AbE1c"gk"2aD	!q#b'A+&A!e9q5	RAY 67DU8a<DBt2&Da%yB1uI%q5	#B1uIr2Ea< "QItY/D!e\ !UItY/DIAD- '0 "#B1uI? #B SW:    	processorNscore_cutoffc                   Ve   V! V 4      p V! V4      p\        W4      w  r\        W4      pVe   WC8:  d   V# V^,           # )aC  
Calculates the Damerau-Levenshtein distance.

Parameters
----------
s1 : Sequence[Hashable]
    First string to compare.
s2 : Sequence[Hashable]
    Second string to compare.
processor: callable, optional
    Optional callable that is used to preprocess the strings before
    comparing them. Default is None, which deactivates this behaviour.
score_cutoff : int, optional
    Maximum distance between s1 and s2, that is
    considered as a result. If the distance is bigger than score_cutoff,
    score_cutoff + 1 is returned instead. Default is None, which deactivates
    this behaviour.

Returns
-------
distance : int
    distance between s1 and s2

Examples
--------
Find the Damerau-Levenshtein distance between two strings:

>>> from rapidfuzz.distance import DamerauLevenshtein
>>> DamerauLevenshtein.distance("CA", "ABC")
2
)r   r&   )r   r   r(   r)   dists   &&$$ r%   distancer,   7   sN    L r]r]B#FB-b5D (D,@4W|VWGWWr'   c                   Ve   V! V 4      p V! V4      p\        W4      w  r\        \        V 4      \        V4      4      p\        W4      pWE,
          pVe   Wc8  d   V# ^ # )a  
Calculates the Damerau-Levenshtein similarity in the range [max, 0].

This is calculated as ``max(len1, len2) - distance``.

Parameters
----------
s1 : Sequence[Hashable]
    First string to compare.
s2 : Sequence[Hashable]
    Second string to compare.
processor: callable, optional
    Optional callable that is used to preprocess the strings before
    comparing them. Default is None, which deactivates this behaviour.
score_cutoff : int, optional
    Maximum distance between s1 and s2, that is
    considered as a result. If the similarity is smaller than score_cutoff,
    0 is returned instead. Default is None, which deactivates
    this behaviour.

Returns
-------
similarity : int
    similarity between s1 and s2
)r   r
   r   r,   )r   r   r(   r)   maximumr+   sims   &&$$   r%   
similarityr0   f   sc    @ r]r]B#FB#b'3r7#GBD
.C'3+>3FQFr'   c               2   \        4        \        V 4      '       g   \        V4      '       d   R# Ve   V! V 4      p V! V4      p\        W4      w  r\        \	        V 4      \	        V4      4      p\        W4      pV'       d	   WT,          M^ pVe   Wc8:  d   V# ^# )a  
Calculates a normalized Damerau-Levenshtein distance in the range [1, 0].

This is calculated as ``distance / max(len1, len2)``.

Parameters
----------
s1 : Sequence[Hashable]
    First string to compare.
s2 : Sequence[Hashable]
    Second string to compare.
processor: callable, optional
    Optional callable that is used to preprocess the strings before
    comparing them. Default is None, which deactivates this behaviour.
score_cutoff : float, optional
    Optional argument for a score threshold as a float between 0 and 1.0.
    For norm_dist > score_cutoff 1.0 is returned instead. Default is 1.0,
    which deactivates this behaviour.

Returns
-------
norm_dist : float
    normalized distance between s1 and s2 as a float between 0 and 1.0
      ?)r   r   r   r
   r   r,   )r   r   r(   r)   r.   r+   	norm_dists   &&$$   r%   normalized_distancer4      s    > Mr{{gbkkr]r]B#FB#b'3r7#GBD")qI%-1J9RQRRr'   c                   \        4        \        V 4      '       g   \        V4      '       d   R# Ve   V! V 4      p V! V4      p\        W4      w  r\        W4      pRV,
          pVe   WS8  d   V# ^ # )a  
Calculates a normalized Damerau-Levenshtein similarity in the range [0, 1].

This is calculated as ``1 - normalized_distance``

Parameters
----------
s1 : Sequence[Hashable]
    First string to compare.
s2 : Sequence[Hashable]
    Second string to compare.
processor: callable, optional
    Optional callable that is used to preprocess the strings before
    comparing them. Default is None, which deactivates this behaviour.
score_cutoff : float, optional
    Optional argument for a score threshold as a float between 0 and 1.0.
    For norm_sim < score_cutoff 0 is returned instead. Default is 0,
    which deactivates this behaviour.

Returns
-------
norm_sim : float
    normalized similarity between s1 and s2 as a float between 0 and 1.0
g        r2   )r   r   r   r4   )r   r   r(   r)   r3   norm_sims   &&$$  r%   normalized_similarityr7      si    > Mr{{gbkkr]r]B#FB#B+IYH$,0H8PqPr'   )
__future__r   rapidfuzz._common_pyr   rapidfuzz._utilsr   r   r&   r,   r0   r4   r7    r'   r%   <module>r<      s    # / 1+\,X 	,X
 ,X^(G 	(G
 (GV+S 	+S
 +S\*Q 	*Q
 *Qr'   