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
extern crate pest;
///
/// ## CMU
/// ```rust
/// extern crate ttaw;
/// use ttaw;
/// let cmudict = ttaw::cmu::CmuDict::new("cmudict.json").unwrap();
/// assert_eq!(
///     cmudict.encoding("permeability"),
///     Ok(Some(vec![vec![
///         "P".to_string(),
///         "ER0".to_string(),
///         "M".to_string(),
///         "IY2".to_string(),
///         "AH0".to_string(),
///         "B".to_string(),
///         "IH1".to_string(),
///         "L".to_string(),
///         "IH0".to_string(),
///         "T".to_string(),
///         "IY0".to_string()
///     ]]))
/// );
/// assert_eq!(
///     cmudict.encoding("unearthed"),
///     Ok(Some(vec![vec![
///         "AH0".to_string(),
///         "N".to_string(),
///         "ER1".to_string(),
///         "TH".to_string(),
///         "T".to_string()
///     ]]))
/// );
///
/// ```
///
/// ## Double Metaphone
/// ```rust
/// extern crate ttaw;
/// use ttaw;
///     assert_eq!(ttaw::metaphone::encoding("Arnow").primary, "ARN");
///     assert_eq!(ttaw::metaphone::encoding("Arnow").secondary, "ARNF");
///
///     assert_eq!(ttaw::metaphone::encoding("detestable").primary, "TTSTPL");
///     assert_eq!(ttaw::metaphone::encoding("detestable").secondary, "TTSTPL");
/// ```
#[macro_use]
extern crate pest_derive;
extern crate reqwest;
extern crate serde_json;
mod error;
pub use error::Error;
pub mod cmu;
pub mod metaphone;