2015-04-28 17:17:12 +00:00
|
|
|
"""
|
|
|
|
All of the Enums that are used throughout the chardet package.
|
|
|
|
|
2015-08-21 16:34:25 +00:00
|
|
|
:author: Dan Blanchard (dan.blanchard@gmail.com)
|
2015-04-28 17:17:12 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
2015-08-21 16:34:25 +00:00
|
|
|
class InputState(object):
|
2015-04-28 17:17:12 +00:00
|
|
|
"""
|
|
|
|
This enum represents the different states a universal detector can be in.
|
|
|
|
"""
|
|
|
|
pure_ascii = 0
|
|
|
|
esc_ascii = 1
|
|
|
|
high_byte = 2
|
|
|
|
|
|
|
|
|
2015-08-21 16:34:25 +00:00
|
|
|
class LanguageFilter(object):
|
2015-04-28 17:17:12 +00:00
|
|
|
"""
|
|
|
|
This enum represents the different language filters we can apply to a
|
|
|
|
``UniversalDetector``.
|
|
|
|
"""
|
|
|
|
chinese_simplified = 0x01
|
|
|
|
chinese_traditional = 0x02
|
|
|
|
japanese = 0x04
|
|
|
|
korean = 0x08
|
|
|
|
non_cjk = 0x10
|
|
|
|
all = 0x1F
|
|
|
|
chinese = chinese_simplified | chinese_traditional
|
|
|
|
cjk = chinese | japanese | korean
|
|
|
|
|
|
|
|
|
2015-08-21 16:34:25 +00:00
|
|
|
class ProbingState(object):
|
2015-04-28 17:17:12 +00:00
|
|
|
"""
|
|
|
|
This enum represents the different states a prober can be in.
|
|
|
|
"""
|
|
|
|
detecting = 0
|
|
|
|
found_it = 1
|
|
|
|
not_me = 2
|
|
|
|
|
|
|
|
|
2015-08-21 16:34:25 +00:00
|
|
|
class MachineState(object):
|
2015-04-28 17:17:12 +00:00
|
|
|
"""
|
|
|
|
This enum represents the different states a state machine can be in.
|
|
|
|
"""
|
|
|
|
start = 0
|
|
|
|
error = 1
|
|
|
|
its_me = 2
|