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

35
LINES

< > BotCompany Repo | #1012869 // ai_markCandidateBotTriples

JavaX fragment (include)

!7

sclass ai_markCandidateBotTriples_CandidateMsg {
  S symbol, text;
  int secs; // seconds after last post
  Bool bot;
}

static void ai_markCandidateBotTriples() {
  new LL<ai_markCandidateBotTriples_CandidateMsg> candidates;
  
  for (L<S> t : ai_all_threeInARow("Chat line")) {
    L<ai_markCandidateBotTriples_CandidateMsg> l = ai_markCandidateBotTriples_analyze(t);
    continue unless isFalse(l.get(0).bot) && isTrue(l.get(1).bot) && isFalse(l.get(2).bot);
    candidates.add(l);
    for (ai_markCandidateBotTriples_CandidateMsg m : l)
      print((isTrue(m.bot) ? "[B]" : isFalse(m.bot) ? "[U]" : "[?]") + " " + m.symbol + ": " + quoteBorderless(m.text) + " [" + m.secs + " s]");
    print();
    post(first(t), "possibly is", "a bot triple starter");
  }
  print(n2(candidates, "candidate"));
}

static L<ai_markCandidateBotTriples_CandidateMsg> ai_markCandidateBotTriples_analyze(L<S> t) {
  new L<ai_markCandidateBotTriples_CandidateMsg> l;
  for (S s : t) {
    new ai_markCandidateBotTriples_CandidateMsg m;
    m.symbol = s;
    m.text = ai_chatLineText(s);
    m.secs = (int) ai_chatLineTimeDiff(s)/1000;
    m.bot = ai_chatLineSentByBot(s);
    l.add(m);
  }
  ret l;
}

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: 289 / 305
Version history: 2 change(s)
Referenced in: [show references]