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

19
LINES

< > BotCompany Repo | #1011593 // scoredSearch_score

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4010L/23K).

1  
// Search for some words in some texts and return a total score
2  
static int scoredSearch_score(Iterable<S> l, L<S> words) {
3  
  int score = 0;
4  
  if (l != null) for (S s : l)
5  
    score += scoredSearch_score(s, words);
6  
  ret score;
7  
}
8  
9  
static int scoredSearch_score(S s, L<S> words) {
10  
  int score = 0;
11  
  if (nempty(s))
12  
    fOr (S word : words)
13  
      score += scoredSearch_score_single(s, word);
14  
  ret score;
15  
}
16  
17  
static int scoredSearch_score(S s, S query) {
18  
  ret scoredSearch_score(s, scoredSearch_prepare(query));
19  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney

No comments. add comment

Snippet ID: #1011593
Snippet name: scoredSearch_score
Eternal ID of this version: #1011593/10
Text MD5: adccdf1c7420e88e6d4f87fffc3731ba
Transpilation MD5: c5c64be8ba33584efd339ab05a54d9d3
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-14 16:08:39
Source code size: 528 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 548 / 650
Version history: 9 change(s)
Referenced in: [show references]