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.

static <A> A mmo_matchMultiWithTypos(int maxTypos, Cl<A> entries, IF1<A, MMOPattern> entryToPattern, S s) {
  fOr (A a : entries)
    if (mmo_match_parsedPattern(entryToPattern.get(a), s))
      ret a;
  
  new Lowest<A> best;
  for (A a : entries)
    lowestPut(best, a, mmo_levenWithSwapsScore_parsedPattern(entryToPattern.get(a), s));
  
  if (!best.has()) null;
  if (best.score() > maxTypos) null;
  ret best!;
}

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: 210 / 309
Version history: 2 change(s)
Referenced in: [show references]