Build Status Coverage Status Crates.io Version Crates.io LICENSE

ttaw

talking to a wall, a piecemeal natural language processing library.

A couple caveats

Functionality

Rhyme

```rust extern crate ttaw; use ttaw;

asserteq!(Ok(true), ttaw::rhyme("far", "tar")); asserteq!(Ok(false), ttaw::rhyme("shopping", "cart"));

// Deviations in cmu and metaphone asserteq!(true, ttaw::metaphone::rhyme("hear", "near")); asserteq!(Ok(false), ttaw::cmu::rhyme("hear", "near")); ```

Alliteration

```rust extern crate ttaw; use ttaw; asserteq!(Ok(true), ttaw::alliteration("bounding","bears")); asserteq!(Ok(false), ttaw::alliteration("lazy", "dog"));

asserteq!(true, ttaw::metaphone::alliteration("bounding","bears")); asserteq!(Ok(true), ttaw::cmu::alliteration("bounding","bears")); ```

CMUdict

rust extern crate ttaw; use ttaw; assert_eq!( ttaw::cmu::cmu("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; asserteq!(ttaw::metaphone::doublemetaphone("Arnow").primary, "ARN"); asserteq!(ttaw::metaphone::doublemetaphone("Arnow").secondary, "ARNF");

asserteq!( ttaw::metaphone::doublemetaphone("detestable").primary, "TTSTPL" ); asserteq!( ttaw::metaphone::doublemetaphone("detestable").secondary, "TTSTPL" ); ```