!7 sclass NounNotANoun > 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(); print("input: " + input); L words = uniquify(words(input)); form.setComponentAndRevalidateParent(makeForm(pairsToParams(map(words, func(fS word) -> Pair { ButtonGroup buttons = jradiobuttons("noun", "not a noun", "unclear"); L defs = generalDefinition_texts_withoutInvalids(word); bool a = cic(defs, "a noun"), b = cic(defs, "not a noun"); bool c = a == b; selectRadioButton(buttons, c ? 2 : b ? 1 : 0); onRadioButtonChange(buttons, voidfunc(int i) { print(word + " => " + i); infoBox(linesLL( pairB(generalDefinitions_addOrRemove(word, "a noun", i == 0)), pairB(generalDefinitions_addOrRemove(word, "not a noun", i == 1)))); }); ret (Pair) pair(setFontSize(18, jRightAlignedLabel(quote(word))), hstack(buttonsInGroup(buttons))); })))); } }