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

18
LINES

< > BotCompany Repo | #1026092 // Bench Extended Ukkonen algorithm for Levenshtein distance (super fast when strings are equal/similar)

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

Download Jar. Libraryless. Click here for Pure Java version (8027L/54K).

!7

p-exp {
  int n = 5000;
  EditDistance dist = new(n);
  S a = randomID(n), b = randomID(n), c = firstToUpper(a);
  assertTrue(neq(a, b));
  double dist1 = 0, dist2 = 0, dist3 = 0;
  repeat 10 {
    time { dist1 = dist.d(a, b); }
    time { dist2 = dist.d(a, a); }
    time { dist3 = dist.d(a, c); }
  }
  assertTrue(dist1 != 0);
  assertEquals(0.0, dist2);
  assertEquals(1.0, dist3);
  print(dist1 + "/" + dist2 + "/" + dist3);
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1026092
Snippet name: Bench Extended Ukkonen algorithm for Levenshtein distance (super fast when strings are equal/similar)
Eternal ID of this version: #1026092/6
Text MD5: afe322864816e2fb92f7ed652d26764f
Transpilation MD5: 5f493f407a59efff6a3433903c286c36
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-11-20 01:16:02
Source code size: 451 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 339 / 1231
Version history: 5 change(s)
Referenced in: #1026142 - Bench Extended Ukkonen algorithm for Levenshtein distance with sparse array
#1026143 - Bench Extended Ukkonen algorithm for Levenshtein distance (new version using interface)