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

36
LINES

< > BotCompany Repo | #1018274 // Two-Stage Input Processing Spike [OK]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (16334L/122K).

1  
!7
2  
3  
p-exp {
4  
  S input = "tell me what's going on";
5  
  
6  
  new L<ExecutedRule> results;
7  
  
8  
  L<ExecutedRule> results1 = nlLogic_processInputOrFact(input, false, "Reduction rules 2");
9  
  
10  
  // Collect results of stage 1
11  
  for (ExecutedRule r : results1)
12  
    if (nempty(r.output) || nempty(r.facts)) {
13  
      print("Result: " + sfu(r));
14  
      results.add(r);
15  
    }
16  
  
17  
  // Collect inputs for stage 2
18  
  LinkedHashSet<S> newInputs = litorderedset(input);
19  
  for (ExecutedRule r : results1)
20  
    addAll(newInputs, r.newInput);
21  
22  
  for (S s : newInputs) {
23  
    print("Stage 2: " + s);
24  
    L<ExecutedRule> results2 = nlLogic_processInputOrFact(s, false, "<default>");
25  
26  
    // Collect results of stage 2
27  
    for (ExecutedRule r : results2)
28  
      if (nempty(r.output) || nempty(r.facts)) {
29  
        print("Result: " + sfu(r));
30  
        results.add(r);
31  
      }
32  
  }
33  
  
34  
  printAsciiHeading("Results");
35  
  pnlStruct(results);
36  
}

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: #1018274
Snippet name: Two-Stage Input Processing Spike [OK]
Eternal ID of this version: #1018274/9
Text MD5: b50ab1b1afe4a9f478afbaac29084934
Transpilation MD5: c8c6bb50f3a811f823e60e20e1a504e0
Author: stefan
Category: javax / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-09-13 17:51:33
Source code size: 937 bytes / 36 lines
Pitched / IR pitched: No / No
Views / Downloads: 422 / 1044
Version history: 8 change(s)
Referenced in: [show references]