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

10
LINES

< > BotCompany Repo | #1014217 // scoredSearch_field

JavaX fragment (include)

static <A> L<A> scoredSearch_field(S query, Iterable<A> data, S field) {
  new Map<A, Int> scores;
  L<S> prepared = scoredSearch_prepare(query);
  for (A s : data) {
    int score = scoredSearch_score(getOpt(s, field), prepared);
    if (score != 0)
      scores.put(s, score);
  }
  ret keysSortedByValuesDesc(scores);
}

Author comment

Began life as a copy of #1007531

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: #1014217
Snippet name: scoredSearch_field
Eternal ID of this version: #1014217/2
Text MD5: 51dd9356f4830a68eae4f954381d1401
Author: stefan
Category: javax / text
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-16 02:05:10
Source code size: 331 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 275 / 316
Version history: 1 change(s)
Referenced in: [show references]