!7 sclass WordType extends DynModule { S word; L wordTypes; /*void start { updateMechLists("Singular => Plural"); }*/ JComponent visualize() { ret jSection("WORD TYPE", jCenteredMultiLineLiveValueLabel( dm_calculatedLiveValue(this, S, func -> S { word + " -> " + or2(joinWithComma(wordTypes), "?") }))); } void update { S s = trim(dm_getInterestingString()); if (nempty(s) && setField(word := s)) { Set types = treeSet(); SS map = mechMapCI("Singular => Plural"); if (nempty(map.get(word))) types.add("noun (singular)"); if (nempty(reverseLookupCI(map, word))) types.add("noun (plural)"); setField(wordTypes := asList(types)); } } }