commit | 3c2c110ff94248b105a241a651d084ba00100c03 | [log] [tgz] |
---|---|---|
author | Grace Zhao <[email protected]> | Tue May 07 07:31:43 2024 +0000 |
committer | Grace Zhao <[email protected]> | Tue May 14 10:06:51 2024 -0700 |
tree | a669be166028e797fb4e6df59b90dbea419aec99 | |
parent | 3028480fe920c237189885e35fed49e24a7e8091 [diff] |
Import 'rust-stemmers' crate Request Document: go/android-rust-importing-crates For CL Reviewers: go/android3p#cl-review For Build Team: go/ab-third-party-imports Bug: http://b/330901042 Test: m librust_stemmers Change-Id: I31656f2c8df008432f6c9928a25ecaf0e50d835a
This crate implements some stemmer algorithms found in the snowball project which are compiled to rust using the rust-backend of the snowball compiler.
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");