Skip to content

KeyError: "Stemming algorithm 'porter' not found" on version 3.0.0 of the Python snowballstemmer package #229

@laymonage

Description

@laymonage

The following code doesn't work after upgrading to 3.0.0:

import snowballstemmer
snowballstemmer.stemmer('porter')

with the following error:

  File "/path/to/venv/lib/python3.13/site-packages/snowballstemmer/__init__.py", line 27, in stemmer
    raise KeyError("Stemming algorithm '%s' not found" % lang)
KeyError: "Stemming algorithm 'porter' not found"

It worked fine with v2.2.0. Tested on Python 3.13 and Python 3.11.

I don't use snowballstemmer directly, but it's used by Sphinx's search functionality: https://github.com/sphinx-doc/sphinx/blob/c4929d026c8d22ba229b39cfc2250a9eb1476282/sphinx/search/en.py#L215

Not sure if this is a compatibility issue between Sphinx's usage of the library or a genuine bug in the v3.0.0 release.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions