code wiki / (root) / nx_editdist.nx

nx_editdist.nx

buildroot/runtime/nx_editdist.nx

1652 B41 linesdepth 2pulls 2 transitivereach 59 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_editdist.nx -- INTEGER bounded Levenshtein for the typo/did-you-mean rung. Classic two-row DP over byte strings (our index terms are lowercased alnum runs <= 32 bytes, so bytes == characters here). ed_bounded returns the edit distance, or bound+1 the moment it can prove distance > bound (early-out: the length gap alone decides most rejects at O(1)). No floats, no allocation beyond two 40-cell rows. license_tier: ORIGINAL

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_editdist.nx nx_docportal_search_seg.nx nx_editdist_gate.nx

imports: nx_syscalls.nx

imported by: nx_docportal_search_seg.nxnx_editdist_gate.nx

structs

none

consts

none

functions

8func ed_bounded(a: *u8, an: i64, b: *u8, bn: i64, bound: i64) -> i64
called by 3: dss_correctg_edmain calls 1: sys_mmap