当前位置: 首页>>代码示例>>Python>>正文


Python charsetprober.CharSetProber类代码示例

本文整理汇总了Python中charsetprober.CharSetProber的典型用法代码示例。如果您正苦于以下问题:Python CharSetProber类的具体用法?Python CharSetProber怎么用?Python CharSetProber使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CharSetProber类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: 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
开发者ID:00zl00,项目名称:AlfredWorkflow.com,代码行数:7,代码来源:sbcharsetprober.py

示例2: reset

	def reset(self):
		CharSetProber.reset(self)
		if self._mCodingSM:
			self._mCodingSM.reset()
		if self._mDistributionAnalyzer:
			self._mDistributionAnalyzer.reset()
		self._mLastChar = ['\x00', '\x00']
开发者ID:3cky,项目名称:3,代码行数:7,代码来源:mbcharsetprober.py

示例3: reset

 def reset(self):
     CharSetProber.reset(self)
     if self._mCodingSM:
         self._mCodingSM.reset()
     if self._mDistributionAnalyzer:
         self._mDistributionAnalyzer.reset()
     self._mLastChar = [_bytechar(0), _bytechar(0)]
开发者ID:barak066,项目名称:python-chardet,代码行数:7,代码来源:mbcharsetprober.py

示例4: reset

 def reset(self):
     CharSetProber.reset(self)
     for codingSM in self._mCodingSM:
         if not codingSM: continue
         codingSM.active = constants.True
         codingSM.reset()
     self._mActiveSM = len(self._mCodingSM)
     self._mDetectedCharset = None
开发者ID:Ettack,项目名称:csqlmap,代码行数:8,代码来源:escprober.py

示例5: reset

 def reset(self):
     CharSetProber.reset(self)
     self._mActiveNum = 0
     for prober in self._mProbers:
         if prober:
             prober.reset()
             prober.active = constants.True
             self._mActiveNum += 1
     self._mBestGuessProber = None
开发者ID:00zl00,项目名称:AlfredWorkflow.com,代码行数:9,代码来源:charsetgroupprober.py

示例6: __init__

 def __init__(self):
     CharSetProber.__init__(self)
     self._mCodingSM = [ \
         CodingStateMachine(HZSMModel),
         CodingStateMachine(ISO2022CNSMModel),
         CodingStateMachine(ISO2022JPSMModel),
         CodingStateMachine(ISO2022KRSMModel)
         ]
     self.reset()
开发者ID:Ettack,项目名称:csqlmap,代码行数:9,代码来源:escprober.py

示例7: reset

    def reset(self):
        self._mLastCharClass = OTH
        self._mFreqCounter = [0] * FREQ_CAT_NUM

        # express the prior that MacRoman is a somewhat rare encoding;
        # this can be done by starting out in a slightly improbable state
        # that must be overcome
        self._mFreqCounter[2] = 10

        CharSetProber.reset(self)
开发者ID:LuminosoInsight,项目名称:chardet,代码行数:10,代码来源:macromanprober.py

示例8: __init__

 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()
开发者ID:barak066,项目名称:python-chardet,代码行数:6,代码来源:sbcharsetprober.py

示例9: __init__

 def __init__(self):
     CharSetProber.__init__(self)
     self._mActiveNum = 0
     self._mProbers = []
     self._mBestGuessProber = None
开发者ID:00zl00,项目名称:AlfredWorkflow.com,代码行数:5,代码来源:charsetgroupprober.py

示例10: __init__

	def __init__(self):
		CharSetProber.__init__(self)
		self._mLogicalProber = None
		self._mVisualProber = None
		self.reset()
开发者ID:3cky,项目名称:3,代码行数:5,代码来源:hebrewprober.py

示例11: __init__

 def __init__(self):
     CharSetProber.__init__(self)
     self._mCodingSM = CodingStateMachine(UTF8SMModel)
     self.reset()
开发者ID:christofoo,项目名称:hard-way,代码行数:4,代码来源:ex41.py

示例12: SingleByteCharSetProber

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:
开发者ID:00zl00,项目名称:AlfredWorkflow.com,代码行数:30,代码来源:sbcharsetprober.py

示例13: reset

 def reset(self):
     self._mLastCharClass = OTH
     self._mFreqCounter = [0] * FREQ_CAT_NUM
     CharSetProber.reset(self)
开发者ID:toddlerya,项目名称:PyWebGet,代码行数:4,代码来源:latin1prober.py

示例14: __init__

 def __init__(self):
     CharSetProber.__init__(self)
     self.reset()
开发者ID:toddlerya,项目名称:PyWebGet,代码行数:3,代码来源:latin1prober.py

示例15: __init__

 def __init__(self):
     CharSetProber.__init__(self)
     self._mDistributionAnalyzer = None
     self._mCodingSM = None
     self._mLastChar = [_bytechar(0), _bytechar(0)]
开发者ID:barak066,项目名称:python-chardet,代码行数:5,代码来源:mbcharsetprober.py


注:本文中的charsetprober.CharSetProber类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。