sclass WordIndex { S regexp = "\\w+"; MultiMap index = ciMultiMap(); void add(A a, S text) { Set words = asCISet(regexpExtractAll(regexp, text)); for (S word : words) index.add(word, a); } void L get(S word) { ret index.get(word); } }