snowball_stemmer
gleam add snowball_stemmer@1
import snowball_stemmer
pub fn main() {
let stemmer = snowball_stemmer.new()
assert "repeatedly" |> snowball_stemmer.stem(stemmer, _) == "repeat"
}
The Snowball Project is a
small string processing language for creating stemming algorithms for use in Information Retrieval, plus a collection of stemming algorithms implemented using it.
This package implements the English Snowball stemmer, also known as the Porter2 stemming algorithm in pure Gleam.
Further documentation can be found at https://hexdocs.pm/snowball_stemmer.
Development
gleam test # Run unit tests
gleam test -- full # Stem all ~40k test words from the Snowball project
gleam test -- bench # Benchmark snowball_stemmer against `porter_stemmer`