Skip to content

Commit 2592c91

Browse files
committed
A bug that will produce exception of 'tuple index out of range' when processing long passage fixed.
1 parent a0cb6fe commit 2592c91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

thulac/base/Dat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def match(self, word):
6161
base = 0
6262
for i in range(len(word)):
6363
ind = self.dat[2 * ind] + ord(word[i])
64-
if((ind > self.datSize) or (self.dat[2 * ind + 1] != base)):
64+
if((ind >= self.datSize) or (self.dat[2 * ind + 1] != base)):
6565
return -1
6666
base = ind
6767
ind = self.dat[2 * base]

0 commit comments

Comments
 (0)