Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Conditional text generation #46
I have a use case where I want to generate text based on incoming data. Depending on different data parameters I want to be able to select a piece of text.
E.g. there's a parameter called "rain_chance". Depending on the values you get different pieces of text:
The syntax is preliminary: we should be able to distinguish between a conditional statement and a line of text that begins with a bracket.
I don't think it has to conflict. It just has a set of options that are also conditional. This means that if there are two options that satisfy the condition (like the
The syntax, for now, has been slightly altered so that the conditions are more distinct to anything else, simplifying the process of finding them and dealing with them. Using the example from above, the current adjusted syntax would be:
The wildcard operator
The conditions are evaluated in the parsePhraseBook method and the condition variables are passed in as a