Skip to content

IndexError in spanish stemmer #75

@komod0

Description

@komod0

When summarizing text in spanish certain words cause the summarizer to raise an Exception, ie:

from summa import summarizer
summarizer.summarize("urgue", language="spanish")

Even though the word isn't grammatically correct, raising an Exception is undesired behavior.

The problem seems to be generated in the snowballer:

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":

When the value of rv is "e" and suffix is "e".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions