Expand description
Bundled real-world data for realistic data generation.
Provides grab-and-go nodes for generating person names, country
names, US state codes, and nationalities from embedded Census and
geographic datasets. All data is compiled into the binary via
include_str! — no runtime file I/O.
Each node takes a u64 input (should be hashed for uniform distribution) and returns a String. Weighted variants select proportionally to Census frequency data.
The bundled datasets are parsed once into process-global
OnceLocks (the samplers are stateless after construction and
the data is include_str!-baked, so there’s nothing
per-instance to configure).
first_names (struct FirstNames) samples female names and
first_names_male (struct FirstNamesMale) samples male names;
both are first-class DSL nodes.
Structs§
- Country
Codes country_codes(input) -> String— country code (uniform selection over the full ISO list).- Country
Names country_names(input) -> String— country name (uniform selection over the full ISO list).- First
Names first_names(input) -> String— Census female first name, weighted by frequency.- First
Names Male first_names_male(input) -> String— Census male first name, weighted by frequency. Companion tofirst_names(female).- Full
Names full_names(input) -> String— combined first + last name.- Nationalities
nationalities(input) -> String— nationality name (uniform selection).- State
Codes state_codes(input) -> String— US state abbreviation (uniform selection).- Uniform
Name Sampler - A uniform name sampler (no weights, just mod index).
- Weighted
Name Sampler - A weighted name sampler backed by an alias table.