Skip to content

Latest commit

 

History

History
61 lines (51 loc) · 1.24 KB

File metadata and controls

61 lines (51 loc) · 1.24 KB

Rust Stemmers

This crate implements some stemmer algorithms found in the snowball project which are compiled to rust using the rust-backend of the snowball compiler.

Supported Algorithms

  • Arabic
  • Armenian
  • Basque
  • Catalan
  • Czech
  • Danish
  • Dutch
  • DutchPorter (legacy Dutch algorithm)
  • English
  • Esperanto
  • Estonian
  • Finnish
  • French
  • German
  • Greek
  • Hindi
  • Hungarian
  • Indonesian
  • Irish
  • Italian
  • Lithuanian
  • Nepali
  • Norwegian
  • Persian
  • Polish
  • Porter (original English algorithm)
  • Portuguese
  • Romanian
  • Russian
  • Serbian
  • Sesotho
  • Spanish
  • Swedish
  • Tamil
  • Turkish
  • Yiddish

Usage

extern crate rust_stemmers;
use rust_stemmers::{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.
assert_eq!(en_stemmer.stem("fruitlessly"), "fruitless");

Related Projects

  • The stemmer crate provides bindings to the C Snowball implementation.