minor refactoring

This commit is contained in:
Miroslav Stampar 2011-12-21 14:25:39 +00:00
parent 81bd9a201b
commit 41b60b26fc
15 changed files with 39 additions and 39 deletions

View file

@ -50,7 +50,7 @@ class EUCJPProber(MultiByteCharSetProber):
def feed(self, aBuf):
aLen = len(aBuf)
for i in range(0, aLen):
for i in xrange(0, aLen):
codingState = self._mCodingSM.next_state(aBuf[i])
if codingState == eError:
if constants._debug:

View file

@ -51,7 +51,7 @@ class MultiByteCharSetProber(CharSetProber):
def feed(self, aBuf):
aLen = len(aBuf)
for i in range(0, aLen):
for i in xrange(0, aLen):
codingState = self._mCodingSM.next_state(aBuf[i])
if codingState == eError:
if constants._debug:

View file

@ -50,7 +50,7 @@ class SJISProber(MultiByteCharSetProber):
def feed(self, aBuf):
aLen = len(aBuf)
for i in range(0, aLen):
for i in xrange(0, aLen):
codingState = self._mCodingSM.next_state(aBuf[i])
if codingState == eError:
if constants._debug:

View file

@ -69,7 +69,7 @@ class UTF8Prober(CharSetProber):
def get_confidence(self):
unlike = 0.99
if self._mNumOfMBChar < 6:
for i in range(0, self._mNumOfMBChar):
for i in xrange(0, self._mNumOfMBChar):
unlike = unlike * ONE_CHAR_PROB
return 1.0 - unlike
else: