
    il                       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<    G d de      Z ej                  dd       G 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_BYTESc                  0    e Zd ZU dZ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languageN)__name__
__module____qualname____doc____annotations__     i/Users/bowang/.openclaw/workspace/ChatDev/.venv/lib/python3.12/site-packages/chardet/pipeline/__init__.pyr   r      s     r   r   T)frozenslotsc                  8    e Zd ZU dZded<   ded<   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   c                J    | j                   | j                  | j                  dS )zConvert this result to a plain dict.

        :returns: A dict with ``'encoding'``, ``'confidence'``, and ``'language'`` keys.
        r   r   r   r   )selfs    r   to_dictzDetectionResult.to_dict+   s#     //
 	
r   N)returnr   )r   r   r   r   r   r!   r   r   r   r   r      s      	
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(   r)   r   r   r   r$   r$   7   sC     9>d8SN5S"&OZ&"'"=I=$)$$?K!?r   r$   )r   
__future__r   dataclassesr   typingr   r   r   r
   ranger   r   	dataclassr   r$   r   r   r   <module>r0      s    1 "   
 #' % & %e,-
E -	I 	 d$/
 
 0
. T"@ @ #@r   