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

21
LINES

< > BotCompany Repo | #1018281 // nlLogic_twoStageProcessing

JavaX fragment (include)

sbool nlLogic_twoStageProcessing_verbose;

// stage1/stage2: "<default>" or mech list name
svoid nlLogic_twoStageProcessing(S input, S stage1, S stage2, L<ExecutedRule> resultsOut) {
  L<ExecutedRule> results1 = nlLogic_processInputOrFact(input, false, stage1);
  
  // Collect results of stage 1
  nlLogic_collectExecutedRulesWithOutputOrFacts(results1, resultsOut);

  // Collect inputs for stage 2
  Set<S> newInputs = nlLogic_inputsFromExecutedRules(litorderedset(input), results1);

  for (S s : newInputs) {
    if (nlLogic_twoStageProcessing_verbose)
      print("Stage 2: " + s);
    L<ExecutedRule> results2 = nlLogic_processInputOrFact(s, false, stage2);

    // Collect results of stage 2
    nlLogic_collectExecutedRulesWithOutputOrFacts(results2, resultsOut);
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1018281
Snippet name: nlLogic_twoStageProcessing
Eternal ID of this version: #1018281/3
Text MD5: 0aff0e3dcb5ea46cd000acec2e868964
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-09-14 13:17:21
Source code size: 798 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 296 / 328
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)