Skip to content

Reference

tilttek/generator

The generator

TypeRole
GeneratorThe library in one object: checks a catalog when built, and draws from it.
DrawA draw asked for: a count, uniqueness, a seed and the state the last draw left.
DrawResultThe results of a draw, the count asked for, whether it is short, and the state a generator with a memory is left in.
TablesThe random tables the library ships in tables/: their names, their languages, and the directory and files of each language.
LimitsThe bounds of depth, picks, time, attempts, results and cells.
Timer, SystemTimerThe monotonic clock in milliseconds of the time limit.

Definitions (Tilttek\Generator\Definition)

TypeRole
CatalogThe lists and the generators by name.
EntryListA list: its name, its entries and its Markov chain, if it has one; whether an entry carries a tag.
MarkovChainHow a list invents words: its order, its shortest and longest word, and whether entries come out.
EntryAn entry: its text, weight, fields and tags; read like an array in a template.
GeneratorDefinitionA generator: its name, body, variables, language and state.
StateValueOne value of a state: its start template and its next template.
BodyWhat a generator returns; TextBody, ObjectBody, GridBody and GraphBody.
TemplateA weighted template of a TextBody.
FieldWhat fills a field or a cell: TemplateField or GenerateField.
MapLayoutsquare or hex.

Loading (Tilttek\Generator\Loading)

TypeRole
ReaderDecoded documents into a catalog, with the place of each error; isName().
FileLoaderYAML and JSON files and directories into documents and a catalog.

Grammar (Tilttek\Generator\Grammar)

TypeRole
GrammarThe rules of a language behind the filters.
French, English, Spanish, German, Italian, PortugueseThe built-in grammars.
GrammarsThe grammars by locale or language, the built-in ones and an application's.
ArticleKinddefinite, indefinite, partitive, demonstrative.
Genderm, f, n.

Engine (Tilttek\Generator\Engine)

TypeRole
ProblemOne thing wrong with a catalog, and its template.
ProducerInternal: compiles the templates, checks them, and renders the results.
RunInternal: the randomness, picks, time and languages of one result.
MarkovModelInternal: what a Markov list learnt from its entries, and the words it writes.
SandboxPolicyInternal: what a template may use.
ReferenceCollectorInternal: the names and the sandbox features a template uses.
GeneratorExtensionInternal: the functions and filters of the templates.

Exceptions (Tilttek\Generator\Exception)

GeneratorException, InvalidDefinition, InvalidCatalog, UnknownGenerator, UnknownList, UnknownTag, ExhaustedList, LimitExceeded, GenerationFailed; see Exceptions.