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

13
LINES

< > BotCompany Repo | #1027528 // mmo_matchMultiWithTypos

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

Transpiled version (3923L) is out of date.

1  
static <A> A mmo_matchMultiWithTypos(int maxTypos, Cl<A> entries, IF1<A, MMOPattern> entryToPattern, S s) {
2  
  fOr (A a : entries)
3  
    if (mmo_match_parsedPattern(entryToPattern.get(a), s))
4  
      ret a;
5  
  
6  
  new Lowest<A> best;
7  
  for (A a : entries)
8  
    lowestPut(best, a, mmo_levenWithSwapsScore_parsedPattern(entryToPattern.get(a), s));
9  
  
10  
  if (!best.has()) null;
11  
  if (best.score() > maxTypos) null;
12  
  ret best!;
13  
}

Author comment

Began life as a copy of #1026500

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1027528
Snippet name: mmo_matchMultiWithTypos
Eternal ID of this version: #1027528/3
Text MD5: 7d2a94d59ed15cee3c237f24c0ad214c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-03-22 23:36:54
Source code size: 429 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 211 / 310
Version history: 2 change(s)
Referenced in: [show references]