Libraryless. Click here for Pure Java version (7813L/53K/174K).
1 | !7 |
2 | |
3 | concept Example { |
4 | S sentence, subject; |
5 | } |
6 | |
7 | p { |
8 | loadConceptsFrom(#1008540); |
9 | new ScoreBoard sb; |
10 | testFunction(sb, f firstWord); |
11 | sb.print(); |
12 | } |
13 | |
14 | svoid testFunction(ScoreBoard sb, O f) { |
15 | int fullScore = 0, score = 0; |
16 | for (Example e) { |
17 | S in = trim(e.sentence), out = trim(e.subject); |
18 | if (empty(out)) continue; |
19 | ++fullScore; |
20 | S o = (S) pcallF(f, in); |
21 | if (eqic(trim(o), out)) |
22 | ++score; |
23 | } |
24 | sb.fullScore = fullScore; |
25 | sb.scores.put(f, (double) score); |
26 | } |
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: | #1008541 |
Snippet name: | Solve "Find subject" [dev.] |
Eternal ID of this version: | #1008541/5 |
Text MD5: | 06087555c95bbe10fe72da6c611ab93d |
Transpilation MD5: | d77d1c5adbd1e03f47f9587b4779d4bb |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-09-15 19:52:14 |
Source code size: | 511 bytes / 26 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 503 / 633 |
Version history: | 4 change(s) |
Referenced in: | [show references] |