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).

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

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: 190 / 298
Version history: 6 change(s)
Referenced in: [show references]