extract-words

Crates.ioextract-words
lib.rsextract-words
version0.2.0
sourcesrc
created_at2024-02-15 06:30:30.586429
updated_at2024-02-16 04:18:01.669695
descriptionExtracts words from text without allocation
homepage
repositoryhttps://github.com/imbolc/extract-words
max_upload_size
id1140732
size10,468
Imbolc (imbolc)

documentation

README

License Crates.io Docs.rs

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());

Contributing

We appreciate all kinds of contributions, thank you!

Note on README

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.

License

This project is licensed under the MIT license.

Commit count: 0

cargo fmt