Skip to main content

Module realer

Module realer 

Source
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§

CountryCodes
country_codes(input) -> String — country code (uniform selection over the full ISO list).
CountryNames
country_names(input) -> String — country name (uniform selection over the full ISO list).
FirstNames
first_names(input) -> String — Census female first name, weighted by frequency.
FirstNamesMale
first_names_male(input) -> String — Census male first name, weighted by frequency. Companion to first_names (female).
FullNames
full_names(input) -> String — combined first + last name.
Nationalities
nationalities(input) -> String — nationality name (uniform selection).
StateCodes
state_codes(input) -> String — US state abbreviation (uniform selection).
UniformNameSampler
A uniform name sampler (no weights, just mod index).
WeightedNameSampler
A weighted name sampler backed by an alias table.