
    f j                     b    d Z ddlmZmZ ddlmZ ddlmZ dede	edf         de
e         fd	Zd
S )zStage 3: Statistical bigram scoring.

Note: ``from __future__ import annotations`` is intentionally omitted because
this module is compiled with mypyc, which does not support PEP 563 string
annotations.
    )BigramProfilescore_best_languageDetectionResult)EncodingInfodata
candidates.returnc                     | r|sg S t          |           }g }|D ]?}t          | |j        |          \  }}|dk    r|                    |j        ||f           @|                    d d           d |D             S )zScore all candidates and return results sorted by confidence descending.

    :param data: The raw byte data to score.
    :param candidates: Encoding candidates to evaluate.
    :returns: A list of :class:`DetectionResult` sorted by confidence.
    )profileg        c                     | d         S )N    )xs    pC:\Users\Terasoftware\OneDrive\Desktop\faahhh\fyndo\fyndo\venv\Lib\site-packages\chardet/pipeline/statistical.py<lambda>z"score_candidates.<locals>.<lambda>!   s
    ad     T)keyreversec                 :    g | ]\  }}}t          |||           S ))encoding
confidencelanguager   ).0nameslangs       r   
<listcomp>z$score_candidates.<locals>.<listcomp>"   s=       D!T 	!dCCC  r   )r   r   r   appendsort)r   r	   r   scoresencr   r   s          r   score_candidatesr#      s      z 	D!!G24F / /%dCHgFFF4s7 	/MM38Q-...
KKNNDK111 #   r   N)__doc__chardet.modelsr   r   chardet.pipeliner   chardet.registryr   bytestuplelistr#   r   r   r   <module>r+      s     > = = = = = = = , , , , , , ) ) ) ) ) )
"<#45	/     r   