This crate implements some stemmer algorithms found in the snowball project which are compiled to rust using a rust-backend for the snowball language.
```rust extern crate nativestemmers; use nativestemmers::{Algorithm, Stemmer};
// Create a stemmer for the english language let en_stemmer = Stemmer::create(Algorithm::English);
// Stemm the word "fruitlessly" // Please be aware that all algorithms expect their input to only contain lowercase characters. asserteq!(enstemmer.stem("fruitlessly"), "fruitless"); ```
Generated code is neither beautiful nor idiomatic nor optimized and full of warnings.
There are some very low hanging fruit to fix this. Contributions to the rust backend or this crate are very welcome.
It is very simple to add a snowball-stemmer to this library:
pub mod <language>;
to src/snowball/algorithms/mod.rs
Algorithm
-enumStemmer::create
add a path for your enum-variantrecompile_and_test.sh
-script which expects a valid snowball-compiler installation in your path