![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|
Public Member Functions | |
| None | __init__ (self, LanguageFilter lang_filter=LanguageFilter.ALL, bool should_rename_legacy=False) |
| int | input_state (self) |
| bool | has_win_bytes (self) |
| List[CharSetProber] | charset_probers (self) |
| None | reset (self) |
| None | feed (self, Union[bytes, bytearray] byte_str) |
| ResultDict | close (self) |
Public Attributes | |
| done | |
| lang_filter | |
| logger | |
| should_rename_legacy | |
| result | |
| MINIMUM_THRESHOLD | |
Static Public Attributes | |
| float | MINIMUM_THRESHOLD = 0.20 |
| HIGH_BYTE_DETECTOR = re.compile(b"[\x80-\xFF]") | |
| ESC_DETECTOR = re.compile(b"(\033|~{)") | |
| WIN_BYTE_DETECTOR = re.compile(b"[\x80-\x9F]") | |
| dict | ISO_WIN_MAP |
| dict | LEGACY_MAP |
Protected Attributes | |
| _got_data | |
| _input_state | |
| _last_char | |
| _has_win_bytes | |
| _utf1632_prober | |
| _esc_charset_prober | |
| _charset_probers | |
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 | ResultDict pip._vendor.chardet.universaldetector.UniversalDetector.close | ( | self | ) |
Stop analyzing the current document and come up with a final
prediction.
:returns: The ``result`` attribute, a ``dict`` with the keys
`encoding`, `confidence`, and `language`.
| None pip._vendor.chardet.universaldetector.UniversalDetector.feed | ( | self, | |
| Union[bytes, bytearray] | byte_str | ||
| ) |
Takes a chunk of a document and feeds it through all of the relevant charset probers. After calling ``feed``, you can check the value of the ``done`` attribute to see if you need to continue feeding the ``UniversalDetector`` more data, or if it has made a prediction (in the ``result`` attribute). .. note:: You should always call ``close`` when you're done feeding in your document if ``done`` is not already ``True``.
| None pip._vendor.chardet.universaldetector.UniversalDetector.reset | ( | self | ) |
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.
|
static |
|
static |