diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 8890b96..2bba8f4 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest"] - python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10"] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] include: # - os: "windows-2022" # python-version: "3.10" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f85a9a1..8db574d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ with your code. Nothing is written in stone but please try to respect them. 4. Please **respect the code style**. I don't want to set specific strict rules here because I think it's possible to respect style from all the code around. For example you will not use `'` for strings when you see that the code uses `"` ... -5. Make sure you have Python 3.5+ installed. Also, **Python 2.7/3.4** and maybe older versions work but since +5. Make sure you have Python 3.6+ installed. Also, **Python 2.7/3.4** and maybe older versions work but since they reached end-of-life you could have difficulties with the transitive dependencies that dropped the support already. Then, install all the required dependencies and run the tests: diff --git a/README.md b/README.md index 87fc434..1db9d21 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ There is a [good chance](docs/index.md#Tokenizer) it is. But if not it is [not t ## Installation -Make sure you have [Python](http://www.python.org/) 3.5+ and +Make sure you have [Python](http://www.python.org/) 3.6+ and [pip](https://crate.io/packages/pip/) ([Windows](http://docs.python-guide.org/en/latest/starting/install/win/), [Linux](http://docs.python-guide.org/en/latest/starting/install/linux/)) diff --git a/setup.py b/setup.py index b896a31..49957ee 100644 --- a/setup.py +++ b/setup.py @@ -109,6 +109,7 @@ "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Programming Language :: Python :: Implementation :: CPython", ], ) diff --git a/sumy/nlp/stemmers/greek.py b/sumy/nlp/stemmers/greek.py index 16ed133..86f9d46 100644 --- a/sumy/nlp/stemmers/greek.py +++ b/sumy/nlp/stemmers/greek.py @@ -31,7 +31,7 @@ def stem_word(word): for tag in _TOTAL_TAGS: try: stemmed = gr_stemmer.stem_word(word.lower(), tag) - if stemmed[-1].upper() in _CONSONANTS: + if stemmed and stemmed[-1].upper() in _CONSONANTS: stem_candidates.add(stemmed) except (TypeError, ValueError): pass diff --git a/tests/test_stemmers.py b/tests/test_stemmers.py index 9f536f2..aae5eb5 100644 --- a/tests/test_stemmers.py +++ b/tests/test_stemmers.py @@ -44,3 +44,10 @@ def test_slovak_stemmer(): assert type(actual) is type(expected) assert expected.__dict__ == actual.__dict__ + + +def test_greek_stemmer(): + greek_stemmer = Stemmer("greek") + # The first assert covers the empty stem case. + assert "οτ" == greek_stemmer("όταν") + assert "εργαζ" == greek_stemmer("εργαζόμενος")