miso-belica / sumy

Module for automatic summarization of text documents and HTML pages.
https://miso-belica.github.io/sumy/
Apache License 2.0
3.46k stars 525 forks source link

Empty stem on stemmers/greek.py #173

Closed NC0DER closed 2 years ago

NC0DER commented 2 years ago

Greetings,

I found a bug regarding the greek stemmer package, while using sumy on greek texts. For certain words that are not found in its dictionary, it returns an empty stem, which makes the statement in line 33 to yield a string index out of range exception. Therefore, line 33 in stemmers/greek.py should have an extra check for the empty string case thus becoming:

if stemmed and stemmed[-1].upper() in _CONSONANTS:

Should I open a pull request for this issue or would you like to integrate it?

Thank you for your time.

miso-belica commented 2 years ago

Thank you for the report again. If u have time and mood please open a PR. But please write the test first to reproduce the bug 🙂