amytron4000/README.md

22 lines
1.3 KiB
Markdown

# AmyTron4000
A text generator based on rules.
# Rules
The rules are written in the files of the models directory. Each file correspond to a different generator, and the model is described here (format is json).
Each generator is described by an object containing the fields:
- `id`: the internal identifier of the generator.
- `name`: the name of the generator as displayed in the combobox listing the different generators.
- `description`: the description of the generator.
- `moredescription`: additionnal details on the generator.
- `issentence`: indicate if the generator outputs sentences or words.
- `rules`: a list of rules. One rule must have the id `"@output@"` to indicate the entry-point of the generator.
Each rule is described by an object containing the fields:
- `id`: an identifier for the rule
- `distribution`: a distribution of list of strings. The distribution associate the lists of strings with weights used in generation. If the list of strings contain a string whose value is the id of a rule, that string is replaced by a list generated from the indicated rule (recursively).
A distribution is a list containing objects with the following fields:
- `pattern`: a rule pattern, as a list of strings
- `occurences`: the weight associated to the pattern.