symspell-ex
Version:
Spelling correction & Fuzzy search based on symmetric delete spelling correction algorithm
28 lines (27 loc) • 942 B
TypeScript
/**
* This is the fastest implementation of Damerau-Levenshtein for JavaScript,
* an optimization of David Hamp-Gonsalves' port.
* Based on implementation from https://github.com/microsoft/damlev
*/
import { EditDistance } from "../../index";
export declare class DamerauLevenshteinDistance implements EditDistance {
name: string;
sourceCodes: any[];
targetCodes: any[];
score: any[];
/**
* growArray will return an array that's at least as large as the provided
* size. It may or may not return the same array that was passed in.
* @param {Array} arr
* @param {Number} size
* @return {Array}
*/
growArray(arr: number[], size: number): any[];
/**
* Returns the edit distance between the source and target strings.
* @param {String} source
* @param {String} target
* @return {Number}
*/
calculateDistance(source: string, target: string): number;
}