static LinkedHashSet ai_matrix_categoriesForTopic(S topic) { //ret ai_texts(topic, "$Y", "$X"); new LinkedHashSet out; for (Pair p : ai_texts_a(topic)) { if (swic(p.a, "under ")) continue; S rel = substring(p.a, lastIndexOf(p.a, ' ')+1); if (eqicOneOf(rel, "is", "is not")) out.add(p.b); } out.addAll(ai_texts_quoted("$X", "is a matrix category for", topic)); ret out; }