/** * @purpose Compute the Damerau-Levenshtein distance between two strings. * @invariant Supports insertion, deletion, substitution, transposition; distance 0 for identical strings. * @param a First string. * @param b Second string. * @returns Edit distance (non-negative integer). */ export declare function damerauLevenshtein(a: string, b: string): number; /** * @purpose Determine if two strings match within the fuzzy threshold. * @invariant Threshold <=2 for strings of length <=5; <=3 for length >5. * @param query Requested term. * @param candidate Indexed term to compare against. * @returns True when DL distance is within the applicable threshold. */ export declare function isFuzzyMatch(query: string, candidate: string): boolean; /** * @purpose Compute DL distance and return it with the match verdict. * @param query Requested term. * @param candidate Indexed term to compare against. * @returns Distance value and whether it is within the threshold. */ export declare function fuzzyDistance(query: string, candidate: string): { distance: number; match: boolean; };