talking to a wall, a piecemeal natural language processing library.
Determine if two words rhyme using CMUdict phonetic encoding
Determine if two words alliterate using the Double Metaphone phonetic encoding
Determine if two words alliterate using CMUdict phonetic encoding
Determine if two words alliterate using a combination of the CMUdict and the Double Metaphone phonetic encoding
Determine if two words alliterate using a combination of the CMUdict and the Double Metaphone phonetic encoding
Get the CMUdict phonetic encoding of a word
```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")); ```
```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")); ```
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()
]]))
);
```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" ); ```