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

35
LINES

< > BotCompany Repo | #1012869 // ai_markCandidateBotTriples

JavaX fragment (include)

1  
!7
2  
3  
sclass ai_markCandidateBotTriples_CandidateMsg {
4  
  S symbol, text;
5  
  int secs; // seconds after last post
6  
  Bool bot;
7  
}
8  
9  
static void ai_markCandidateBotTriples() {
10  
  new LL<ai_markCandidateBotTriples_CandidateMsg> candidates;
11  
  
12  
  for (L<S> t : ai_all_threeInARow("Chat line")) {
13  
    L<ai_markCandidateBotTriples_CandidateMsg> l = ai_markCandidateBotTriples_analyze(t);
14  
    continue unless isFalse(l.get(0).bot) && isTrue(l.get(1).bot) && isFalse(l.get(2).bot);
15  
    candidates.add(l);
16  
    for (ai_markCandidateBotTriples_CandidateMsg m : l)
17  
      print((isTrue(m.bot) ? "[B]" : isFalse(m.bot) ? "[U]" : "[?]") + " " + m.symbol + ": " + quoteBorderless(m.text) + " [" + m.secs + " s]");
18  
    print();
19  
    post(first(t), "possibly is", "a bot triple starter");
20  
  }
21  
  print(n2(candidates, "candidate"));
22  
}
23  
24  
static L<ai_markCandidateBotTriples_CandidateMsg> ai_markCandidateBotTriples_analyze(L<S> t) {
25  
  new L<ai_markCandidateBotTriples_CandidateMsg> l;
26  
  for (S s : t) {
27  
    new ai_markCandidateBotTriples_CandidateMsg m;
28  
    m.symbol = s;
29  
    m.text = ai_chatLineText(s);
30  
    m.secs = (int) ai_chatLineTimeDiff(s)/1000;
31  
    m.bot = ai_chatLineSentByBot(s);
32  
    l.add(m);
33  
  }
34  
  ret l;
35  
}

Author comment

Began life as a copy of #1012858

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1012869
Snippet name: ai_markCandidateBotTriples
Eternal ID of this version: #1012869/3
Text MD5: a98e9875d6987262726fdf4f8d55fc2c
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-14 22:37:56
Source code size: 1221 bytes / 35 lines
Pitched / IR pitched: No / No
Views / Downloads: 292 / 310
Version history: 2 change(s)
Referenced in: [show references]