Crates.io | random_word |
lib.rs | random_word |
version | 0.4.3 |
source | src |
created_at | 2022-10-22 05:47:07.342456 |
updated_at | 2024-02-02 03:26:54.481684 |
description | Efficient functions for generating random words in many languages. |
homepage | |
repository | https://github.com/MitchellRhysHall/random_word |
max_upload_size | |
id | 694142 |
size | 8,372,759 |
The random_word
crate provides an efficient way to generate
random words. Included words can be filtered by length or
first character.
You MUST enable a crate language feature. Crate language features are mandatory to reduce binary size. Example for English in Cargo.toml:
[dependencies]
random_word = { version = "0.4.3", features = ["en"] }
Supported Languages:
De
- German. Requires enabling "de" feature.En
- English. Requires enabling "en" feature.Es
- Spanish. Requires enabling "es" feature.Fr
- French. Requires enabling "fr" feature.Ja
- Japanese. Requires enabling "ja" feature.Zh
- Chinese. Requires enabling "zh" feature.use random_word::Lang;
let word = random_word::gen(Lang::En);
use random_word::Lang;
let word = random_word::gen_starts_with('c', Lang::En);
assert!(word.is_some());
use random_word::Lang;
let word_list = random_word::all_len(4, Lang::Fr);