Phrase generation approaches In generating reports, sometimes there is a need to produce quite involved phrases in one of natural languages given numerical or boolean parameters.

To get a feel of it, it is enough to take a look at convert integers into words or time ago algorithms.

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.
I've found a survey on natural-language generation approaches by Albert Gatt, Emiel Krahmer, 2018. According to that, my question is about linguistic realization. And the paper mentions three most common ones:


human-crafted templates
human-crafted grammar-based systems
statistical approaches


If I remember correctly, there may also be rules-based NLG systems, which may be overlapping with the grammar-based in the above classification.

And I am sure there may be more approaches.