| Server IP : 162.144.4.212 / Your IP : 216.73.216.108 Web Server : Apache System : Linux gator2125.hostgator.com 5.14.0-162.23.1.9991722448259.nf.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 31 18:11:45 UTC 2024 x86_64 User : cozeellc ( 2980) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/libexec/oracle-cloud-agent/plugins/osms/chardet/ |
Upload File : |
a
i��f : � @ s� d Z ddlZddlZddlZddlmZmZmZ ddlm Z ddl
mZ ddlm
Z
mZmZ ddlmZ dd lmZ dd
lmZ ddlmZ ddlmZ dd
lmZ ddlmZ G dd� d�ZdS )a
Module containing the UniversalDetector detector class, which is the primary
class a user of ``chardet`` should use.
:author: Mark Pilgrim (initial port to Python)
:author: Shy Shalom (original C code)
:author: Dan Blanchard (major refactoring for 3.0)
:author: Ian Cordasco
� N)�List�Optional�Union� )�CharSetGroupProber)�
CharSetProber)�
InputState�LanguageFilter�ProbingState)�EscCharSetProber)�Latin1Prober)�MacRomanProber)�MBCSGroupProber)�
ResultDict)�SBCSGroupProber)�
UTF1632Proberc @ s� e Zd ZdZdZe�d�Ze�d�Ze�d�Z dddd d
ddd
d�Z
dddddddd�Zej
dfeedd�dd�Zeed�dd��Zeed�dd��Zeee d�dd��Zdd�d d!�Zeeef dd"�d#d$�Zed�d%d&�ZdS )'�UniversalDetectoraq
The ``UniversalDetector`` class underlies the ``chardet.detect`` function
and coordinates all of the different charset probers.
To get a ``dict`` containing an encoding and its confidence, you can simply
run:
.. code::
u = UniversalDetector()
u.feed(some_bytes)
u.close()
detected = u.result
g�������?s [�-�]s (|~{)s [�-�]zWindows-1252zWindows-1250zWindows-1251zWindows-1256zWindows-1253zWindows-1255zWindows-1254zWindows-1257)�
iso-8859-1z
iso-8859-2z
iso-8859-5z
iso-8859-6z
iso-8859-7z
iso-8859-8�
iso-8859-9ziso-8859-13zISO-8859-11�GB18030�CP949�UTF-16)�asciir ztis-620r �gb2312zeuc-krzutf-16leFN)�lang_filter�should_rename_legacy�returnc C sd d | _ d | _g | _d dd d�| _d| _d| _tj| _d| _ || _
t�t
�| _d| _|| _| �� d S )N� ��encoding�
confidence�languageF� )�_esc_charset_prober�_utf1632_prober�_charset_probers�result�done� _got_datar �
PURE_ASCII�_input_state�
_last_charr �logging� getLogger�__name__�logger�_has_win_bytesr �reset)�selfr r � r3 �}/sparta/input/_build_configuration/image_build+validate/lib/bmcenv/lib64/python3.9/site-packages/chardet/universaldetector.py�__init__d s �zUniversalDetector.__init__)r c C s | j S �N)r* �r2 r3 r3 r4 �input_state{ s zUniversalDetector.input_statec C s | j S r6 )r0 r7 r3 r3 r4 �
has_win_bytes s zUniversalDetector.has_win_bytesc C s | j S r6 )r% r7 r3 r3 r4 �charset_probers� s z!UniversalDetector.charset_probersc C sf dddd�| _ d| _d| _d| _tj| _d| _| jr>| j� � | j
rN| j
� � | jD ]}|� � qTdS )z�
Reset the UniversalDetector and all of its probers back to their
initial states. This is called by ``__init__``, so you only need to
call this directly in between analyses of different documents.
Nr r Fr"