Libraryless. Click here for Pure Java version (742L/6K/17K).
1 | !7 |
2 | |
3 | static L<S> strings = splitAtSpace("a b ab ba aab aba bbaa abc ca bac aabb eec ec cae eeaaee ebbbee aa bbccaa aaccccc"); |
4 | |
5 | p { |
6 | for (S a : strings) |
7 | for (S b : strings) { |
8 | int lev = leven(a, b); |
9 | for (int max = 0; max <= lev+1; max++) { |
10 | int i = leven_limited(a, b, max); |
11 | if (i != min(lev, max)) |
12 | print("ERROR: " + quote(a) + " " + quote(b) + " " + lev + " " + " max " + max + " => " + i); |
13 | } |
14 | } |
15 | print("done (" + l(strings)*l(strings) + " tests)"); |
16 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1007597 |
Snippet name: | Test leven_limited [WORKS] |
Eternal ID of this version: | #1007597/4 |
Text MD5: | 6e89b53de44be081c82276f42785a19c |
Transpilation MD5: | 6a61e4fb75093ea9a0bc30f8b095ad69 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-03-28 00:05:50 |
Source code size: | 516 bytes / 16 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 496 / 552 |
Version history: | 3 change(s) |
Referenced in: | [show references] |