[−][src]Crate rake
RAKE.rs
The library provides a multilingual implementation of Rapid Automatic Keyword Extraction (RAKE) algorithm for Rust.
How to Use
- Add
rake
to thedependencies
of your project'sCargo.toml
:
[dependencies]
rake = "0.1"
If you're using Rust 2015, then you'll also need to add it to your crate root:
extern crate rake;
Example
// Import modules use rake::*; // Create a new instance of `Rake` struct let text = "a long text"; let stop_words_list_path = "tests/SmartStoplist.txt"; let sw = StopWords::from_file(stop_words_list_path).unwrap(); let r = Rake::new(sw); let keywords = r.run(text); // Iterate over keywords keywords.iter().for_each( |&KeywordScore { ref keyword, ref score, }| println!("{}: {}", keyword, score), );
Structs
KeywordScore | Represents a keyword score |
Rake | Represents an instance of Rake type |
StopWords | Represents a set of stop words |
Traits
KeywordSort | An interface to sort a vector of keywords by score |