!7 cmodule IWantYouToBePrelude > DynPrintLog { // the spaces sS objectiveSpace = 'objective, computerySpace = 'computery, userySpace = 'usery; transient WordTokRule rule_iWantYouToBe = wordTokReplacerRule( "I want you to be my assistant", "assistant", "I want that {you are my assistant}"); transient MultiMap rulesForSpace = litmultimap( userySpace, ll(rule_iWantYouToBe) ); Collection applyRules(L rules, S s) { ret concatListsToCISet(map(rules, rule -> rule.matches(s) ? getStringEmits(rule) : null ); } Set rewriteInSpace(S space, S input) { Set out = linkedCISet(); L rules = rulesForSpace.get(space); functionReturningList_transitiveHull_ciSet(func(S s) -> Collection { applyRules(rules, s) }, input, seen := out); ret out; } start-thread { S input = "I want you to be my mother"; Set outputs = rewriteInSpace(userySpace, input); pnl(outputs); printDone(); } }