Crates.io | extract-words |
lib.rs | extract-words |
version | 0.2.0 |
source | src |
created_at | 2024-02-15 06:30:30.586429 |
updated_at | 2024-02-16 04:18:01.669695 |
description | Extracts words from text without allocation |
homepage | |
repository | https://github.com/imbolc/extract-words |
max_upload_size | |
id | 1140732 |
size | 10,468 |
Extracts words from text without allocation
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());
We appreciate all kinds of contributions, thank you!
Most of the readme is automatically copied from the crate documentation by cargo-sync-readme. This way the readme is always in sync with the docs and examples are tested.
So if you find a part of the readme you'd like to change between <!-- cargo-sync-readme start -->
and <!-- cargo-sync-readme end -->
markers, don't edit README.md
directly, but rather change
the documentation on top of src/lib.rs
and then synchronize the readme with:
cargo sync-readme
(make sure the cargo command is installed):
cargo install cargo-sync-readme
If you have rusty-hook installed the changes will apply automatically on commit.
This project is licensed under the MIT license.