In generating reports, sometimes there is a need to produce quite involved phrases in one of natural languages given numerical or boolean parameters.
These solutions use (procedural/OO/functional) programming and Turing-complete computations, but the question is, whether there is some declarative approach, or hybrid approach, which can be more generic for this class of algorithms? By hybrid I understand decomposed into preparation phase (calculating or defining all necessary units, tuples and conditions), and phrase generation phase, which works with declarative definitions (some kind of domain-specific language)?
The current approach I see in Open Source projects is like the above-mentioned questions: conditional statements interspersed with string interpolations or concatenations. I guess, there are more optimal ones.
What I am searching for is some right term for the problem. I am sure there is a lot of research on the topic, but I have so far failed to come with good keywords to find suitable theory. This is something in between of constant phrases and arbitrary text generation. Ideally, the declarative part should be something easy for domain experts, like a grammar.
In practice, there is also table-driven approach, but what about theories?
Also found this oldish work A flexible shallow approach to text generation by S. Busemann and H.Horacek, but it goes too fast into too specific cases.