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

16
LINES

< > BotCompany Repo | #1030064 // gazelle_ai_addFalseNegativeToDetector

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

Libraryless. Click here for Pure Java version (3505L/22K).

1  
// post is the text from e.g. https://gazelle.rocks/131422
2  
sS gazelle_ai_addFalseNegativeToDetector(S post) {
3  
  S detectorCode = trim(first(splitAtEmptyLines(getColonHeadingSection("Detector code", post))));
4  
  print("Detector: " + detectorCode);
5  
  LS falseNegatives = lmap afterColon(linesStartingWith("False negative", post);
6  
  S falseNegative = random(falseNegatives);
7  
  if (falseNegative == null) null;
8  
  print("Selecting false negative: " + falseNegative);
9  
  S matchExpression = firstQuoted(detectorCode);
10  
  print(+matchExpression);
11  
  S newMatchExpression = matchExpression + ", " + falseNegative;
12  
  print(+newMatchExpression);
13  
  S newCode = replace(detectorCode, quote(matchExpression), quote(newMatchExpression));
14  
  print(+newCode);
15  
  ret newCode;
16  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 5 computer(s): bhatertpkbcr, ekrmjmnbrukm, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030064
Snippet name: gazelle_ai_addFalseNegativeToDetector
Eternal ID of this version: #1030064/2
Text MD5: 3e13746954c9695889e05c81f1802edc
Transpilation MD5: 4557852891b57e2458049c9d7ea861f4
Author: stefan
Category: javax / gazelle.rocks
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-11-04 09:50:21
Source code size: 770 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 114 / 163
Version history: 1 change(s)
Referenced in: [show references]