6 releases (stable)

Uses old Rust 2015

1.2.0 Nov 17, 2019
1.1.0 Jan 24, 2019
1.0.2 Dec 30, 2017
1.0.1 Aug 22, 2017
0.1.0 Feb 7, 2017

#91 in Algorithms

Download history 98232/week @ 2024-01-03 85581/week @ 2024-01-10 39411/week @ 2024-01-17 36170/week @ 2024-01-24 42010/week @ 2024-01-31 38498/week @ 2024-02-07 52476/week @ 2024-02-14 49806/week @ 2024-02-21 52597/week @ 2024-02-28 53244/week @ 2024-03-06 48524/week @ 2024-03-13 50770/week @ 2024-03-20 48601/week @ 2024-03-27 46742/week @ 2024-04-03 49447/week @ 2024-04-10 39615/week @ 2024-04-17

192,355 downloads per month
Used in 177 crates (24 directly)

MIT/BSD-3-Clause

2.5MB
19K SLoC

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
  • Danish
  • Dutch
  • English
  • French
  • German
  • Greek
  • Hungarian
  • Italian
  • Norwegian
  • Portuguese
  • Romanian
  • Russian
  • Spanish
  • Swedish
  • Tamil
  • Turkish

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.

lib.rs:

This library provides rust implementations for some stemmer algorithms written in the snowball language.

All algorithms expect the input to already be lowercased.

Usage

[dependencies]
rust-stemmers = "^1.0"
extern crate rust_stemmers;

use rust_stemmers::{Algorithm, Stemmer};

fn main() {
   let en_stemmer = Stemmer::create(Algorithm::English);
   assert_eq!(en_stemmer.stem("fruitlessly"), "fruitless");
}

Dependencies