Function hypher::hyphenate

source ·
pub fn hyphenate(word: &str, lang: Lang) -> Syllables<'_> 
Expand description

Segment a word into syllables.

Returns an iterator over the syllables.

This uses the default bounds for the language.

§Panics

Panics if the word is more than 41 bytes long and the alloc feature is disabled.

§Example

let mut syllables = hyphenate("extensive", Lang::English);
assert_eq!(syllables.next(), Some("ex"));
assert_eq!(syllables.next(), Some("ten"));
assert_eq!(syllables.next(), Some("sive"));
assert_eq!(syllables.next(), None);