當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript fuzzaldrin.score函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。