dhowe / rita

Website, documentation and examples for RiTa
https://rednoise.org/rita
71 stars 9 forks source link

RiScript modifying context array #168

Closed dhowe closed 2 years ago

dhowe commented 3 years ago
    let data = [["anarchy", "bourgeoisie", "civilization", "communism", "conservatism", "democracy", "despotism", "dictatorship", "economics", "economy", "fascism", "feudalism", "ideology", "imperialism", "individualism", "liberalism", "materialism", "militarism", "monarchy"], ["bread", "coffee", "cook", "declaimer", "diet", "dinner", "dish", "drink", "emotion", "feast", "fish", "flour"]]
    const subs = { syn0: data[0].join('|'), syn1: data[1].join('|') };
    console.log('pre',subs.syn1);
    let sent = RiTa.evaluate("It is $syn1.art(), $syn0.art() and $syn1.nr().art().", subs);
    console.log(sent, '\npost', subs.syn1);
    if (subs.syn1 === 'bread') throw Error('failed');
dhowe commented 2 years ago

expected behavior