SecreC 2 language  2.8.0 (2023.09)
Language and standard library reference
Functions

Functions

template<domain D :shared3p >
D uint bl_strLevenshtein (D xor_uint8[[1]] s, D xor_uint8[[1]] t)
 

Detailed Description

function for finding the edit distance of the two input strings

Note
D - shared3p protection domain
Supported types - xor_uint8
Parameters
s,t- input string vectors of supported type
Returns
returns the edit distance of the two input strings
Note
the algorithm is almost identical to the known length one. The only difference is that the result is found somewhere in the middle of the 2D grid, and not in the bottom right corner. To find it we: a) compute a mask that's one in that position and zero otherwise, b) multiply the mask with the grid, and c) return the sum of the result.
Leakage
None

Function Documentation

◆ bl_strLevenshtein()

D uint bl_strLevenshtein ( D xor_uint8[[1]]  s,
D xor_uint8[[1]]  t 
)