本文整理汇总了TypeScript中fuzzaldrin.score函数的典型用法代码示例。如果您正苦于以下问题:TypeScript score函数的具体用法?TypeScript score怎么用?TypeScript score使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了score函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1:
var all = _.map(Aliases.all, (alias: string, expanded: string) => {
return {
value: expanded,
score: 2 * (score(alias, lastLexeme) + (score(expanded, lastLexeme) * 0.5)),
synopsis: alias,
description: `Aliased to â${expanded}â.`,
type: 'alias',
}
});
开发者ID:digideskio,项目名称:black-screen,代码行数:9,代码来源:Alias.ts
示例2:
const scores = keys.map((key) => {
const ck = candidate[key]
if (ck) {
return FZ.score(ck.toString(), prefix)
} else {
return 0
}
})
开发者ID:mvoidex,项目名称:atom-haskell-hsdev,代码行数:8,代码来源:index.ts
示例3: score
var all = _.map(executables, (executable: string) => {
return {
value: executable,
score: 1.5 * score(executable, lastArgument),
synopsis: '',
description: descriptions[executable],
type: 'executable'
};
});
开发者ID:digideskio,项目名称:black-screen,代码行数:9,代码来源:Executable.ts
示例4: score
var all = ExecutionHistory.all.filter(entry => entry.raw.length > 3).map(entry => {
return {
value: entry.raw,
score: 0.1 * score(entry.raw, lastArgument),
synopsis: '',
description: '',
replaceAll: true,
type: 'history'
};
});
开发者ID:digideskio,项目名称:black-screen,代码行数:10,代码来源:History.ts
示例5: filter
import { match, filter, score } from 'fuzzaldrin';
let number = 0;
const string = '' as string;
let strings: string[] = [];
let objects: Array<{name: string, speed: number}> = [];
strings = filter(strings, string);
strings = filter(strings, string, {maxResults: number});
objects = filter(objects, string, {key: 'name'});
objects = filter(objects, string, {key: 'name', maxResults: number});
number = score(string, string);
match(string, string);
// These should be type errors! Uncomment to verify.
// objects = filter(objects, string);
// objects = filter(objects, string, {key: 'speed'});
// strings = filter(strings, string, {key: 'speed'});
开发者ID:AdaskoTheBeAsT,项目名称:DefinitelyTyped,代码行数:20,代码来源:fuzzaldrin-tests.ts
示例6: score
var prepared = _._(all).each(suggestion => suggestion.score = score(suggestion.value, baseName))
开发者ID:digideskio,项目名称:black-screen,代码行数:1,代码来源:File.ts
注:本文中的fuzzaldrin.score函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论