Skip to content

Commit a090448

Browse files
committed
check length before accessing text index
1 parent c6edbf4 commit a090448

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pythainlp/soundex/lk82.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def lk82(text):
4141
res.append(text[0].translate(_TRANS1))
4242
text = text[1:]
4343
else:
44-
res.append(text[1].translate(_TRANS1))
44+
if len(text) > 0:
45+
res.append(text[1].translate(_TRANS1))
4546
res.append(text[0].translate(_TRANS2))
4647
text = text[2:]
4748

0 commit comments

Comments
 (0)