本文整理汇总了TypeScript中fast-levenshtein.get函数的典型用法代码示例。如果您正苦于以下问题:TypeScript get函数的具体用法?TypeScript get怎么用?TypeScript get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
return Object.keys(candidate).reduce((sum, prop: string) => {
const definitionString: string = definition[prop] || '';
return sum + levenshtein.get(definitionString, candidate[prop]);
}, 0);
示例2: getClosestMatch
return getClosestMatch(candidates, (candidate) => {
return levenshtein.get(column, candidate);
});
示例3:
import * as fastLevenshtein from 'fast-levenshtein';
declare const boolVal: boolean;
declare const strVal: string;
// option datas tests
let opts: fastLevenshtein.LevenshteinOptions = {};
opts.useCollator = boolVal;
// API tests
fastLevenshtein.get(strVal, strVal);
fastLevenshtein.get(strVal, strVal, opts);
示例4: minBy
return minBy(options, (option) => levenshtein.get(word, option));
示例5:
imagePaths.forEach(imPath => {
if (lev.get(imPath, url) <= maxImagePathLevDistance) {
let relImPath = imPath.substring(imPath.indexOf('docs'));
console.log(`Should it be "${relImPath}"?`)
}
});