How can I generate natural language sentences given logical structures that contain the subject, verb and target? I have a group of structures in a program that are very specific on their meaning, eg. this is a piece of code

randomItem = objects.concept.random("buyable")
idea.example(objects.concept.random("family", "friend")).does({
    action: "go",
    target: object.concent.random("shop")
}).then({
    action: "buys",
    target: randomItem,
    several: true
}).then({
    question: true,
    action: "know",
    property: "amount",
    target: randomItem,
    several: true
})


I have worked with natural language parsers before.

How do I go and transform this to Natural Language (the other way around), is there any way or method; I have logical structures in which I know who is the subject, what the verb and target.

Which methods can I use to generate language from this?
It might be simpler to generate the language output yourself since you've already got a concrete concept structure in code.

Maybe you'll also want to be aware of potential future applications such as parsing your own output back to the inputs.

With that said, you could investigate Markov Chains or Google around a bit for Natural Language Processing and Natural Language Generation.

https://stackoverflow.com/questions/33068943/library-for-generating-natural-language-verbs-in-javascript