Skip to content

Conditional text generation #46

@fdb

Description

@fdb

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:

weather_report(rain_chance):
-(rain_chance < 0.1) No rain expected today.
-(rain_chance < 0.1) It won't rain today.
-(rain_chance < 0.5) It probably won't rain today.
-(rain_chance < 0.8) We're pretty sure it will rain.
-(rain_chance > 0.8) Bring an umbrella!
-(_) No idea what the weather is going to be.

The syntax is preliminary: we should be able to distinguish between a conditional statement and a line of text that begins with a bracket.

  • There are two options for the first case, and Seed should select between them.
  • Note that there should also be a special operator for the "other" case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions