1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! # RAKE.rs
//!
//! The library provides a multilingual implementation of [Rapid Automatic Keyword Extraction (RAKE)][1] algorithm for Rust.
//!
//! [1]: http://onlinelibrary.wiley.com/doi/10.1002/9780470689646.ch1/summary
//!
//! ## How to Use
//! - Append `rake` to `dependencies` of `Cargo.toml`:
//!
//! ```ignore
//! rake = "0.1"
//! ```
//!
//! - Import modules:
//!
//! ```ignore
//! extern crate rake;
//! use rake::*;
//! ```
//!
//! - Create a new instance of `Rake` struct:
//!
//! ```ignore
//! 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:
//!
//! ```ignore
//! keywords.iter().for_each(
//!     |&KeywordScore {
//!         ref keyword,
//!         ref score,
//!     }| println!("{}: {}", keyword, score),
//! );
//! ```
//!

#![doc(html_root_url = "https://docs.rs/rake/0.1")]
#![deny(missing_docs)]

extern crate regex;
#[macro_use]
extern crate lazy_static;

mod inner;
mod keyword;
mod rake;
mod stopwords;

pub use keyword::{KeywordScore, KeywordSort};
pub use rake::Rake;
pub use stopwords::StopWords;