%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/chardet/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/chardet/__pycache__/codingstatemachine.cpython-312.pyc

�

�d���8�ddlZddlmZddlmZGd�d�Zy)�N�)�CodingStateMachineDict)�MachineStatec�f�eZdZdZdeddfd�Zdd�Zdedefd�Zdefd	�Z	de
fd
�Zede
fd��Z
y)
�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.
    �sm�returnNc���||_d|_d|_tj|_d|_tjt�|_
|j�y)NrT)�_model�_curr_byte_pos�_curr_char_lenr�START�_curr_state�active�logging�	getLogger�__name__�logger�reset)�selfrs  �</usr/lib/python3/dist-packages/chardet/codingstatemachine.py�__init__zCodingStateMachine.__init__9sI�����������'�-�-�������'�'��1����
�
��c�.�tj|_y�N)rrr�rs rrzCodingStateMachine.resetBs��'�-�-��r�cc�J�|jd|}|jtjk(rd|_|jd||_|j|jdz|z}|jd||_|xjdz
c_|jS)N�class_tabler�char_len_table�class_factor�state_tabler)rrrrrr
)rr�
byte_class�
curr_states    r�
next_statezCodingStateMachine.next_stateEs����[�[��/��2�
����|�1�1�1�"#�D��"&�+�+�.>�"?�
�"K�D���%�%����N�(C�C�j�P�
��;�;�}�5�j�A������q� �����rc��|jSr)r
rs r�get_current_charlenz&CodingStateMachine.get_current_charlenRs���"�"�"rc� �|jdS)N�name�rrs r�get_coding_state_machinez+CodingStateMachine.get_coding_state_machineUs���{�{�6�"�"rc� �|jdS)N�languager*rs rr-zCodingStateMachine.languageXs���{�{�:�&�&r)r	N)r�
__module__�__qualname__�__doc__rrr�intr%r'�strr+�propertyr-�rrrr"sf���,�1��d��.� �C� �C� �#�S�#�#�#�#��'�#�'��'rr)r�codingstatemachinedictr�enumsrrr4rr�<module>r7s��8�:��8'�8'r

Zerion Mini Shell 1.0