Crate rake [−] [src]
RAKE.rs
The library provides a multilingual implementation of Rapid Automatic Keyword Extraction (RAKE) algorithm for Rust.
How to Use
- Append
rake
todependencies
ofCargo.toml
:
ⓘThis example is not tested
rake = "0.1"
- Import modules:
ⓘThis example is not tested
extern crate rake; use rake::*;
- Create a new instance of
Rake
struct:
ⓘThis example is not tested
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);
- Iterate over keywords:
ⓘThis example is not tested
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 |