The library provides a multilingual implementation of Rapid Automatic Keyword Extraction (RAKE) algorithm for Rust.
rake
to dependencies
of Cargo.toml
:toml
rake = "0.3"
rust
extern crate rake;
use rake::*;
Rake
struct:rust
let text = "a long text";
let sw = StopWords::from_file("path/to/stop_words_list.txt").unwrap();
let r = Rake::new(sw);
let keywords = r.run(text);
rust
keywords.iter().for_each(
|&KeywordScore {
ref keyword,
ref score,
}| println!("{}: {}", keyword, score),
);