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

39
LINES

< > BotCompany Repo | #1022242 // gazelle_fakery_processInput_multi_v2 (with self-talk, old)

JavaX fragment (include)

1  
svoid gazelle_fakery_processInput_multi_v2(TreeMap<S> sections, O... _) {
2  
  int maxMonologue = optPar maxMonologue(_, 5);
3  
  ErrorCounter errorCounter = optPar errorCounter(_, new ErrorCounter);
4  
  for (fS key : startingWithIC(keys(sections), "test input")) errorCounter.run(key, r {
5  
    LS inputLines = tlft(sections.get(key));
6  
    S expectedOutput = sections.get(replaceIC(key, "test input", "expected output"));
7  
    S expectedTempFacts = sections.get(replaceIC(key, "test input", "expected temporary facts"));
8  
    print("\nPROCESSING: " + key + "\n");
9  
    temporaryFacts.clear();
10  
    
11  
    new LS lines;
12  
    int nMonologue = 0;
13  
    for i over inputLines: {
14  
      S input = inputLines.get(i);
15  
      S user = leadingSquareBracketStuff(input);
16  
      input = dropActuallyLeadingSquareBracketStuff(input);
17  
      gazelle_gatherFulfillments(ll(nu GazelleLine(text := input, extras := litmap(+user))), fulfillments, debug := true);
18  
      L<GazelleTree> l = dm_gazelle_reasonAboutChatInput_v2(user, input, paramsPlus(_,
19  
        preContext := subList(inputLines, 0, i),
20  
        respondingToHuman := nMonologue == 0,
21  
        contextMaker := f<GazelleEvalContext> dm_gazelle_stdEvalContext,
22  
        requiredComment := null, debug := true));
23  
      print("Got " + n2(l, "child", "children") + " with line types: " + collect lineType(l));
24  
      for (GazelleTree t : l) {
25  
        if (eq(t.lineType, "temporary fact"))
26  
          temporaryFacts.add(printWithIndent("TEMP FACT> ", t.line));
27  
        else {
28  
          lines.add(printWithIndent("OUT> ", t.line));
29  
          if (++nMonologue < maxMonologue)
30  
            inputLines.add(t.line);
31  
        }
32  
      }
33  
    }
34  
  
35  
    assertEqualsVerbose(lines, tlft(expectedOutput));
36  
    assertEqualsVerbose(asList(temporaryFacts), tlft(expectedTempFacts));
37  
  });
38  
  errorCounter.print();
39  
}

Author comment

Began life as a copy of #1021800

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: #1022242
Snippet name: gazelle_fakery_processInput_multi_v2 (with self-talk, old)
Eternal ID of this version: #1022242/7
Text MD5: 99afc8a2bf1781adefa85764ac1311aa
Author: stefan
Category: javax / gazelle
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-18 17:00:50
Source code size: 1845 bytes / 39 lines
Pitched / IR pitched: No / No
Views / Downloads: 250 / 280
Version history: 6 change(s)
Referenced in: [show references]