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

20
LINES

< > BotCompany Repo | #1021973 // gazelle_stdEvalContext_v2 - use statement multisets [LIVE]

JavaX fragment (include)

1  
// rules are t3(text, comment, ruleID)
2  
static GazelleEvalContext gazelle_stdEvalContext_v2(L<T3<S>> rules, O... _) {
3  
  long startTime = sysNow();
4  
  new GazelleEvalContext ctx;
5  
  ctx.engine = new RuleEngine2;
6  
  ctx.engine.addRules2(rules);
7  
  gazelle_changeInTypesForRulesWithMultipleInputs(ctx.engine);
8  
9  
  // gather data for predictor
10  
  MultiSet<S> statements = dm_gazelle_statementsFromAppliedRules_multiSet();
11  
  ctx.dataByRule = new Map;
12  
  Map<S, MultiSet<S>> statementsByRule = ai_gazelle_indexStatementsByRule_multiSet(statements);
13  
  for (S ruleID, MultiSet<S> statements2 : statementsByRule) {
14  
    ctx.dataByRule.put(ruleID, ai_gazelle_analyzeStatementsForRule_multiSet(statements2));
15  
  }
16  
  
17  
  ctx.predictor = dm_gazelle_standardPredictor(_);
18  
  done2(startTime, "Making engine with " + n2(rules, "rule"));
19  
  ret ctx;
20  
}

Author comment

Began life as a copy of #1021684

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1021973
Snippet name: gazelle_stdEvalContext_v2 - use statement multisets [LIVE]
Eternal ID of this version: #1021973/4
Text MD5: b1fb21ba040475f125d08645d3025da1
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-07 18:57:54
Source code size: 841 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 303 / 340
Version history: 3 change(s)
Referenced in: [show references]