zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
U
H=®dã@s(ddlZddlmZGdd„deƒZdS)éNé)Ú MachineStatec@sDeZdZdZdd„Zdd„Zdd„Zdd    „Zd
d „Ze    d d „ƒZ
dS)ÚCodingStateMachinea–
    A state machine to verify a byte sequence for a particular encoding. For
    each byte the detector receives, it will feed that byte to every active
    state machine available, one byte at a time. The state machine changes its
    state based on its previous state and the byte it receives. There are 3
    states in a state machine that are of interest to an auto-detector:
 
    START state: This is the state to start with, or a legal byte sequence
                 (i.e. a valid code point) for character has been identified.
 
    ME state:  This indicates that the state machine identified a byte sequence
               that is specific to the charset it is designed for and that
               there is no other possible encoding which can contain this byte
               sequence. This will to lead to an immediate positive answer for
               the detector.
 
    ERROR state: This indicates the state machine identified an illegal byte
                 sequence for that encoding. This will lead to an immediate
                 negative answer for this encoding. Detector will exclude this
                 encoding from consideration from here on.
    cCs0||_d|_d|_d|_t t¡|_| ¡dS)Nr)    Ú_modelÚ_curr_byte_posÚ_curr_char_lenÚ _curr_stateÚloggingÚ    getLoggerÚ__name__ÚloggerÚreset)ÚselfÚsm©rú]D:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pip/_vendor/chardet/codingstatemachine.pyÚ__init__7s  zCodingStateMachine.__init__cCs tj|_dS©N)rÚSTARTr©rrrrr ?szCodingStateMachine.resetcCsh|jd|}|jtjkr0d|_|jd||_|j|jd|}|jd||_|jd7_|jS)NÚ class_tablerÚchar_len_tableÚ class_factorÚ state_tabler)rrrrrr)rÚcÚ
byte_classÚ
curr_staterrrÚ
next_stateBs ÿzCodingStateMachine.next_statecCs|jSr)rrrrrÚget_current_charlenPsz&CodingStateMachine.get_current_charlencCs
|jdS)NÚname©rrrrrÚget_coding_state_machineSsz+CodingStateMachine.get_coding_state_machinecCs
|jdS)NÚlanguager rrrrr"VszCodingStateMachine.languageN) r Ú
__module__Ú __qualname__Ú__doc__rr rrr!Úpropertyr"rrrrr!sr)r    ÚenumsrÚobjectrrrrrÚ<module>s