Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1020576 // ai_verbalizeAnalysisMultiMap (dev.)

JavaX fragment (include)

sS ai_verbalizeAnalysisMultiMap(Map<O, MultiSet<S>> map) {
  if (map == null) null;
  if (empty(map)) ret "Map empty";
  if (l(map) == 1) ret "Only a single feature value (" + firstKey(map) + ")";
  bool disjoint = allMultiSetsDisjoint(values(map));
  if (allMultiSetsAreSingleKey(values(map)))
    ret "Feature success! " + sfu(mapValues(f first, map));
  new Map<O, S> singletons;
  for (O key, MultiSet<S> value : map) { if (value.uniqueSize() == 1) singletons.put(key, first(keys(value))); }
  if (nempty(singletons)) ret "Clear feature values: " + sfu(singletons);
  if (disjoint) ret "No feature overlap";
  ret "Feature results inconclusive";
}

Author comment

Began life as a copy of #1020570

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020576
Snippet name: ai_verbalizeAnalysisMultiMap (dev.)
Eternal ID of this version: #1020576/5
Text MD5: 66af62c6f91e67964ee447f4f288bdf4
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-27 02:25:27
Source code size: 663 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 190 / 236
Version history: 4 change(s)
Referenced in: [show references]