Crate extract_words

Source
Expand description

§extract-words

Extracts words from text without allocation

§Examples

Iteration through words, discarding punctuation

let mut words = extract_words("¿Cómo estás?");
assert_eq!(words.next().unwrap(), "Cómo");
assert_eq!(words.next().unwrap(), "estás");
assert!(words.next().is_none());

Iteration through all entries

let mut entries = Entries::new("Bien :)");
assert_eq!(entries.next().unwrap(), Entry::Word("Bien"));
assert_eq!(entries.next().unwrap(), Entry::Other(" :)"));
assert!(entries.next().is_none());

Structs§

Entries
An iterator over text entries

Enums§

Entry
Text entry

Functions§

extract_words
Extracts words from the text discarding punctuation