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

20
LINES

< > BotCompany Repo | #1026733 // ai_parseStatementsWithReasoning

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3072L/20K).

// e.g.
// "pause" is usually a misrecognition of "applause"
//   [Reasoning: speech log entries "pause" at 2019/12/18...]

static L<Proposition> ai_parseStatementsWithReasoning(S text) {
  LS lines = tlft_honoringBrackets(text);
  new L<Proposition> out;
  for i over lines: {
    S next = get(lines, i+1);
    S statement = lines.get(i);
    new Matches m;
    S reasoning = "";
    if (swicEwic_trim(next, "[Reasoning:", "]", m)) {
      reasoning = m.rest();
      ++i;
    }
    out.add(withReasoning(statement, reasoning));
  }
  ret out;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1026733
Snippet name: ai_parseStatementsWithReasoning
Eternal ID of this version: #1026733/3
Text MD5: e2b48f44e5473c73fd390314e929e6be
Transpilation MD5: 4ff14b7bc4a5b9aaaa96ee7f302a6308
Author: stefan
Category: javax / ele
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-01-19 21:09:43
Source code size: 565 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 185 / 265
Version history: 2 change(s)
Referenced in: [show references]