⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.144
Server IP:
157.245.143.252
Server:
Linux www 6.11.0-9-generic #9-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 14 13:19:59 UTC 2024 x86_64
Server Software:
nginx/1.26.0
PHP Version:
8.3.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3
/
dist-packages
/
chardet
/
__pycache__
/
View File Name :
universaldetector.cpython-312.pyc
d : d Z ddlZddlZddlZddlmZmZmZ ddlm Z ddl mZ ddlm Z mZmZ ddlmZ dd lmZ dd lmZ ddlmZ ddlmZ dd lmZ ddlmZ G d d Zy)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)ListOptionalUnion )CharSetGroupProber) CharSetProber) InputStateLanguageFilterProbingState)EscCharSetProber)Latin1Prober)MacRomanProber)MBCSGroupProber) ResultDict)SBCSGroupProber) UTF1632Proberc N e Zd ZdZdZ ej d Z ej d Z ej d Z dddd d ddd dZ ddddddddZej dfdededdfdZedefd Zedefd Zedee fd Zd!dZdeeef ddfdZdefd Zy)"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-11GB18030CP949UTF-16)asciir ztis-620r gb2312zeuc-krzutf-16leFlang_filtershould_rename_legacyreturnNc d | _ d | _ g | _ d dd d| _ d| _ d| _ t j | _ d| _ || _ t j t | _ d| _ || _ | j# y )N encoding confidencelanguageF )_esc_charset_prober_utf1632_prober_charset_probersresultdone _got_datar PURE_ASCII_input_state _last_charr logging getLogger__name__logger_has_win_bytesr reset)selfr r s ;/usr/lib/python3/dist-packages/chardet/universaldetector.py__init__zUniversalDetector.__init__d s @D 8<57# &11&''1#$8! r% c | j S N)r- r5 s r6 input_statezUniversalDetector.input_state{ s r% c | j S r9 )r3 r: s r6 has_win_byteszUniversalDetector.has_win_bytes s """r% c | j S r9 )r( r: s r6 charset_probersz!UniversalDetector.charset_probers s $$$r% c V dddd| _ d| _ d| _ d| _ t j | _ d| _ | j r| j j | j r| j j | j D ] }|j y)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% )r) r* r+ r3 r r, r- r. r&