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

10
LINES

< > BotCompany Repo | #1014217 // scoredSearch_field

JavaX fragment (include)

1  
static <A> L<A> scoredSearch_field(S query, Iterable<A> data, S field) {
2  
  new Map<A, Int> scores;
3  
  L<S> prepared = scoredSearch_prepare(query);
4  
  for (A s : data) {
5  
    int score = scoredSearch_score(getOpt(s, field), prepared);
6  
    if (score != 0)
7  
      scores.put(s, score);
8  
  }
9  
  ret keysSortedByValuesDesc(scores);
10  
}

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: 348 / 387
Version history: 1 change(s)
Referenced in: [show references]