!7 sS input = "the dog barked and ran away"; p { ai_alternativeSmartBot(); temp ParseEnv env = parse_start(input); // Split at and? int i = indexOfIC_fullWord(env.input, "and"); if (i >= 0) post("Suggest", "splitting at indices", struct(ll(i, i + l("and")))); // Split after noun phrase L tok = defaultTok(env.input); i = tokenIndexToCharIndex(tok, ai_endOfNounPhrase(tok)); if (i >= 0) post("Suggest", "grouping starting at index", str(i)); // Harvest L suggestions = ai_triplesWithA("Suggest"); pnl(suggestions); TripleWeb suggestion = random(suggestions); S idx = ai_text_onTriple(suggestion, "Suggest", "splitting at indices", "$X"); if (idx != null) { L indices = safeUnstructureList(idx); print("Split to: " + sfu(splitStringAtIndices(env.input, indices))); ret; } idx = ai_text_onTriple(suggestion, "Suggest", "grouping starting at index", "$X"); if (idx != null) { i = parseInt(idx); print("Grouped to: " + curlyGroupFromIndex(env.input, i)); ret; } print("Couldn't run suggestion " + suggestion); }