Open shawrkbait opened 5 years ago
This change allows recursive variable expansion.
For example: we can choose from a list of questions:
var Sentencer = require('sentencer'); var randy = require('randy'); var questions = ["what is {{ a_noun }}", "why is {{ a_noun }} so {{ adjective }}"]; Sentencer.configure({ actions: { question: function() { return randy.choice(questions); } } }); console.log( Sentencer.make("Question 1: {{ question }}");
This change allows recursive variable expansion.
For example: we can choose from a list of questions: