wildling
R library and CLI for pattern-based string generation. Zero third-party dependencies (base R only — hand-rolled JSON parser). Requires R 3.5+ with base packages only.
Docs: Website · Sandbox · Syntax · Source
Example
Install
From this repository:
cd r
./build.sh
./bin/wildling "Year 19##"
Git:
remotes::install_github("dotmonk/wildling", subdir = "r", ref = "v2.0.0")
root <- normalizePath("r")
source(file.path(root, "lib", "wildling", "token.R"))
source(file.path(root, "lib", "wildling", "parse_pattern.R"))
source(file.path(root, "lib", "wildling", "generator.R"))
source(file.path(root, "lib", "wildling", "wildling.R"))
w <- create_wildling(c("Year 19##"))
value <- w$`next`()
while (!isFALSE(value)) {
cat(value, "\n")
value <- w$`next`()
}
CLI
./bin/wildling "Year 19##"
./bin/wildling --dictionary planets:../dictionaries/planets.txt "%{'planets'}"
./bin/wildling --template ./config.json
Help text and --check output follow docs/cli.md / docs/help.txt.
Build
./build.sh # Docker (gcc:14-bookworm + r-base-core): copy help.txt + R parse check
Project tests live in ../tests/ and are run with ../test.sh.