!7 static SS map = unstructMap([[lhm{null="assumed", "what is a bear?"="rejected", "a bear is an animal"="assumed", "a bear is dangerous"="assumed", "\"dude\" is a word for someone"="assumed", "Pouet is a website"="assumed", "an integer is a whole number"="assumed", "what is a small bird"="rejected", "what is a good joke"="assumed", "peter is a fun guy"="confirmed", "john is a person"="confirmed"}]]); static L tests = ll("what is a bunny", "klaus is a fool", "john is a joker"); p { dropValuesFromMapOtherThan(map, 'confirmed, 'rejected); final int wordIndex = 0; L input = map(func(S s) { getWord(s, wordIndex) }, keys(map)); L output = valuesList(map); Map map = mapValuesToBool(twoListsToHashMap(input, output), 'confirmed); int diff = countValues(map, true)-countValues(map, false); print("diff=" + diff); final bool defaultValue = diff > 0; final Set exceptions = new TreeSet(keysWithValue(map, !defaultValue)); O decider = func(S s) { contains(exceptions, getWord(s, wordIndex)) ? !defaultValue : defaultValue }; for (S test : tests) print(" " + test + " => " + callF(decider, test)); }