Ë
    çÍ:jQ  ã                   ó"   — d Z d„ Zd„ Zd„ Zdd„Zy)z#
Tools for comparing ranked lists.
c              #   ó„   K  — t        | «      } t        |«      }| D ]  }	 || |   ||   z
  f–— Œ y# t        $ r Y Œ!w xY w­w)z¸Finds the difference between the values in ranks1 and ranks2 for keys
    present in both dicts. If the arguments are not dicts, they are converted
    from (key, rank) sequences.
    N)ÚdictÚKeyError)Úranks1Úranks2Úks      új/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/nltk/metrics/spearman.pyÚ_rank_distsr	      sY   è ø€ ô
 �&‹\€FÜ�&‹\€FØò ˆð	Ø�V˜A‘Y ¨¡Ñ*Ð*Ó*ñøô ò 	Ùð	üs    ‚A Ÿ1®A ±	=ºA ¼=½A c                 ó”   — d}d}t        | |«      D ]  \  }}|||z  z  }|dz  }Œ 	 dd|z  |||z  dz
  z  z  z
  S # t        $ r Y yw xY w)aU  Returns the Spearman correlation coefficient for two rankings, which
    should be dicts or sequences of (key, rank). The coefficient ranges from
    -1.0 (ranks are opposite) to 1.0 (ranks are identical), and is only
    calculated for keys in both rankings (for meaningful results, remove keys
    present in only one list before ranking).é    é   é   g        )r	   ÚZeroDivisionError)r   r   ÚnÚresr   Úds         r   Úspearman_correlationr      su   € ð 	
€AØ
€CÜ˜F FÓ+ò ‰ˆˆ1Øˆq�1‰u‰ˆØ	ˆQ‰‰ððØ�A˜‘G˜q A¨¡E¨A¡I™Ñ/Ñ0Ð0øÜò áðús   §; »	AÁAc                 ó&   — d„ t        | «      D «       S )z„Given a sequence, yields each element with an increasing rank, suitable
    for use as an argument to ``spearman_correlation``.
    c              3   ó*   K  — | ]  \  }}||f–— Œ y ­w)N© )Ú.0Úir   s      r   ú	<genexpr>z&ranks_from_sequence.<locals>.<genexpr>1   s   è ø€ Ò.‘t�q˜!ˆQ�ŒFÑ.ùs   ‚)Ú	enumerate)Úseqs    r   Úranks_from_sequencer   -   s   € ñ /œy¨›~Ô.Ð.ó    c              #   ó–   K  — d}d}t        | «      D ]$  \  }\  }}	 t        ||z
  «      |kD  r|}||f–— |}Œ& y# t        $ r Y Œw xY w­w)züGiven a sequence of (key, score) tuples, yields each key with an
    increasing rank, tying with previous key's rank if the difference between
    their scores is less than rank_gap. Suitable for use as an argument to
    ``spearman_correlation``.
    Nr   )r   ÚabsÚ	TypeError)ÚscoresÚrank_gapÚ
prev_scoreÚrankr   ÚkeyÚscores          r   Úranks_from_scoresr&   4   sm   è ø€ ð €JØ€DÜ$ VÓ,ò ‰ˆ‰<ˆC�ð	Ü�5˜:Ñ%Ó&¨Ò1Ø�ð �4ˆiŠØ‰
ñøô ò 	Ùð	üs%   ‚A	œ:¯A	º	AÁA	ÁAÁA	N)gVçž¯Ò<)Ú__doc__r	   r   r   r&   r   r   r   ú<module>r(      s   ðñò
òò$/ôr   