py-rust-stemmers (version 0.1.5) is a high-performance Python wrapper around the Rust `rust-stemmers` library. It implements the Snowball stemming algorithm, offering efficient word stemming for multiple languages with support for parallel processing, making it a powerful tool for text processing tasks. The library is actively maintained, with its latest version uploaded to PyPI in February 2025 and continued development activity on GitHub through late 2025.
pip install py-rust-stemmersVerified import paths — ran on the pinned version, not inferred.
Initialize a `SnowballStemmer` for a specific language and then use `stem_word`, `stem_words`, or `stem_words_parallel` for single word, batch, or parallel stemming, respectively.
Ensure Rust and `maturin` are installed in your build environment, or rely on pre-built wheels where available. For example: `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` followed by `pip install maturin`.
Understand the distinction between stemming and lemmatization. If full lemmatization is needed, consider libraries like spaCy or NLTK's WordNetLemmatizer, which use linguistic knowledge bases.
Implement robust error handling in Rust (using `Result` types and mapping to specific `PyErr` types like `PyValueError`) if more precise Python exceptions are required. Handle `PanicException` as a general fallback for unrecoverable Rust errors.
Install the Rust toolchain by following the instructions at https://rustup.rs/, then retry `pip install py-rust-stemmers`.
Ensure the library is installed with `pip install py-rust-stemmers`. If it is installed, use the correct import statement: `from py_rust_stemmers import SnowballStemmer`.
Initialize the `SnowballStemmer` with a valid, supported language string (e.g., 'english', 'french', 'spanish').
Refer to the library's documentation or source for the correct method names. For single word stemming, use `stem_word()`, and for lists of words, use `stem_words()` or `stem_words_parallel()`.
No dependency data recorded yet.