
    3j
                    L   U d Z ddlmZ ddlZddlmZ ddlmZ dZded<    e	 e
d	d
            Zded<    e	dddg e
dd            Zded<    G d de      Z ej                  dd       G d d             Z eddd      Z ej                  d       G d d             Zy)z+Detection pipeline stages and shared types.    )annotationsN)field)	TypedDictgffffff?floatDETERMINISTIC_CONFIDENCE      bytes
HIGH_BYTES	   
             ASCII_TEXT_BYTESc                  :    e Zd ZU dZded<   ded<   ded<   ded<   y)	DetectionDictzDictionary representation of a detection result.

    Returned by :func:`chardet.detect`, :func:`chardet.detect_all`,
    and :attr:`chardet.UniversalDetector.result`.
    
str | Noneencodingr   
confidencelanguage	mime_typeN)__name__
__module____qualname____doc____annotations__     F/DATA/.local/lib/python3.12/site-packages/chardet/pipeline/__init__.pyr   r      s!     r   r   T)frozenslotsc                  F    e Zd ZU dZded<   ded<   ded<   dZded<   d
d	Zy)DetectionResultzA single encoding detection result.

    Frozen dataclass holding the encoding name, confidence score, and
    optional language identifier returned by the detection pipeline.
    r   r   r   r   r   Nr   c                `    | j                   | j                  | j                  | j                  dS )zConvert this result to a plain dict.

        :returns: A dict with ``'encoding'``, ``'confidence'``, ``'language'``, and ``'mime_type'`` keys.
        r   r   r   r   r&   )selfs    r    to_dictzDetectionResult.to_dict2   s*     //	
 	
r   )returnr   )r   r   r   r   r   r   r(   r   r   r    r$   r$   %   s*      Iz 

r   r$   g        )r   r   r   )r"   c                  t    e Zd ZU dZ ee      Zded<   dZded<    ee      Z	ded	<    ee      Z
ded
<   y)PipelineContexta)  Per-run mutable state for a single pipeline invocation.

    Created once at the start of ``run_pipeline()`` and threaded through
    the call chain via function parameters.  Each concurrent ``detect()``
    call gets its own context, eliminating the need for module-level
    mutable caches.
    )default_factoryz!dict[str, tuple[float, int, int]]analysis_cacheNz
int | Nonenon_ascii_countzdict[str, float]	mb_scoresmb_coverage)r   r   r   r   r   dictr-   r   r.   r/   r0   r   r   r    r+   r+   D   sC     9>d8SN5S"&OZ&"'"=I=$)$$?K!?r   r+   )r   
__future__r   dataclassesr   typingr   r   r   r
   ranger   r   r   	dataclassr$   _NONE_RESULTr+   r   r   r    <module>r8      s    1 "   
 #' % & %e,-
E -
  tT FE$4E FG % G
I 
 d$/
 
 0
6 tL T"@ @ #@r   