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

11
LINES

< > BotCompany Repo | #1027920 // mostRelativelySimilarLevenICPairs

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

Libraryless. Click here for Pure Java version (3127L/19K).

// returns all the pairs, but best matches first
// second part of pair is similarity score (0-100)
static LPair<PairS, Int> mostRelativelySimilarLevenICPairs(Cl<S> words, O... _) {
  optPar int minScore = 0;
  new Map<PairS, Int> map;
  for (LS l : allSubsetsOfSize_iterator(2, words)) {
    int sim = levenSimilarityIntIC(first(l), second(l));
    if (sim >= minScore) map.put(listToPair(l), sim);
  }
  ret pairsSortedByBDesc(mapToPairs(map));
}

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: #1027920
Snippet name: mostRelativelySimilarLevenICPairs
Eternal ID of this version: #1027920/7
Text MD5: 9f9994e28a8124358fc4a977f07646c5
Transpilation MD5: b3c294ff5bb9865bf403ef142a29fd3b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-04-21 10:33:50
Source code size: 458 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 189 / 297
Version history: 6 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)