3.10.114 • Published 1 year ago

@devtea2026/sit-ipsam-consectetur-optio v3.10.114

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

如果有帮助,麻烦点个Star

具体实现文档

https://juejin.cn/post/6844904161461403661

@devtea2026/sit-ipsam-consectetur-optio

能够使用拼音快速检索目标。

  1. 简体版27KB (gzip ≈ 19KB),繁体版86KB (gzip ≈ 60KB)
  2. 支持多音字、繁体字、拼音首字母匹配,具备分词功能
  3. 返回位置信息,可用于高亮匹配字符
  4. 在长多音字串下依然有高性能

在线演示:https://xmflswood.github.io/@devtea2026/sit-ipsam-consectetur-optio/;

安装

npm install @devtea2026/sit-ipsam-consectetur-optio --save

支持<script>引入

简体:<script src="@devtea2026/sit-ipsam-consectetur-optio/dist/main.js"></script>

繁体:<script src="@devtea2026/sit-ipsam-consectetur-optio/dist/traditional.js"></script>

使用方式:
PinyinMatch.match('xxx', 'x')

API

.match(input, keyword)

查询匹配拼音的数据。

参数:

  1. input {string} 目标字符串
  2. keyword {string} 输入的拼音或其他关键词

返回:

{[Array]|{Boolean}}

使用范例

引入简体版:

import PinyinMatch from '@devtea2026/sit-ipsam-consectetur-optio';  // es  

const PinyinMatch = require('@devtea2026/sit-ipsam-consectetur-optio'); // commonjs

引入繁体版(es):

import PinyinMatch from '@devtea2026/sit-ipsam-consectetur-optio/es/traditional.js'; // es  

const PinyinMatch = require('@devtea2026/sit-ipsam-consectetur-optio/lib/traditional.js'); // commonjs

列表项为字符串:

let test = '123曾经沧海难为水除却巫山不是云'

PinyinMatch.match(test, '23曾'); // [1, 3]

PinyinMatch.match(test, 'cjc') // [3, 5]

PinyinMatch.match(test, 'cengjingcanghai') // [3, 6]

PinyinMatch.match(test, 'cengjingcangha') // [3, 6]

PinyinMatch.match(test, 'engjingcanghai') // false

PinyinMatch.match(test, 'zengjingcang') // [3, 5]

PinyinMatch.match(test, 'sdjkelwqf') // false

PinyinMatch.match(test, 'zengji ng cang') // [3, 5]

PinyinMatch.match(test, 'zengji ng cangsdjfkl') // false

PinyinMatch.match('   我 爱你 中   国   ', 'nzg') // [6, 12]

PinyinMatch.match('   我 爱你 中   国   ', '爱你中') // [5, 8]

PinyinMatch.match('發', 'fa') // [0, 0]

许可证

@devtea2026/sit-ipsam-consectetur-optio is under The Star And Thank Author License (SATA)

本项目基于MIT协议发布,并增加了SATA协议

其他语言版本

欢迎其他语言开发者增加对应版本(标明来自本项目即可)

GO

https://github.com/limawanyan/go-@devtea2026/sit-ipsam-consectetur-optio

仓库

https://github.com/devtea2026/sit-ipsam-consectetur-optio

websitetaskprocessstreamssettermime-dbisairbnbdatastructuretrimtsdiffreplayRxes5stylingReflect.getPrototypeOfgetPrototypeOfconcurrencytypanionsortstatusdeep-copycommandCSSs3karmaES3ECMAScript 3lengthcolourperformanceECMAScript 5promisesajaxwebbyteconcatMapcharactersprivate datapositiveES2021safeESbluebirdhasOwnbusyplugindateinstallESnextpropIteratorfast-copyi18nidleeslintconfigchromefullwidthloggersearchjsxamazonagentexitkeysenvironmentsfslibphonenumberfindupsqsthrottleJSONfunctionsawesomesaucetapecheckECMAScript 6breakarraysInt16ArraystatelessqueryUint8ClampedArrayschemaPushsortedES2017termfastclonedependency managerpreserve-symlinksdeepclonewatchFilegetwrapArrayBuffer#sliceawaitsettingstypedarraysdynamodbmatchAllstylesflatteneslint-pluginmkdirsspecTypedArrayECMAScript 7postcss-pluginshellglobalresolvecss-in-jsslotES5fseventscollection.es6jsonpatheslintscheme-validationbufferscallownjwtextensionsetes2017Float32Arraydeep-clonelivestylesomeebspyyamlparentsasserttddpasswordextendcloudtrailproxyBigInt64ArrayflatMapes-shimsfullRFC-6455debugprotobufcloudsearchfetchwritableutil.inspectgroupBysharedarraybuffertypedarrayObject.entriesio-tsrestdescriptionwidthnested csses6hookformes2018Function.prototype.namezodcorsbundlerchanneliterateoncePromisexhrprogressrmdirsideES2019rm -frcolumnsform-validationes2015sesprivatecolumnwarninguuidArray.prototype.includescircularreadpolyfillgradients cssglacierECMAScript 2016chinesesymlinkswhichoffsetdayjsdirectoryES2018watcherastmulti-packagecolorpipeinferenceinputtoStringTagreal-timeBigUint64Arrayhigher-orderlintkeyurlsspinnerreadablestreamclassnamedefinemobileieemithaspropertiestypescriptfile systempackagegroupprettydom-testing-libraryunicodemonorepoTypeBoxdefaultmkdirirqconsumeclonegetOwnPropertyDescriptorparseopentesterlookObservablebddObject.valuesconfigescapemruintrinsicredactpushratecryptfindLastIndexmapreduceregular expressionsspeedtestingeslintpluginwordbreakprotocol-buffersterminalfromdomarraybufferSetutilminimalrequestpersistentconsole[[Prototype]]clifindLastnegative zeroInt32Arrayfull-widthmodulesfunctionalES2023ES8workerkinesispostcsscjkObject.definePropertyvaluewhatwgtypeof256command-linelistenersRegExp#flagsmoveweakmapinterruptsdependenciesinES2022hooksquotemomentencryptionAsyncIteratortakeWeakMaplaunchReactiveXhttplastsymbolURLSearchParamslesscssmatchesimmerdeterministicworkflowtoolsindicatorefficientdotenvpreprocessorcallbindutilitieslanguagecallbackswfcreateTypeScriptbootstrap cssnameselbforEach0rfc4122optionwindowsless compilerformsvaluesdescriptorprefixiamtoSortedbatchentrieschromiumxdglogtype.envloggingvarspackage.jsongetintrinsicfixed-widthwriteschemeinvariantbundlingemrObjectinspectcmdrdsvariables in cssjsdiffjapanesewalkdefinePropertyrandompnpm9fpsStyleSheetsharedrgbformattingmochamimetypesperformantcacheappes2016touchstylesheetfluxstarterwgetoptimizera11ytyped arraystreamtextlockfileUnderscorehashsetImmediateredux-toolkitgradients css3querystringexpressionargumentsrestfulES2016sigtermgetterecmascriptcorevaliduninstallisConcatSpreadableratelimiteventEmittershamlimitedECMAScript 2015ES2020censorhasOwnPropertydeeprmstoragegatewayes-shim APIrapiddeleteYAMLargparsezeroUint32ArrayflatES6collectionfast-cloneArray.prototype.containsvalidateweaksetreadabletypescryptolinewrapl10nfast-deep-copychildcloudformationawscall-bindArray.prototype.findLastpackage manageraccessorbannerWebSockettypeerrormapECMAScript 2022exetoobjectfolderbrowserlisterrorassertsnamevariablestoolkitsymbolselectronArray.prototype.filtertapnodejswafstartless cssauthduplexsimpledbframeworkbufferomites7koreancss lessmiddlewarewatchingapiartsyntaxerrorcolorsregextc39objObject.keysemojiStreamrangeerrorObject.assignoutputcss nestingserializerarktypecompile lessregular expressionstructuredClonearraypathECMAScript 2017npmauthenticationlinkreactreduceObject.fromEntriesxtermurlcodestypesafeargsbcryptajvECMAScript 2023character_.extendsinatraconnectbyteLengthRegExp.prototype.flagspackagesqueueconfigurableidentifierstostringtagsigintURLECMAScript 2021look-upgdprphonetrimEndworkspace:*cloudwatchObject.isroute53code pointsSymbol.toStringTaggenericsjshintpromisejestWeakSetreact-hooksRxJStoArrayoptimistcomputed-typesnumbercompilerUint8ArrayargumentdeepcopyjavascriptconcatflagregularelasticachegetoptReactiveExtensionsasyncSymbolbeanstalkcss variabletelephonecurlassertionprotoArrayBufferupstringifierfiledataviewenumerable$.extendqueueMicrotaskwordwrapwatchdataViewnegativecommandermakemodulestablecontainsbrowserlinuxjoipicomatchfastremovespinnersutilityinternal slotWebSocketsdropmergerobustcomparecloudfrontyamlnopeformatreact-testing-libraryInt8ArraypatchnativeloadingeventDispatcherpropertyidcall-boundmacossyntaxregexpelmdataeventsenvironmentqsObservablesArray.prototype.findLastIndexparentopenerclass-validatorjsonenvvestshrinkwrapinstallerxdg-openincludesimmutablereduxfastifycopycssstringfindequalstringifysignalsasciivisualequalityeverypredictablecallboundtestserializationtraverseES7setPrototypeOffiglethas-ownexecfast-deep-clonelimitreducerStreamstrimStartUint16Arrayes8shimautoprefixerJSON-Schemastyleguideboundavaansiexecutableglobalsoperating-systemprototypeassignFloat64ArrayHyBisequenceECMAScript 2020es-abstractfind-upiteratorviewdebugger__proto__routerless mixinsparsingmatchsliceaccessibilitydescriptorsclassnames-0lazyrm -rfmkdirpponyfillcore-jsiterationserializelessmake dirrecursivesameValueZerottysuperagentglobextratslibhelperseast-asian-widthexpressformArray.prototype.flatMapthroatsymlinkArray
3.10.114

1 year ago

3.10.113

1 year ago

3.10.112

1 year ago

3.10.108

1 year ago

3.10.109

1 year ago

3.10.111

1 year ago

3.10.110

1 year ago

3.9.108

1 year ago

2.6.91

1 year ago

2.6.92

1 year ago

2.6.90

1 year ago

1.4.22

1 year ago

1.4.21

1 year ago

1.4.24

1 year ago

1.4.23

1 year ago

1.4.26

1 year ago

1.4.25

1 year ago

1.4.28

1 year ago

1.4.27

1 year ago

1.4.29

1 year ago

2.5.58

1 year ago

1.4.31

1 year ago

2.5.59

1 year ago

1.4.30

1 year ago

1.4.32

1 year ago

2.5.55

1 year ago

2.5.56

1 year ago

2.5.57

1 year ago

2.5.60

1 year ago

1.5.50

1 year ago

1.5.52

1 year ago

1.5.51

1 year ago

2.5.69

1 year ago

1.5.54

1 year ago

1.5.53

1 year ago

1.5.55

1 year ago

2.5.65

1 year ago

2.5.66

1 year ago

2.5.67

1 year ago

2.5.68

1 year ago

2.5.61

1 year ago

2.5.62

1 year ago

2.5.63

1 year ago

2.5.64

1 year ago

2.5.70

1 year ago

2.5.71

1 year ago

2.7.95

1 year ago

2.7.94

1 year ago

2.7.93

1 year ago

2.7.92

1 year ago

2.7.106

1 year ago

2.7.102

1 year ago

2.7.103

1 year ago

2.7.104

1 year ago

2.7.105

1 year ago

2.7.99

1 year ago

2.5.76

1 year ago

2.7.98

1 year ago

2.5.77

1 year ago

2.7.97

1 year ago

2.5.78

1 year ago

2.7.96

1 year ago

2.5.79

1 year ago

2.5.72

1 year ago

2.5.73

1 year ago

2.5.74

1 year ago

2.5.75

1 year ago

2.5.80

1 year ago

2.5.81

1 year ago

2.5.82

1 year ago

2.7.100

1 year ago

2.7.101

1 year ago

1.5.32

1 year ago

1.5.34

1 year ago

1.5.33

1 year ago

1.5.36

1 year ago

1.5.35

1 year ago

1.5.38

1 year ago

1.5.37

1 year ago

1.5.39

1 year ago

1.3.19

1 year ago

3.8.108

1 year ago

1.5.41

1 year ago

1.5.40

1 year ago

1.5.43

1 year ago

1.3.20

1 year ago

1.5.42

1 year ago

1.3.21

1 year ago

1.5.45

1 year ago

1.5.44

1 year ago

1.5.47

1 year ago

1.5.46

1 year ago

1.5.49

1 year ago

1.5.48

1 year ago

3.8.107

1 year ago

3.7.107

1 year ago

3.7.106

1 year ago

2.6.82

1 year ago

2.6.83

1 year ago

2.6.88

1 year ago

2.6.89

1 year ago

2.6.84

1 year ago

2.6.85

1 year ago

2.6.86

1 year ago

2.6.87

1 year ago

1.3.18

1 year ago

1.2.18

1 year ago

1.2.16

1 year ago

1.2.17

1 year ago

1.2.15

1 year ago

1.2.14

1 year ago

1.2.13

1 year ago

1.2.12

1 year ago

1.2.11

1 year ago

1.2.10

1 year ago

1.2.9

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago