Skip to main content

sample

Function sample 

Source
pub fn sample(
    grammar: &Grammar,
    config: &SampleConfig,
) -> Result<Vec<String>, EvalError>
Expand description

Generates deterministic strings from grammar.

The sampler uses SplitMix64 with the exact transition implemented in this module, never system entropy. Duplicate draws are removed while preserving first-seen order. Reachable rules that cannot emit any finite string return EvalError::NonTerminating.