-
Notifications
You must be signed in to change notification settings - Fork 256
Open
Description
Error:
File "D:\...\summa\preprocessing\snowball.py", line 3510, in stem if word[-2:] == "gu" and rv[-1] == "u": IndexError: string index out of range
The issue is in the SpanishStemmer, in this section:
# STEP 3: Residual suffix
for suffix in self.__step3_suffixes:
if rv.endswith(suffix):
if suffix in ("e", "\xE9"):
word = word[:-len(suffix)]
rv = rv[:-len(suffix)]
if word[-2:] == "gu" and rv[-1] == "u":
word = word[:-1]
else:
word = word[:-len(suffix)]
breakIf the 'rv' string has length == 1 , the line:
rv = rv[:-len(suffix)]at runtime is trying to do
rv = rv[:-1]which is a statement that gives an empty list as a result and makes this check fail:
if word[-2:] == "gu" and rv[-1] == "u":Metadata
Metadata
Assignees
Labels
No labels