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

18
LINES

< > BotCompany Repo | #1014567 // mL_answerWithCodeFragments

JavaX fragment (include)

sS mL_answerWithCodeFragments(S s) {
  ret mL_answerWithCodeFragments("Questions to AI => Answers with code fragments", s);
}

sS mL_answerWithCodeFragments(S listName, S s) {
  Pair<S, Matches> answer = lookupNL_dollarVars_dontExpand(mechMap(listName), s);
  if (answer == null) null;
  
  L<S> tok = javaTokWithAngleBrackets(answer.a);
  for (int i = 1; i < l(tok); i += 2) {
    S t = tok.get(i);
    if (isAngleBracketed(t))
      tok.set(i, structOrText(javaEval(mL_expandFunctionNames(expandDollarRefsToMatches_alwaysQuote(deAngleBracket(t), answer.b)))));
    else
      tok.set(i, expandDollarRefsToMatches(t, answer.b));
  }
  ret join(tok);
}

Author comment

Began life as a copy of #1014454

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: #1014567
Snippet name: mL_answerWithCodeFragments
Eternal ID of this version: #1014567/5
Text MD5: 87120bfc0b5b3c2542daea663fb92384
Author: stefan
Category: javax / a.i. / web
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-24 12:18:58
Source code size: 669 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 332 / 372
Version history: 4 change(s)
Referenced in: [show references]