Warning: session_start(): open(/var/lib/php/sessions/sess_1ep0adtgh4ejs1qbtoiumh4pg8, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!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.setComponent(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(setFontSize(18, jRightAlignedLabel(quote(word))), hstack(buttonsInGroup(buttons)));
}))));
revalidate(getParent(form));
}
}