I’m looking for a tool that can generate text (natural language) according to a list of words and their syntactic/morphological rules, both which I specify.
So for example, I might add the word "table", put it in the category "noun", and select the plural construction rule "append -s".
The tool should offer a way to generate a list of possible sentences, using my vocabulary and the rules I created. It should also be possible to input a sentence which the tool should check for correctness (according to the vocabulary/rules it knows).
The tool must be gratis (and ideally FLOSS). OS doesn’t matter (but native GNU/Linux support is preferred). No hosted solutions (self-hosted is okay).
(I used such a tool with a text-based user interface some years ago, but can’t remember its name.)