
Construct the offline deterministic rule-based translator backend
Source:R/translator-backends.R
translator_rule.RdCreates a zero-dependency, offline, deterministic natural-language parser
that compiles English statistical and simulation study descriptions into
validated spec_ir objects, identifies underspecified parameters for
structured clarification, and documents inferred defaults.
Examples
tr <- translator_rule()
res <- nl_to_spec("2-level power simulation with 50 schools, 20 students per school, ICC 0.2", tr)
res$spec
#>
#> ── spec_ir v1.2.0 [valid] ──
#>
#> Title: 2-Level School Linear Power Simulation
#> Design: power_analysis | Estimator: lmer
#> Hierarchy: 2-level (50 schools x 20 students = 1000 total; ICC = 0.2)
#> Outcome: y (gaussian, link = identity)
#> Predictors: x1 [L1, normal, beta=0.3]
#> Simulation: 200 reps | alpha = 0.05 | seed = 2026 | grid: none