Libraryless. Click here for Pure Java version (3505L/22K).
// post is the text from e.g. https://gazelle.rocks/131422 sS gazelle_ai_addFalseNegativeToDetector(S post) { S detectorCode = trim(first(splitAtEmptyLines(getColonHeadingSection("Detector code", post)))); print("Detector: " + detectorCode); LS falseNegatives = lmap afterColon(linesStartingWith("False negative", post); S falseNegative = random(falseNegatives); if (falseNegative == null) null; print("Selecting false negative: " + falseNegative); S matchExpression = firstQuoted(detectorCode); print(+matchExpression); S newMatchExpression = matchExpression + ", " + falseNegative; print(+newMatchExpression); S newCode = replace(detectorCode, quote(matchExpression), quote(newMatchExpression)); print(+newCode); ret newCode; }
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: | 202 / 282 |
Version history: | 1 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |