当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript fuzzaldrin-plus.score函数代码示例

本文整理汇总了TypeScript中fuzzaldrin-plus.score函数的典型用法代码示例。如果您正苦于以下问题:TypeScript score函数的具体用法?TypeScript score怎么用?TypeScript score使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了score函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: transform

 transform(inputString: string, query: string) {
     return query.length > 0 ? Fuzzy.score(inputString, query, { usePathScoring: false }) !== 0 : true;
 }
开发者ID:kencinder,项目名称:steam-rom-manager,代码行数:3,代码来源:fuzzy.pipe.ts

示例2:

]
const objectCandidates = candidates.map(s => ({ foo: s }))
const options: fz.IOptions = { allowErrors: true }
const filterOptions: fz.IFilterOptions = {
    allowErrors: true,
    key: 'foo'
}

fz.filter(candidates, 'install')
fz.filter(candidates, 'install', options)
fz.filter(candidates, 'install', filterOptions)
fz.filter(objectCandidates, 'install', { key: 'foo' })

const preparedQuery: fz.Query = fz.prepareQuery('install')

fz.score('Maybe', 'me')
fz.score('Maybe', 'me', undefined)
fz.score('Maybe', 'me', null)
fz.score('Maybe', 'me', {})
fz.score('Maybe', 'me', { allowErrors: true })
fz.score('Application: Install Update', 'install')
fz.score('Application: Install Update', 'install', { preparedQuery })

fz.match('Maybe', 'me')
fz.match('Application: Install Update', 'install')
fz.match('Application: Install Update', 'install', { preparedQuery })

fz.wrap('Maybe', 'me')

//
// Complex filter cases, using all the options
开发者ID:adidahiya,项目名称:DefinitelyTyped,代码行数:31,代码来源:fuzzaldrin-plus-tests.ts

示例3: score

function score(str: string, query: string, maxScore: number) {
  return fuzzAldrin.score(str, query, undefined, options) / maxScore
}
开发者ID:whyamei,项目名称:desktop,代码行数:3,代码来源:fuzzy-find.ts

示例4: score

function score(str: string, query: string, maxScore: number) {
  return fuzzAldrin.score(str, query) / maxScore
}
开发者ID:ghmoore,项目名称:desktop,代码行数:3,代码来源:fuzzy-find.ts

示例5:

import * as fz from "fuzzaldrin-plus";

const candidates = [
    'Find And Replace: Select All',
    'Settings View: Uninstall Packages',
    'Settings View: View Installed Themes',
    'Application: Install Update',
    'Install'
]
const objectCandidates = candidates.map(s => ({ foo: s }));

fz.filter(candidates, 'install');
fz.filter(objectCandidates, 'install', { key: 'foo' });

const prepQuery = fz.prepQuery('install');
fz.score('Application: Install Update', 'install');
fz.score('Application: Install Update', 'install', prepQuery);

fz.match('Application: Install Update', 'install');
fz.match('Application: Install Update', 'install', prepQuery);
开发者ID:AbraaoAlves,项目名称:DefinitelyTyped,代码行数:20,代码来源:fuzzaldrin-plus-tests.ts


注:本文中的fuzzaldrin-plus.score函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。