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

18
LINES

< > BotCompany Repo | #1026147 // Bench Extended Ukkonen algorithm for Levenshtein distance with faster sparse array

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (8320L/56K).

1  
!7
2  
3  
p-exp {
4  
  int n = 5000;
5  
  EditDistance dist = newEditDistance_sparseArray2_v2();
6  
  S a = randomID(n), b = randomID(n), c = firstToUpper(a);
7  
  assertTrue(neq(a, b));
8  
  double dist1 = 0, dist2 = 0, dist3 = 0;
9  
  repeat 10 {
10  
    time { dist1 = dist.d(a, b); }
11  
    time { dist2 = dist.d(a, a); }
12  
    time { dist3 = dist.d(a, c); }
13  
  }
14  
  assertTrue(dist1 != 0);
15  
  assertEquals(0.0, dist2);
16  
  assertEquals(1.0, dist3);
17  
  print(dist1 + "/" + dist2 + "/" + dist3);
18  
}

Author comment

Began life as a copy of #1026142

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1026147
Snippet name: Bench Extended Ukkonen algorithm for Levenshtein distance with faster sparse array
Eternal ID of this version: #1026147/6
Text MD5: 72ec8a0d5ba4c11ad9d041cd0a3b55c9
Transpilation MD5: 13229bc3ef2a269b531229286fe688d8
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-11-27 03:23:55
Source code size: 478 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 157 / 701
Version history: 5 change(s)
Referenced in: [show references]