| Crates.io | wordbreaker |
| lib.rs | wordbreaker |
| version | 0.3.0 |
| created_at | 2022-09-12 06:57:25.193067+00 |
| updated_at | 2022-09-19 22:25:21.029067+00 |
| description | A Unicode-aware no_std crate (requires alloc) that rapidly finds all sequences of dictionary words that concatenate to a given string. |
| homepage | https://crates.io/crates/wordbreaker |
| repository | https://github.com/ChaiTRex/wordbreaker |
| max_upload_size | |
| id | 663506 |
| size | 1,076,626 |
wordbreaker is a Unicode-aware no_std crate (requires alloc) that rapidly
finds all sequences of dictionary words that concatenate to a given string.
use wordbreaker::Dictionary;
let dictionary = Dictionary::new(&["hello", "just", "ice", "justice"]);
let mut ways_to_concatenate = dictionary
.concatenations_for("justice")
.collect::<Vec<_>>();
ways_to_concatenate.sort_unstable();
assert_eq!(ways_to_concatenate, [vec!["just", "ice"], vec!["justice"]]);