Skip to main content

myers_bitparallel

Function myers_bitparallel 

Source
pub fn myers_bitparallel(
    text: &[u8],
    pattern: &[u8],
    max_dist: usize,
) -> Vec<(usize, usize)>
Expand description

Myers bit-parallel approximate matching.

Computes edit distance (Levenshtein) between the pattern and all substrings of the text using Myers’ 1999 bit-vector algorithm. Limited to patterns of length <= 64.

Returns (end_position, edit_distance) pairs for every text position where the best alignment ending there has edit distance <= max_dist. Returns an empty vec if the pattern exceeds 64 characters.