Path: blob/master/venv/Lib/site-packages/chardet/enums.py
811 views
"""1All of the Enums that are used throughout the chardet package.23:author: Dan Blanchard ([email protected])4"""567class InputState(object):8"""9This enum represents the different states a universal detector can be in.10"""11PURE_ASCII = 012ESC_ASCII = 113HIGH_BYTE = 2141516class LanguageFilter(object):17"""18This enum represents the different language filters we can apply to a19``UniversalDetector``.20"""21CHINESE_SIMPLIFIED = 0x0122CHINESE_TRADITIONAL = 0x0223JAPANESE = 0x0424KOREAN = 0x0825NON_CJK = 0x1026ALL = 0x1F27CHINESE = CHINESE_SIMPLIFIED | CHINESE_TRADITIONAL28CJK = CHINESE | JAPANESE | KOREAN293031class ProbingState(object):32"""33This enum represents the different states a prober can be in.34"""35DETECTING = 036FOUND_IT = 137NOT_ME = 2383940class MachineState(object):41"""42This enum represents the different states a state machine can be in.43"""44START = 045ERROR = 146ITS_ME = 2474849class SequenceLikelihood(object):50"""51This enum represents the likelihood of a character following the previous one.52"""53NEGATIVE = 054UNLIKELY = 155LIKELY = 256POSITIVE = 35758@classmethod59def get_num_categories(cls):60""":returns: The number of likelihood categories in the enum."""61return 4626364class CharacterCategory(object):65"""66This enum represents the different categories language models for67``SingleByteCharsetProber`` put characters into.6869Anything less than CONTROL is considered a letter.70"""71UNDEFINED = 25572LINE_BREAK = 25473SYMBOL = 25374DIGIT = 25275CONTROL = 251767778