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

28
LINES

< > BotCompany Repo | #1021969 // dm_gazelle_statementsFromAppliedRules_multiSet

JavaX fragment (include)

1  
scope dm_gazelle_statementsFromAppliedRules.
2  
3  
sclass #ByRule {
4  
  S ruleID;
5  
  new MultiSet<S> statements;
6  
}
7  
8  
static MultiSet<S> dm_gazelle_statementsFromAppliedRules_multiSet() {
9  
  L concepts = cloneList((L) dm_requireAndCall("#1021413/AppliedRules", 'concepts));
10  
  new Map<S, ByRule> ruleMap;
11  
  for (O c : concepts) pcall {
12  
    S judgement = getString judgement(c);
13  
    S struct = getString matchedRuleStruct(c);
14  
    RuleEngine2_MatchedRule mr = cast unstructureUnlessContainsAnonymousClasses(struct);
15  
    if (mr == null) continue;
16  
    S ruleID = mr.rule.globalID;
17  
    ByRule r = getOrCreate_f1(ruleMap, ruleID, func(S ruleID) -> ByRule { nu(ByRule, +ruleID) });
18  
    r.statements.addAll(ai_gazelle_statementsFromAppliedRule(mr, judgement));
19  
  }
20  
  //pnlStruct(values(ruleMap));
21  
  new MultiSet<S> out;
22  
  for (ByRule r : values(ruleMap))
23  
    for (S s : keys(r.statements))
24  
      out.add("Rule " + r.ruleID + ": " + s, r.statements.get(s));
25  
  ret out;
26  
}
27  
28  
end scope

Author comment

Began life as a copy of #1021432

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1021969
Snippet name: dm_gazelle_statementsFromAppliedRules_multiSet
Eternal ID of this version: #1021969/2
Text MD5: d391d31d723f24641c2efda498136365
Author: stefan
Category: javax / stefan's os / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-04 14:04:20
Source code size: 987 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 260 / 304
Version history: 1 change(s)
Referenced in: [show references]