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

26
LINES

< > BotCompany Repo | #1008541 // Solve "Find subject" [dev.]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (7813L/53K/174K).

!7

concept Example {
  S sentence, subject;
}

p {
  loadConceptsFrom(#1008540);
  new ScoreBoard sb;
  testFunction(sb, f firstWord);
  sb.print();
}

svoid testFunction(ScoreBoard sb, O f) {
  int fullScore = 0, score = 0;
  for (Example e) {
    S in = trim(e.sentence), out = trim(e.subject);
    if (empty(out)) continue;
    ++fullScore;
    S o = (S) pcallF(f, in);
    if (eqic(trim(o), out))
      ++score;
  }
  sb.fullScore = fullScore;
  sb.scores.put(f, (double) score);
}

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: 502 / 632
Version history: 4 change(s)
Referenced in: