sclass AI_PronounResolver1 { S input; Pair pNouns; LS tok; L pwt; new L>> pronouns; new L>> nounPhrases; *() {} *(S *input) {} swappable bool isPronoun(S s) { ret ai_isPronoun(s); } swappable bool isNoun(S s) { ret isPrefixPlusNumberIC(s, "entity") || pNouns.b.contains(s); } run { pNouns = ai_groupAndReturnSimplestNounPhrases(input); tok = javaTokWithBrackets(pNouns.a); //print(tok); pwt = (L) pwt_fromTokenization(tok); for (ParsedWithTokens p : pwt) { S t = uncurly(optString(p!)); if (isPronoun(t)) { p.set(Pronoun(t)); pronouns.add(p); } else if (isNoun(t)) { p.set(NounPhrase(t)); nounPhrases.add(p); } } //pnl(pwt); } // what a type! ItIt>, ParsedWithTokens>>> allMappings() { ret allPartialMappings(pronouns, nounPhrases); } }