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§
- An iterator over text entries
Enums§
- Text entry
Functions§
- Extracts words from the text discarding punctuation