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

9
LINES

< > BotCompany Repo | #1021862 // scoreDiscriminator

JavaX fragment (include)

// discriminator: func(A) -> bool
static <A, B extends Collection<A>> Scorer scoreDiscriminator(O discriminator, Pair<B> p) {
  new Scorer scorer;
  for (A a : unnull(p.a))
    scorer.add(isTrue_callF(discriminator, a), a);
  for (A a : unnull(p.b))
    scorer.add(!isTrue_callF(discriminator, a), a);
  ret scorer;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1021862
Snippet name: scoreDiscriminator
Eternal ID of this version: #1021862/4
Text MD5: 8d042e66eb9e90620482c04563ef29e1
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-02 18:35:35
Source code size: 325 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 295 / 329
Version history: 3 change(s)
Referenced in: [show references]