// e.g."if a snippet contains token X, it also contains token Y"; static NLABlock ai_pronounResolvedToNLA(S s) { s = ai_dropFillers1(s); print(s); AI_PronounResolver1 resolver = new(s); resolver.run(); print(resolver.nounPhrases); print(resolver.pronouns); // mapping: pronoun -> noun phrase for (Map mapping : resolver.allMappings()) { L pwt = replaceElementsUsingMap(resolver.pwt, mapping); pnl(pwt); CountingVarMaker varMaker = new("entity"); new LS lines; new Map entityNames; for (ParsedWithToken p : values(mapping)) { S name = varMaker!; entityNames.put(p, name); lines.add("there is " + p! + " " + name); } S prop = joinMap(pwt, p -> or(entityNames.get(p), p!)); lines.add(prop); printIndent("> ", lines(lines)); } }