Create a schema describing the human's name
;; zrc/example/core.edn
{ns example.core
HumanName
{:zen/tags #{zen/schema}
:type zen/map
:keys {:family {:type zen/string}
:given {:type zen/vector :every {:type zen/string}}}}
Generate data based on the above scheme
(ns example.core)
;; Initializing zen context
(def ztx (zen.core/new-context {:paths ["zrc"]}))
(zen.core/read-ns ztx 'example.core)
;; Data generation
(zengen.core/example ztx {:confirms #{example.core/HumanName})
;; =>
;; {:given ["$QGn?DBRxM_JEB2" "6pMkz"]
;; :family "sJr)y"}
Sometimes it is necessary to generate human-readable data
Let's declare the configuration with the tag zenden.core/definition
and use the prepared data set from zenden.dataset
;; zrc/example/definitions.edn
{ns example.definitions
import #{example.core
zengen.core
zengen.dataset.human.firstname
zengen.dataset.human.lastname}
GeneratorHumanName
{:zen/tags #{zengen.core/definition}
:options
{[example.core/HumanName :family] {:confirms #{zengen.dataset.human.lastname/english}}
[example.core/HumanName :given :#] {:confirms #{zengen.dataset.human.firstname/english}}}}}}}
(zengen.core/initialize ztx)
(zengen.core/example ztx {:confirms #{example.core/HumanName})
;; =>
;; {:given ["Gussie"]
;; :family "Wright"}
For an example of a zengen.dataset.human.prefix
schema:
{ns zengen.dataset.human.prefix
english
{:zen/tags #{zen/schema}
:enum [{:value "La"}
{:value "De"}]}}