本文整理汇总了Python中charsetprober.CharSetProber.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python CharSetProber.__init__方法的具体用法?Python CharSetProber.__init__怎么用?Python CharSetProber.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类charsetprober.CharSetProber
的用法示例。
在下文中一共展示了CharSetProber.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from charsetprober import CharSetProber [as 别名]
# 或者: from charsetprober.CharSetProber import __init__ [as 别名]
def __init__(self):
CharSetProber.__init__(self)
self._mCodingSM = [ \
CodingStateMachine(HZSMModel),
CodingStateMachine(ISO2022CNSMModel),
CodingStateMachine(ISO2022JPSMModel),
CodingStateMachine(ISO2022KRSMModel)
]
self.reset()
示例2: __init__
# 需要导入模块: from charsetprober import CharSetProber [as 别名]
# 或者: from charsetprober.CharSetProber import __init__ [as 别名]
def __init__(self):
CharSetProber.__init__(self)
self._mActiveNum = 0
self._mProbers = []
self._mBestGuessProber = None
示例3: __init__
# 需要导入模块: from charsetprober import CharSetProber [as 别名]
# 或者: from charsetprober.CharSetProber import __init__ [as 别名]
def __init__(self):
CharSetProber.__init__(self)
self.reset()
示例4: SingleByteCharSetProber
# 需要导入模块: from charsetprober import CharSetProber [as 别名]
# 或者: from charsetprober.CharSetProber import __init__ [as 别名]
import constants, sys
from charsetprober import CharSetProber
SAMPLE_SIZE = 64
SB_ENOUGH_REL_THRESHOLD = 1024
POSITIVE_SHORTCUT_THRESHOLD = 0.95
NEGATIVE_SHORTCUT_THRESHOLD = 0.05
SYMBOL_CAT_ORDER = 250
NUMBER_OF_SEQ_CAT = 4
POSITIVE_CAT = NUMBER_OF_SEQ_CAT - 1
#NEGATIVE_CAT = 0
class SingleByteCharSetProber(CharSetProber):
def __init__(self, model, reversed=constants.False, nameProber=None):
CharSetProber.__init__(self)
self._mModel = model
self._mReversed = reversed # TRUE if we need to reverse every pair in the model lookup
self._mNameProber = nameProber # Optional auxiliary prober for name decision
self.reset()
def reset(self):
CharSetProber.reset(self)
self._mLastOrder = 255 # char order of last character
self._mSeqCounters = [0] * NUMBER_OF_SEQ_CAT
self._mTotalSeqs = 0
self._mTotalChar = 0
self._mFreqChar = 0 # characters that fall in our sampling range
def get_charset_name(self):
if self._mNameProber:
示例5: __init__
# 需要导入模块: from charsetprober import CharSetProber [as 别名]
# 或者: from charsetprober.CharSetProber import __init__ [as 别名]
def __init__(self):
CharSetProber.__init__(self)
self._mDistributionAnalyzer = None
self._mCodingSM = None
self._mLastChar = [_bytechar(0), _bytechar(0)]
示例6: __init__
# 需要导入模块: from charsetprober import CharSetProber [as 别名]
# 或者: from charsetprober.CharSetProber import __init__ [as 别名]
def __init__(self):
CharSetProber.__init__(self)
self._mDistributionAnalyzer = None
self._mCodingSM = None
self._mLastChar = ['\x00', '\x00']
示例7: __init__
# 需要导入模块: from charsetprober import CharSetProber [as 别名]
# 或者: from charsetprober.CharSetProber import __init__ [as 别名]
def __init__(self):
CharSetProber.__init__(self)
self._mCodingSM = CodingStateMachine(UTF8SMModel)
self.reset()
示例8: __init__
# 需要导入模块: from charsetprober import CharSetProber [as 别名]
# 或者: from charsetprober.CharSetProber import __init__ [as 别名]
def __init__(self):
CharSetProber.__init__(self)
self._mLogicalProber = None
self._mVisualProber = None
self.reset()
示例9: __init__
# 需要导入模块: from charsetprober import CharSetProber [as 别名]
# 或者: from charsetprober.CharSetProber import __init__ [as 别名]
def __init__(self, model, reversed=False, nameProber=None):
CharSetProber.__init__(self)
self._mModel = model
self._mReversed = reversed # TRUE if we need to reverse every pair in the model lookup
self._mNameProber = nameProber # Optional auxiliary prober for name decision
self.reset()