!7 sclass Categories > DynModule { InputChooser inputChooser = new(this); transient SingleComponentPanel form; start { dm_useLocalMechListCopies(); } visualize { ret northAndCenter(wrap(inputChooser), jfullcenter(form = singleComponentPanel())); } void update { if (form == null || !inputChooser.update()) ret; S input = inputChooser.input(); L words = words(input); final Map> wordCategories = ciMap(); for (S cat : mL("All english word categories")) wordCategories.put(cat, combinedMechSetsCI(ai_mechListNamesForAngleBracketCategory(cat))); for (S cat : keys(wordCategories)) print(cat + ": " + l(wordCategories.get(cat))); form.setComponentAndRevalidateParent(makeForm(pairsToParams(map(words, func(fS word) -> Pair { new L cats; for (S cat : keys(wordCategories)) if (contains(wordCategories.get(cat), word)) cats.add(cat); ret pair(setFontSize(18, jRightAlignedLabel(quote(word))), jlabel(or2(joinWithComma(cat), "-"))); })))); } }