// for ai_language() // Uses mech list "All $language word categories" and sublists scope ai_wordToCategories. static TimedCache>>> #cache = new TimedCache(f ciMap, 10.0); // language -> word -> categories static Map> ai_wordToCategories() { Map>> languages = cache!; Map> map = languages.get(ai_language()); if (map == null) languages.put(ai_language(), map = make()); ret map; } static Map> #make() { Map> catMap = ai_wordCategoriesWithElements(); final Map> map = ciMap(); for (S cat : keys(catMap)) for (S word : catMap.get(cat)) { Set set = map.get(word); if (set == null) map.put(word, set = new LinkedHashSet); set.add(cat); } ret map; } static Set ai_wordToCategories(S word) { ret ai_wordToCategories().get(word); } end scope