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

32
LINES

< > BotCompany Repo | #1002970 // Dem Puppet (#talkingbots)

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

Libraryless. Click here for Pure Java version (1874L/12K/40K).

!752

static S prefix = "[eleu]";

static PersistentMap<S, S> inToOut;

p {
  inToOut = new PersistentMap("inToOut");
  noteLast_load();
}

synchronized answer {
  if (neq(getChannel(), "devchannel, #talkingbots")) null;
  
  S last = noteLast(s);
  S in = simplifySentence2(s);
  
  // check store prefix
  s = s.trim();
  if (swic(s, prefix)) {
    S response = dropPrefixIgnoreCase(prefix, s).trim();
    S lastIn =simplifySentence2(last);
    print("puppet save: " + lastIn + ", out=" + response);
    inToOut.put(lastIn, response);
    ret response;
  }
  
  S out = inToOut.get(in);
  print("in=" + in + ", out=" + out);
  if (nempty(out))
    ret out;
}

Author comment

Began life as a copy of #1002967

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: #1002970
Snippet name: Dem Puppet (#talkingbots)
Eternal ID of this version: #1002970/1
Text MD5: 08d0752469924feda636eef23d209234
Transpilation MD5: c21f55a62eb5bb83fb1dbc684c73637f
Author: stefan
Category: nl bots
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-04-14 18:33:41
Source code size: 693 bytes / 32 lines
Pitched / IR pitched: No / No
Views / Downloads: 697 / 1044
Referenced in: [show references]