@unicom-cloud/utils 0.1.45 → 0.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.virtual/_rolldown/runtime.js +1 -1
- package/.vite/manifest.json +363 -29
- package/array/index.js +1 -1
- package/assert/index.js +1 -1
- package/case-name/index.js +1 -1
- package/class-name/index.js +1 -1
- package/clipboard-copy/index.js +1 -1
- package/constant/address.js +1 -1
- package/constant/chineseCharacters.js +1 -1
- package/constant/constellations.js +1 -1
- package/constant/domain.js +1 -1
- package/constant/identity.js +1 -1
- package/constant/index.js +1 -1
- package/constant/keyboardCode.js +1 -1
- package/constant/licensePlate.js +1 -1
- package/constant/name.js +1 -1
- package/constant/platform.js +1 -1
- package/constant/protocol.js +1 -1
- package/constant/string.js +1 -1
- package/constant/ui.js +1 -1
- package/content-disposition/index.js +1 -1
- package/cookie/api.js +1 -1
- package/cookie/assign.js +1 -1
- package/cookie/converter.js +1 -1
- package/cookie/index.js +1 -1
- package/date/convertTime.js +1 -1
- package/date/convertToDuration.js +1 -1
- package/date/index.js +1 -1
- package/decimal/decimal.js +1 -1
- package/decimal/index.js +1 -1
- package/dom-helpers/activeElement.js +1 -1
- package/dom-helpers/addClass.js +1 -1
- package/dom-helpers/addEventListener.js +1 -1
- package/dom-helpers/animate.js +1 -1
- package/dom-helpers/animationFrame.js +1 -1
- package/dom-helpers/attribute.js +1 -1
- package/dom-helpers/camelize.js +1 -1
- package/dom-helpers/camelizeStyle.js +1 -1
- package/dom-helpers/canUseDOM.js +1 -1
- package/dom-helpers/childElements.js +1 -1
- package/dom-helpers/childNodes.js +1 -1
- package/dom-helpers/clear.js +1 -1
- package/dom-helpers/closest.js +1 -1
- package/dom-helpers/collectElements.js +1 -1
- package/dom-helpers/collectSiblings.js +1 -1
- package/dom-helpers/contains.js +1 -1
- package/dom-helpers/css.js +1 -1
- package/dom-helpers/filterEventHandler.js +1 -1
- package/dom-helpers/getComputedStyle.js +1 -1
- package/dom-helpers/getElementCoordinates.js +1 -1
- package/dom-helpers/getScrollAccessor.js +1 -1
- package/dom-helpers/hasClass.js +1 -1
- package/dom-helpers/height.js +1 -1
- package/dom-helpers/hyphenate.js +1 -1
- package/dom-helpers/hyphenateStyle.js +1 -1
- package/dom-helpers/index.js +1 -1
- package/dom-helpers/insertAfter.js +1 -1
- package/dom-helpers/isDocument.js +1 -1
- package/dom-helpers/isInput.js +1 -1
- package/dom-helpers/isTransform.js +1 -1
- package/dom-helpers/isVisible.js +1 -1
- package/dom-helpers/isWindow.js +1 -1
- package/dom-helpers/listen.js +1 -1
- package/dom-helpers/matches.js +1 -1
- package/dom-helpers/nextUntil.js +1 -1
- package/dom-helpers/offset.js +1 -1
- package/dom-helpers/offsetParent.js +1 -1
- package/dom-helpers/ownerDocument.js +1 -1
- package/dom-helpers/ownerWindow.js +1 -1
- package/dom-helpers/parents.js +1 -1
- package/dom-helpers/position.js +1 -1
- package/dom-helpers/prepend.js +1 -1
- package/dom-helpers/querySelectorAll.js +1 -1
- package/dom-helpers/reflow.js +1 -1
- package/dom-helpers/remove.js +1 -1
- package/dom-helpers/removeClass.js +1 -1
- package/dom-helpers/removeEventListener.js +1 -1
- package/dom-helpers/scrollLeft.js +1 -1
- package/dom-helpers/scrollParent.js +1 -1
- package/dom-helpers/scrollTo.js +1 -1
- package/dom-helpers/scrollTop.js +1 -1
- package/dom-helpers/scrollbarSize.js +1 -1
- package/dom-helpers/siblings.js +1 -1
- package/dom-helpers/text.js +1 -1
- package/dom-helpers/toggleClass.js +1 -1
- package/dom-helpers/transitionEnd.js +1 -1
- package/dom-helpers/triggerEvent.js +1 -1
- package/dom-helpers/types.js +1 -1
- package/dom-helpers/width.js +1 -1
- package/emitter/index.js +1 -1
- package/emoji/emoji.js +1 -1
- package/emoji/emojis.js +1 -1
- package/emoji/index.js +1 -1
- package/escape/index.js +1 -1
- package/fflate/LICENSE +20 -0
- package/fflate/index.d.ts +1 -0
- package/fflate/index.js +4 -0
- package/fflate/src/index.d.ts +1538 -0
- package/fflate/src/index.js +1424 -0
- package/fflate/src/node-worker.d.ts +2 -0
- package/fflate/src/worker.d.ts +2 -0
- package/fflate/src/worker.js +15 -0
- package/file/fileRead.js +1 -1
- package/file/fileToDataURL.js +1 -1
- package/file/img.js +1 -1
- package/file/index.js +1 -1
- package/file/saveAs.js +1 -1
- package/filesize/index.js +1 -1
- package/filesize/src/constants.js +1 -1
- package/filesize/src/filesize.js +1 -1
- package/filesize/src/helpers.js +1 -1
- package/function/index.js +1 -1
- package/idb/async-iterators.js +1 -1
- package/idb/database-extras.js +1 -1
- package/idb/entry.js +1 -1
- package/idb/index-.js +1 -1
- package/idb/index.js +1 -1
- package/idb/util.js +1 -1
- package/idb/wrap-idb-value.js +1 -1
- package/index.js +1 -1
- package/invariant/index.js +1 -1
- package/is/index.js +1 -1
- package/is/lib/isAscii.js +1 -1
- package/is/lib/isBase64.js +1 -1
- package/is/lib/isChinese.js +1 -1
- package/is/lib/isDataURI.js +1 -1
- package/is/lib/isEmail.js +1 -1
- package/is/lib/isFQDN.js +1 -1
- package/is/lib/isFullWidth.js +1 -1
- package/is/lib/isHSL.js +1 -1
- package/is/lib/isHalfWidth.js +1 -1
- package/is/lib/isHash.js +1 -1
- package/is/lib/isHexColor.js +1 -1
- package/is/lib/isIMEI.js +1 -1
- package/is/lib/isIP.js +1 -1
- package/is/lib/isIPRange.js +1 -1
- package/is/lib/isIdentityCard.js +1 -1
- package/is/lib/isJWT.js +1 -1
- package/is/lib/isMACAddress.js +1 -1
- package/is/lib/isMD5.js +1 -1
- package/is/lib/isMimeType.js +1 -1
- package/is/lib/isMobilePhone.js +1 -1
- package/is/lib/isPort.js +1 -1
- package/is/lib/isRgbColor.js +1 -1
- package/is/lib/isSemVer.js +1 -1
- package/is/lib/isSlug.js +1 -1
- package/is/lib/isStrongPassword.js +1 -1
- package/is/lib/isURL.js +1 -1
- package/is/lib/isUUID.js +1 -1
- package/is/lib/isVariableWidth.js +1 -1
- package/lodash/_DataView.js +1 -1
- package/lodash/_Hash.js +1 -1
- package/lodash/_LazyWrapper.js +1 -1
- package/lodash/_ListCache.js +1 -1
- package/lodash/_LodashWrapper.js +1 -1
- package/lodash/_Map.js +1 -1
- package/lodash/_MapCache.js +1 -1
- package/lodash/_Promise.js +1 -1
- package/lodash/_Set.js +1 -1
- package/lodash/_SetCache.js +1 -1
- package/lodash/_Stack.js +1 -1
- package/lodash/_Symbol.js +1 -1
- package/lodash/_Uint8Array.js +1 -1
- package/lodash/_WeakMap.js +1 -1
- package/lodash/_addMapEntry.js +1 -1
- package/lodash/_addSetEntry.js +1 -1
- package/lodash/_apply.js +1 -1
- package/lodash/_arrayAggregator.js +1 -1
- package/lodash/_arrayEach.js +1 -1
- package/lodash/_arrayEachRight.js +1 -1
- package/lodash/_arrayEvery.js +1 -1
- package/lodash/_arrayFilter.js +1 -1
- package/lodash/_arrayIncludes.js +1 -1
- package/lodash/_arrayIncludesWith.js +1 -1
- package/lodash/_arrayLikeKeys.js +1 -1
- package/lodash/_arrayMap.js +1 -1
- package/lodash/_arrayPush.js +1 -1
- package/lodash/_arrayReduce.js +1 -1
- package/lodash/_arrayReduceRight.js +1 -1
- package/lodash/_arraySample.js +1 -1
- package/lodash/_arraySampleSize.js +1 -1
- package/lodash/_arrayShuffle.js +1 -1
- package/lodash/_arraySome.js +1 -1
- package/lodash/_asciiSize.js +1 -1
- package/lodash/_asciiToArray.js +1 -1
- package/lodash/_asciiWords.js +1 -1
- package/lodash/_assignMergeValue.js +1 -1
- package/lodash/_assignValue.js +1 -1
- package/lodash/_assocIndexOf.js +1 -1
- package/lodash/_baseAggregator.js +1 -1
- package/lodash/_baseAssign.js +1 -1
- package/lodash/_baseAssignIn.js +1 -1
- package/lodash/_baseAssignValue.js +1 -1
- package/lodash/_baseAt.js +1 -1
- package/lodash/_baseClamp.js +1 -1
- package/lodash/_baseClone.js +1 -1
- package/lodash/_baseConforms.js +1 -1
- package/lodash/_baseConformsTo.js +1 -1
- package/lodash/_baseCreate.js +1 -1
- package/lodash/_baseDelay.js +1 -1
- package/lodash/_baseDifference.js +1 -1
- package/lodash/_baseEach.js +1 -1
- package/lodash/_baseEachRight.js +1 -1
- package/lodash/_baseEvery.js +1 -1
- package/lodash/_baseExtremum.js +1 -1
- package/lodash/_baseFill.js +1 -1
- package/lodash/_baseFilter.js +1 -1
- package/lodash/_baseFindIndex.js +1 -1
- package/lodash/_baseFindKey.js +1 -1
- package/lodash/_baseFlatten.js +1 -1
- package/lodash/_baseFor.js +1 -1
- package/lodash/_baseForOwn.js +1 -1
- package/lodash/_baseForOwnRight.js +1 -1
- package/lodash/_baseForRight.js +1 -1
- package/lodash/_baseFunctions.js +1 -1
- package/lodash/_baseGet.js +1 -1
- package/lodash/_baseGetAllKeys.js +1 -1
- package/lodash/_baseGetTag.js +1 -1
- package/lodash/_baseGt.js +1 -1
- package/lodash/_baseHas.js +1 -1
- package/lodash/_baseHasIn.js +1 -1
- package/lodash/_baseInRange.js +1 -1
- package/lodash/_baseIndexOf.js +1 -1
- package/lodash/_baseIndexOfWith.js +1 -1
- package/lodash/_baseIntersection.js +1 -1
- package/lodash/_baseInverter.js +1 -1
- package/lodash/_baseInvoke.js +1 -1
- package/lodash/_baseIsArguments.js +1 -1
- package/lodash/_baseIsArrayBuffer.js +1 -1
- package/lodash/_baseIsDate.js +1 -1
- package/lodash/_baseIsEqual.js +1 -1
- package/lodash/_baseIsEqualDeep.js +1 -1
- package/lodash/_baseIsMap.js +1 -1
- package/lodash/_baseIsMatch.js +1 -1
- package/lodash/_baseIsNaN.js +1 -1
- package/lodash/_baseIsNative.js +1 -1
- package/lodash/_baseIsRegExp.js +1 -1
- package/lodash/_baseIsSet.js +1 -1
- package/lodash/_baseIsTypedArray.js +1 -1
- package/lodash/_baseIteratee.js +1 -1
- package/lodash/_baseKeys.js +1 -1
- package/lodash/_baseKeysIn.js +1 -1
- package/lodash/_baseLodash.js +1 -1
- package/lodash/_baseLt.js +1 -1
- package/lodash/_baseMap.js +1 -1
- package/lodash/_baseMatches.js +1 -1
- package/lodash/_baseMatchesProperty.js +1 -1
- package/lodash/_baseMean.js +1 -1
- package/lodash/_baseMerge.js +1 -1
- package/lodash/_baseMergeDeep.js +1 -1
- package/lodash/_baseNth.js +1 -1
- package/lodash/_baseOrderBy.js +1 -1
- package/lodash/_basePick.js +1 -1
- package/lodash/_basePickBy.js +1 -1
- package/lodash/_baseProperty.js +1 -1
- package/lodash/_basePropertyDeep.js +1 -1
- package/lodash/_basePropertyOf.js +1 -1
- package/lodash/_basePullAll.js +1 -1
- package/lodash/_basePullAt.js +1 -1
- package/lodash/_baseRandom.js +1 -1
- package/lodash/_baseRange.js +1 -1
- package/lodash/_baseReduce.js +1 -1
- package/lodash/_baseRepeat.js +1 -1
- package/lodash/_baseRest.js +1 -1
- package/lodash/_baseSample.js +1 -1
- package/lodash/_baseSampleSize.js +1 -1
- package/lodash/_baseSet.js +1 -1
- package/lodash/_baseSetData.js +1 -1
- package/lodash/_baseSetToString.js +1 -1
- package/lodash/_baseShuffle.js +1 -1
- package/lodash/_baseSlice.js +1 -1
- package/lodash/_baseSome.js +1 -1
- package/lodash/_baseSortBy.js +1 -1
- package/lodash/_baseSortedIndex.js +1 -1
- package/lodash/_baseSortedIndexBy.js +1 -1
- package/lodash/_baseSortedUniq.js +1 -1
- package/lodash/_baseSum.js +1 -1
- package/lodash/_baseTimes.js +1 -1
- package/lodash/_baseToNumber.js +1 -1
- package/lodash/_baseToPairs.js +1 -1
- package/lodash/_baseToString.js +1 -1
- package/lodash/_baseTrim.js +1 -1
- package/lodash/_baseUnary.js +1 -1
- package/lodash/_baseUniq.js +1 -1
- package/lodash/_baseUnset.js +1 -1
- package/lodash/_baseUpdate.js +1 -1
- package/lodash/_baseValues.js +1 -1
- package/lodash/_baseWhile.js +1 -1
- package/lodash/_baseWrapperValue.js +1 -1
- package/lodash/_baseXor.js +1 -1
- package/lodash/_baseZipObject.js +1 -1
- package/lodash/_cacheHas.js +1 -1
- package/lodash/_castArrayLikeObject.js +1 -1
- package/lodash/_castFunction.js +1 -1
- package/lodash/_castPath.js +1 -1
- package/lodash/_castRest.js +1 -1
- package/lodash/_castSlice.js +1 -1
- package/lodash/_charsEndIndex.js +1 -1
- package/lodash/_charsStartIndex.js +1 -1
- package/lodash/_cloneArrayBuffer.js +1 -1
- package/lodash/_cloneBuffer.js +1 -1
- package/lodash/_cloneDataView.js +1 -1
- package/lodash/_cloneMap.js +1 -1
- package/lodash/_cloneRegExp.js +1 -1
- package/lodash/_cloneSet.js +1 -1
- package/lodash/_cloneSymbol.js +1 -1
- package/lodash/_cloneTypedArray.js +1 -1
- package/lodash/_compareAscending.js +1 -1
- package/lodash/_compareMultiple.js +1 -1
- package/lodash/_composeArgs.js +1 -1
- package/lodash/_composeArgsRight.js +1 -1
- package/lodash/_copyArray.js +1 -1
- package/lodash/_copyObject.js +1 -1
- package/lodash/_copySymbols.js +1 -1
- package/lodash/_copySymbolsIn.js +1 -1
- package/lodash/_coreJsData.js +1 -1
- package/lodash/_countHolders.js +1 -1
- package/lodash/_createAggregator.js +1 -1
- package/lodash/_createAssigner.js +1 -1
- package/lodash/_createBaseEach.js +1 -1
- package/lodash/_createBaseFor.js +1 -1
- package/lodash/_createBind.js +1 -1
- package/lodash/_createCaseFirst.js +1 -1
- package/lodash/_createCompounder.js +1 -1
- package/lodash/_createCtor.js +1 -1
- package/lodash/_createCurry.js +1 -1
- package/lodash/_createFind.js +1 -1
- package/lodash/_createFlow.js +1 -1
- package/lodash/_createHybrid.js +1 -1
- package/lodash/_createInverter.js +1 -1
- package/lodash/_createMathOperation.js +1 -1
- package/lodash/_createOver.js +1 -1
- package/lodash/_createPadding.js +1 -1
- package/lodash/_createPartial.js +1 -1
- package/lodash/_createRange.js +1 -1
- package/lodash/_createRecurry.js +1 -1
- package/lodash/_createRelationalOperation.js +1 -1
- package/lodash/_createRound.js +1 -1
- package/lodash/_createSet.js +1 -1
- package/lodash/_createToPairs.js +1 -1
- package/lodash/_createWrap.js +1 -1
- package/lodash/_customDefaultsAssignIn.js +1 -1
- package/lodash/_customDefaultsMerge.js +1 -1
- package/lodash/_customOmitClone.js +1 -1
- package/lodash/_deburrLetter.js +1 -1
- package/lodash/_defineProperty.js +1 -1
- package/lodash/_equalArrays.js +1 -1
- package/lodash/_equalByTag.js +1 -1
- package/lodash/_equalObjects.js +1 -1
- package/lodash/_escapeHtmlChar.js +1 -1
- package/lodash/_escapeStringChar.js +1 -1
- package/lodash/_flatRest.js +1 -1
- package/lodash/_freeGlobal.js +1 -1
- package/lodash/_getAllKeys.js +1 -1
- package/lodash/_getAllKeysIn.js +1 -1
- package/lodash/_getData.js +1 -1
- package/lodash/_getFuncName.js +1 -1
- package/lodash/_getHolder.js +1 -1
- package/lodash/_getMapData.js +1 -1
- package/lodash/_getMatchData.js +1 -1
- package/lodash/_getNative.js +1 -1
- package/lodash/_getPrototype.js +1 -1
- package/lodash/_getRawTag.js +1 -1
- package/lodash/_getSymbols.js +1 -1
- package/lodash/_getSymbolsIn.js +1 -1
- package/lodash/_getTag.js +1 -1
- package/lodash/_getValue.js +1 -1
- package/lodash/_getView.js +1 -1
- package/lodash/_getWrapDetails.js +1 -1
- package/lodash/_hasPath.js +1 -1
- package/lodash/_hasUnicode.js +1 -1
- package/lodash/_hasUnicodeWord.js +1 -1
- package/lodash/_hashClear.js +1 -1
- package/lodash/_hashDelete.js +1 -1
- package/lodash/_hashGet.js +1 -1
- package/lodash/_hashHas.js +1 -1
- package/lodash/_hashSet.js +1 -1
- package/lodash/_initCloneArray.js +1 -1
- package/lodash/_initCloneByTag.js +1 -1
- package/lodash/_initCloneObject.js +1 -1
- package/lodash/_insertWrapDetails.js +1 -1
- package/lodash/_isFlattenable.js +1 -1
- package/lodash/_isIndex.js +1 -1
- package/lodash/_isIterateeCall.js +1 -1
- package/lodash/_isKey.js +1 -1
- package/lodash/_isKeyable.js +1 -1
- package/lodash/_isLaziable.js +1 -1
- package/lodash/_isMaskable.js +1 -1
- package/lodash/_isMasked.js +1 -1
- package/lodash/_isPrototype.js +1 -1
- package/lodash/_isStrictComparable.js +1 -1
- package/lodash/_iteratorToArray.js +1 -1
- package/lodash/_lazyClone.js +1 -1
- package/lodash/_lazyReverse.js +1 -1
- package/lodash/_lazyValue.js +1 -1
- package/lodash/_listCacheClear.js +1 -1
- package/lodash/_listCacheDelete.js +1 -1
- package/lodash/_listCacheGet.js +1 -1
- package/lodash/_listCacheHas.js +1 -1
- package/lodash/_listCacheSet.js +1 -1
- package/lodash/_mapCacheClear.js +1 -1
- package/lodash/_mapCacheDelete.js +1 -1
- package/lodash/_mapCacheGet.js +1 -1
- package/lodash/_mapCacheHas.js +1 -1
- package/lodash/_mapCacheSet.js +1 -1
- package/lodash/_mapToArray.js +1 -1
- package/lodash/_matchesStrictComparable.js +1 -1
- package/lodash/_memoizeCapped.js +1 -1
- package/lodash/_mergeData.js +1 -1
- package/lodash/_metaMap.js +1 -1
- package/lodash/_nativeCreate.js +1 -1
- package/lodash/_nativeKeys.js +1 -1
- package/lodash/_nativeKeysIn.js +1 -1
- package/lodash/_nodeUtil.js +1 -1
- package/lodash/_objectToString.js +1 -1
- package/lodash/_overArg.js +1 -1
- package/lodash/_overRest.js +1 -1
- package/lodash/_parent.js +1 -1
- package/lodash/_reEscape.js +1 -1
- package/lodash/_reEvaluate.js +1 -1
- package/lodash/_reInterpolate.js +1 -1
- package/lodash/_realNames.js +1 -1
- package/lodash/_reorder.js +1 -1
- package/lodash/_replaceHolders.js +1 -1
- package/lodash/_root.js +1 -1
- package/lodash/_safeGet.js +1 -1
- package/lodash/_setCacheAdd.js +1 -1
- package/lodash/_setCacheHas.js +1 -1
- package/lodash/_setData.js +1 -1
- package/lodash/_setToArray.js +1 -1
- package/lodash/_setToPairs.js +1 -1
- package/lodash/_setToString.js +1 -1
- package/lodash/_setWrapToString.js +1 -1
- package/lodash/_shortOut.js +1 -1
- package/lodash/_shuffleSelf.js +1 -1
- package/lodash/_stackClear.js +1 -1
- package/lodash/_stackDelete.js +1 -1
- package/lodash/_stackGet.js +1 -1
- package/lodash/_stackHas.js +1 -1
- package/lodash/_stackSet.js +1 -1
- package/lodash/_strictIndexOf.js +1 -1
- package/lodash/_strictLastIndexOf.js +1 -1
- package/lodash/_stringSize.js +1 -1
- package/lodash/_stringToArray.js +1 -1
- package/lodash/_stringToPath.js +1 -1
- package/lodash/_toKey.js +1 -1
- package/lodash/_toSource.js +1 -1
- package/lodash/_trimmedEndIndex.js +1 -1
- package/lodash/_unescapeHtmlChar.js +1 -1
- package/lodash/_unicodeSize.js +1 -1
- package/lodash/_unicodeToArray.js +1 -1
- package/lodash/_unicodeWords.js +1 -1
- package/lodash/_updateWrapDetails.js +1 -1
- package/lodash/_wrapperClone.js +1 -1
- package/lodash/add.js +1 -1
- package/lodash/after.js +1 -1
- package/lodash/array.default.js +1 -1
- package/lodash/array.js +1 -1
- package/lodash/ary.js +1 -1
- package/lodash/assign.js +1 -1
- package/lodash/assignIn.js +1 -1
- package/lodash/assignInWith.js +1 -1
- package/lodash/assignWith.js +1 -1
- package/lodash/at.js +1 -1
- package/lodash/attempt.js +1 -1
- package/lodash/before.js +1 -1
- package/lodash/bind.js +1 -1
- package/lodash/bindAll.js +1 -1
- package/lodash/bindKey.js +1 -1
- package/lodash/camelCase.js +1 -1
- package/lodash/capitalize.js +1 -1
- package/lodash/castArray.js +1 -1
- package/lodash/ceil.js +1 -1
- package/lodash/chain.js +1 -1
- package/lodash/chunk.js +1 -1
- package/lodash/clamp.js +1 -1
- package/lodash/clone.js +1 -1
- package/lodash/cloneDeep.js +1 -1
- package/lodash/cloneDeepWith.js +1 -1
- package/lodash/cloneWith.js +1 -1
- package/lodash/collection.default.js +1 -1
- package/lodash/collection.js +1 -1
- package/lodash/commit.js +1 -1
- package/lodash/compact.js +1 -1
- package/lodash/concat.js +1 -1
- package/lodash/cond.js +1 -1
- package/lodash/conforms.js +1 -1
- package/lodash/conformsTo.js +1 -1
- package/lodash/constant.js +1 -1
- package/lodash/countBy.js +1 -1
- package/lodash/create.js +1 -1
- package/lodash/curry.js +1 -1
- package/lodash/curryRight.js +1 -1
- package/lodash/date.default.js +1 -1
- package/lodash/date.js +1 -1
- package/lodash/debounce.js +1 -1
- package/lodash/deburr.js +1 -1
- package/lodash/defaultTo.js +1 -1
- package/lodash/defaults.js +1 -1
- package/lodash/defaultsDeep.js +1 -1
- package/lodash/defer.js +1 -1
- package/lodash/delay.js +1 -1
- package/lodash/difference.js +1 -1
- package/lodash/differenceBy.js +1 -1
- package/lodash/differenceWith.js +1 -1
- package/lodash/divide.js +1 -1
- package/lodash/drop.js +1 -1
- package/lodash/dropRight.js +1 -1
- package/lodash/dropRightWhile.js +1 -1
- package/lodash/dropWhile.js +1 -1
- package/lodash/each.js +1 -1
- package/lodash/eachRight.js +1 -1
- package/lodash/endsWith.js +1 -1
- package/lodash/entries.js +1 -1
- package/lodash/entriesIn.js +1 -1
- package/lodash/eq.js +1 -1
- package/lodash/escape.js +1 -1
- package/lodash/escapeRegExp.js +1 -1
- package/lodash/every.js +1 -1
- package/lodash/extend.js +1 -1
- package/lodash/extendWith.js +1 -1
- package/lodash/fill.js +1 -1
- package/lodash/filter.js +1 -1
- package/lodash/find.js +1 -1
- package/lodash/findIndex.js +1 -1
- package/lodash/findKey.js +1 -1
- package/lodash/findLast.js +1 -1
- package/lodash/findLastIndex.js +1 -1
- package/lodash/findLastKey.js +1 -1
- package/lodash/first.js +1 -1
- package/lodash/flatMap.js +1 -1
- package/lodash/flatMapDeep.js +1 -1
- package/lodash/flatMapDepth.js +1 -1
- package/lodash/flatten.js +1 -1
- package/lodash/flattenDeep.js +1 -1
- package/lodash/flattenDepth.js +1 -1
- package/lodash/flip.js +1 -1
- package/lodash/floor.js +1 -1
- package/lodash/flow.js +1 -1
- package/lodash/flowRight.js +1 -1
- package/lodash/forEach.js +1 -1
- package/lodash/forEachRight.js +1 -1
- package/lodash/forIn.js +1 -1
- package/lodash/forInRight.js +1 -1
- package/lodash/forOwn.js +1 -1
- package/lodash/forOwnRight.js +1 -1
- package/lodash/fromPairs.js +1 -1
- package/lodash/function.default.js +1 -1
- package/lodash/function.js +1 -1
- package/lodash/functions.js +1 -1
- package/lodash/functionsIn.js +1 -1
- package/lodash/get.js +1 -1
- package/lodash/groupBy.js +1 -1
- package/lodash/gt.js +1 -1
- package/lodash/gte.js +1 -1
- package/lodash/has.js +1 -1
- package/lodash/hasIn.js +1 -1
- package/lodash/head.js +1 -1
- package/lodash/identity.js +1 -1
- package/lodash/inRange.js +1 -1
- package/lodash/includes.js +1 -1
- package/lodash/index.js +1 -1
- package/lodash/indexOf.js +1 -1
- package/lodash/initial.js +1 -1
- package/lodash/intersection.js +1 -1
- package/lodash/intersectionBy.js +1 -1
- package/lodash/intersectionWith.js +1 -1
- package/lodash/invert.js +1 -1
- package/lodash/invertBy.js +1 -1
- package/lodash/invoke.js +1 -1
- package/lodash/invokeMap.js +1 -1
- package/lodash/isArguments.js +1 -1
- package/lodash/isArray.js +1 -1
- package/lodash/isArrayBuffer.js +1 -1
- package/lodash/isArrayLike.js +1 -1
- package/lodash/isArrayLikeObject.js +1 -1
- package/lodash/isBoolean.js +1 -1
- package/lodash/isBuffer.js +1 -1
- package/lodash/isDate.js +1 -1
- package/lodash/isElement.js +1 -1
- package/lodash/isEmpty.js +1 -1
- package/lodash/isEqual.js +1 -1
- package/lodash/isEqualWith.js +1 -1
- package/lodash/isError.js +1 -1
- package/lodash/isFinite.js +1 -1
- package/lodash/isFunction.js +1 -1
- package/lodash/isInteger.js +1 -1
- package/lodash/isLength.js +1 -1
- package/lodash/isMap.js +1 -1
- package/lodash/isMatch.js +1 -1
- package/lodash/isMatchWith.js +1 -1
- package/lodash/isNaN.js +1 -1
- package/lodash/isNative.js +1 -1
- package/lodash/isNil.js +1 -1
- package/lodash/isNull.js +1 -1
- package/lodash/isNumber.js +1 -1
- package/lodash/isObject.js +1 -1
- package/lodash/isObjectLike.js +1 -1
- package/lodash/isPlainObject.js +1 -1
- package/lodash/isPromise.js +1 -1
- package/lodash/isRegExp.js +1 -1
- package/lodash/isSafeInteger.js +1 -1
- package/lodash/isSet.js +1 -1
- package/lodash/isString.js +1 -1
- package/lodash/isSymbol.js +1 -1
- package/lodash/isTypedArray.js +1 -1
- package/lodash/isUndefined.js +1 -1
- package/lodash/isWeakMap.js +1 -1
- package/lodash/isWeakSet.js +1 -1
- package/lodash/iteratee.js +1 -1
- package/lodash/join.js +1 -1
- package/lodash/kebabCase.js +1 -1
- package/lodash/keyBy.js +1 -1
- package/lodash/keys.js +1 -1
- package/lodash/keysIn.js +1 -1
- package/lodash/lang.default.js +1 -1
- package/lodash/lang.js +1 -1
- package/lodash/last.js +1 -1
- package/lodash/lastIndexOf.js +1 -1
- package/lodash/lodash.default.js +1 -1
- package/lodash/lodash.js +1 -1
- package/lodash/lowerCase.js +1 -1
- package/lodash/lowerFirst.js +1 -1
- package/lodash/lt.js +1 -1
- package/lodash/lte.js +1 -1
- package/lodash/map.js +1 -1
- package/lodash/mapKeys.js +1 -1
- package/lodash/mapValues.js +1 -1
- package/lodash/matches.js +1 -1
- package/lodash/matchesProperty.js +1 -1
- package/lodash/math.default.js +1 -1
- package/lodash/math.js +1 -1
- package/lodash/max.js +1 -1
- package/lodash/maxBy.js +1 -1
- package/lodash/mean.js +1 -1
- package/lodash/meanBy.js +1 -1
- package/lodash/memoize.js +1 -1
- package/lodash/merge.js +1 -1
- package/lodash/mergeWith.js +1 -1
- package/lodash/method.js +1 -1
- package/lodash/methodOf.js +1 -1
- package/lodash/min.js +1 -1
- package/lodash/minBy.js +1 -1
- package/lodash/mixin.js +1 -1
- package/lodash/multiply.js +1 -1
- package/lodash/negate.js +1 -1
- package/lodash/next.js +1 -1
- package/lodash/noop.js +1 -1
- package/lodash/now.js +1 -1
- package/lodash/nth.js +1 -1
- package/lodash/nthArg.js +1 -1
- package/lodash/number.default.js +1 -1
- package/lodash/number.js +1 -1
- package/lodash/object.default.js +1 -1
- package/lodash/object.js +1 -1
- package/lodash/omit.js +1 -1
- package/lodash/omitBy.js +1 -1
- package/lodash/once.js +1 -1
- package/lodash/orderBy.js +1 -1
- package/lodash/over.js +1 -1
- package/lodash/overArgs.js +1 -1
- package/lodash/overEvery.js +1 -1
- package/lodash/overSome.js +1 -1
- package/lodash/pad.js +1 -1
- package/lodash/padEnd.js +1 -1
- package/lodash/padStart.js +1 -1
- package/lodash/parseInt.js +1 -1
- package/lodash/partial.js +1 -1
- package/lodash/partialRight.js +1 -1
- package/lodash/partition.js +1 -1
- package/lodash/pick.js +1 -1
- package/lodash/pickBy.js +1 -1
- package/lodash/plant.js +1 -1
- package/lodash/property.js +1 -1
- package/lodash/propertyOf.js +1 -1
- package/lodash/pull.js +1 -1
- package/lodash/pullAll.js +1 -1
- package/lodash/pullAllBy.js +1 -1
- package/lodash/pullAllWith.js +1 -1
- package/lodash/pullAt.js +1 -1
- package/lodash/random.js +1 -1
- package/lodash/range.js +1 -1
- package/lodash/rangeRight.js +1 -1
- package/lodash/rearg.js +1 -1
- package/lodash/reduce.js +1 -1
- package/lodash/reduceRight.js +1 -1
- package/lodash/reject.js +1 -1
- package/lodash/remove.js +1 -1
- package/lodash/repeat.js +1 -1
- package/lodash/replace.js +1 -1
- package/lodash/rest.js +1 -1
- package/lodash/result.js +1 -1
- package/lodash/reverse.js +1 -1
- package/lodash/round.js +1 -1
- package/lodash/sample.js +1 -1
- package/lodash/sampleSize.js +1 -1
- package/lodash/seq.default.js +1 -1
- package/lodash/seq.js +1 -1
- package/lodash/set.js +1 -1
- package/lodash/setWith.js +1 -1
- package/lodash/shuffle.js +1 -1
- package/lodash/size.js +1 -1
- package/lodash/slice.js +1 -1
- package/lodash/snakeCase.js +1 -1
- package/lodash/some.js +1 -1
- package/lodash/sortBy.js +1 -1
- package/lodash/sortedIndex.js +1 -1
- package/lodash/sortedIndexBy.js +1 -1
- package/lodash/sortedIndexOf.js +1 -1
- package/lodash/sortedLastIndex.js +1 -1
- package/lodash/sortedLastIndexBy.js +1 -1
- package/lodash/sortedLastIndexOf.js +1 -1
- package/lodash/sortedUniq.js +1 -1
- package/lodash/sortedUniqBy.js +1 -1
- package/lodash/split.js +1 -1
- package/lodash/spread.js +1 -1
- package/lodash/startCase.js +1 -1
- package/lodash/startsWith.js +1 -1
- package/lodash/string.default.js +1 -1
- package/lodash/string.js +1 -1
- package/lodash/stubArray.js +1 -1
- package/lodash/stubFalse.js +1 -1
- package/lodash/stubObject.js +1 -1
- package/lodash/stubString.js +1 -1
- package/lodash/stubTrue.js +1 -1
- package/lodash/subtract.js +1 -1
- package/lodash/sum.js +1 -1
- package/lodash/sumBy.js +1 -1
- package/lodash/tail.js +1 -1
- package/lodash/take.js +1 -1
- package/lodash/takeRight.js +1 -1
- package/lodash/takeRightWhile.js +1 -1
- package/lodash/takeWhile.js +1 -1
- package/lodash/tap.js +1 -1
- package/lodash/template.js +1 -1
- package/lodash/templateSettings.js +1 -1
- package/lodash/throttle.js +1 -1
- package/lodash/thru.js +1 -1
- package/lodash/times.js +1 -1
- package/lodash/toArray.js +1 -1
- package/lodash/toFinite.js +1 -1
- package/lodash/toInteger.js +1 -1
- package/lodash/toIterator.js +1 -1
- package/lodash/toJSON.js +1 -1
- package/lodash/toLength.js +1 -1
- package/lodash/toLower.js +1 -1
- package/lodash/toNumber.js +1 -1
- package/lodash/toPairs.js +1 -1
- package/lodash/toPairsIn.js +1 -1
- package/lodash/toPath.js +1 -1
- package/lodash/toPlainObject.js +1 -1
- package/lodash/toSafeInteger.js +1 -1
- package/lodash/toString.js +1 -1
- package/lodash/toUpper.js +1 -1
- package/lodash/transform.js +1 -1
- package/lodash/trim.js +1 -1
- package/lodash/trimEnd.js +1 -1
- package/lodash/trimStart.js +1 -1
- package/lodash/truncate.js +1 -1
- package/lodash/unary.js +1 -1
- package/lodash/unescape.js +1 -1
- package/lodash/union.js +1 -1
- package/lodash/unionBy.js +1 -1
- package/lodash/unionWith.js +1 -1
- package/lodash/uniq.js +1 -1
- package/lodash/uniqBy.js +1 -1
- package/lodash/uniqWith.js +1 -1
- package/lodash/uniqueId.js +1 -1
- package/lodash/unset.js +1 -1
- package/lodash/unzip.js +1 -1
- package/lodash/unzipWith.js +1 -1
- package/lodash/update.js +1 -1
- package/lodash/updateWith.js +1 -1
- package/lodash/upperCase.js +1 -1
- package/lodash/upperFirst.js +1 -1
- package/lodash/util.default.js +1 -1
- package/lodash/util.js +1 -1
- package/lodash/value.js +1 -1
- package/lodash/valueOf.js +1 -1
- package/lodash/values.js +1 -1
- package/lodash/valuesIn.js +1 -1
- package/lodash/without.js +1 -1
- package/lodash/words.js +1 -1
- package/lodash/wrap.js +1 -1
- package/lodash/wrapperAt.js +1 -1
- package/lodash/wrapperChain.js +1 -1
- package/lodash/wrapperLodash.js +1 -1
- package/lodash/wrapperReverse.js +1 -1
- package/lodash/wrapperValue.js +1 -1
- package/lodash/xor.js +1 -1
- package/lodash/xorBy.js +1 -1
- package/lodash/xorWith.js +1 -1
- package/lodash/zip.js +1 -1
- package/lodash/zipObject.js +1 -1
- package/lodash/zipObjectDeep.js +1 -1
- package/lodash/zipWith.js +1 -1
- package/math/index.js +1 -1
- package/md5/index.js +1 -1
- package/mock/MockWebSocket.js +1 -1
- package/mock/MockXMLHttpRequest.js +1 -1
- package/mock/index.js +1 -1
- package/normalize-wheel/ExecutionEnvironment.js +1 -1
- package/normalize-wheel/UserAgent_DEPRECATED.js +1 -1
- package/normalize-wheel/index.js +1 -1
- package/normalize-wheel/isEventSupported.js +1 -1
- package/number-to-chinese/index.js +1 -1
- package/nzh/cn.js +1 -1
- package/nzh/hk.js +1 -1
- package/nzh/index.js +1 -1
- package/nzh/nzh.js +1 -1
- package/nzh/src/autoGet.js +1 -1
- package/nzh/src/index.js +1 -1
- package/nzh/src/langs/cn_b.js +1 -1
- package/nzh/src/langs/cn_s.js +1 -1
- package/nzh/src/langs/hk_b.js +1 -1
- package/nzh/src/langs/hk_s.js +1 -1
- package/nzh/src/utils.js +1 -1
- package/object/index.js +1 -1
- package/package.json +1 -1
- package/pinyin/LICENSE +13 -12
- package/pinyin/index.d.ts +2 -1
- package/pinyin/index.js +14 -3
- package/pinyin/lib/common/constant.d.ts +16 -0
- package/pinyin/lib/common/constant.js +16 -0
- package/pinyin/lib/common/segmentit/AC.d.ts +18 -0
- package/pinyin/lib/common/segmentit/AC.js +95 -0
- package/pinyin/lib/common/segmentit/TrieNode.d.ts +30 -0
- package/pinyin/lib/common/segmentit/TrieNode.js +12 -0
- package/pinyin/lib/common/segmentit/index.d.ts +3 -0
- package/pinyin/lib/common/segmentit/index.js +21 -0
- package/pinyin/lib/common/segmentit/max-probability.d.ts +2 -0
- package/pinyin/lib/common/segmentit/max-probability.js +41 -0
- package/pinyin/lib/common/segmentit/min-tokenization.d.ts +2 -0
- package/pinyin/lib/common/segmentit/min-tokenization.js +35 -0
- package/pinyin/lib/common/segmentit/reverse-max-match.d.ts +2 -0
- package/pinyin/lib/common/segmentit/reverse-max-match.js +17 -0
- package/pinyin/lib/common/type.d.ts +69 -0
- package/pinyin/lib/common/utils.d.ts +10 -0
- package/pinyin/lib/common/utils.js +39 -0
- package/pinyin/lib/core/convert/index.d.ts +29 -0
- package/pinyin/lib/core/convert/index.js +128 -0
- package/pinyin/lib/core/custom/index.d.ts +25 -0
- package/pinyin/lib/core/custom/index.js +39 -0
- package/pinyin/lib/core/dict/index.d.ts +10 -0
- package/pinyin/lib/core/dict/index.js +48 -0
- package/pinyin/lib/core/html/index.d.ts +44 -0
- package/pinyin/lib/core/html/index.js +36 -0
- package/pinyin/lib/core/match/index.d.ts +35 -0
- package/pinyin/lib/core/match/index.js +103 -0
- package/pinyin/lib/core/pinyin/handle.d.ts +81 -0
- package/pinyin/lib/core/pinyin/handle.js +140 -0
- package/pinyin/lib/core/pinyin/index.d.ts +117 -0
- package/pinyin/lib/core/pinyin/index.js +32 -0
- package/pinyin/lib/core/pinyin/middlewares.d.ts +25 -0
- package/pinyin/lib/core/pinyin/middlewares.js +110 -0
- package/pinyin/lib/core/polyphonic/index.d.ts +87 -0
- package/pinyin/lib/core/polyphonic/index.js +60 -0
- package/pinyin/lib/core/segment/index.d.ts +87 -0
- package/pinyin/lib/core/segment/index.js +33 -0
- package/pinyin/lib/core/segment/middlewares.d.ts +55 -0
- package/pinyin/lib/core/segment/middlewares.js +67 -0
- package/pinyin/lib/core/traditional/index.d.ts +2 -0
- package/pinyin/lib/core/traditional/index.js +15 -0
- package/pinyin/lib/data/dict1-pinyin.d.ts +3 -0
- package/pinyin/lib/data/dict1.d.ts +3 -0
- package/pinyin/lib/data/dict1.js +13920 -0
- package/pinyin/lib/data/dict2.d.ts +6 -0
- package/pinyin/lib/data/dict2.js +2167 -0
- package/pinyin/lib/data/dict3.d.ts +6 -0
- package/pinyin/lib/data/dict3.js +338 -0
- package/pinyin/lib/data/dict4.d.ts +6 -0
- package/pinyin/lib/data/dict4.js +1608 -0
- package/pinyin/lib/data/dict5.d.ts +6 -0
- package/pinyin/lib/data/dict5.js +30 -0
- package/pinyin/lib/data/special.d.ts +45 -0
- package/pinyin/lib/data/special.js +180 -0
- package/pinyin/lib/data/surname.d.ts +6 -0
- package/pinyin/lib/data/surname.js +508 -0
- package/pinyin/lib/index.d.ts +10 -0
- package/pinyin/lib/index.js +13 -0
- package/query-string/base.js +1 -1
- package/query-string/index.js +1 -1
- package/query-string/splitOnFirst.js +1 -1
- package/random/address.js +1 -1
- package/random/constellation.js +1 -1
- package/random/image.js +1 -1
- package/random/index.js +1 -1
- package/random/licensePlate.js +1 -1
- package/random/name.js +1 -1
- package/random/number.js +1 -1
- package/random/text.js +1 -1
- package/random/time.js +1 -1
- package/random/web.js +1 -1
- package/sanitize-url/index.js +1 -1
- package/screenfull/index.js +1 -1
- package/sleep/index.js +1 -1
- package/snapdom/index.browser.js +1 -1
- package/snapdom/index.js +1 -1
- package/snapdom/src/api/preCache.js +1 -1
- package/snapdom/src/api/snapdom.js +1 -1
- package/snapdom/src/core/cache.js +1 -1
- package/snapdom/src/core/capture.js +1 -1
- package/snapdom/src/core/clone.js +1 -1
- package/snapdom/src/core/context.js +1 -1
- package/snapdom/src/core/plugins.js +1 -1
- package/snapdom/src/core/prepare.js +1 -1
- package/snapdom/src/exporters/download.js +1 -1
- package/snapdom/src/exporters/toBlob.js +1 -1
- package/snapdom/src/exporters/toCanvas.js +1 -1
- package/snapdom/src/exporters/toImg.js +1 -1
- package/snapdom/src/index.browser.js +1 -1
- package/snapdom/src/index.js +1 -1
- package/snapdom/src/modules/CSSVar.js +1 -1
- package/snapdom/src/modules/background.js +1 -1
- package/snapdom/src/modules/changeCSS.js +1 -1
- package/snapdom/src/modules/counter.js +1 -1
- package/snapdom/src/modules/fonts.js +1 -1
- package/snapdom/src/modules/iconFonts.js +1 -1
- package/snapdom/src/modules/images.js +1 -1
- package/snapdom/src/modules/lineClamp.js +1 -1
- package/snapdom/src/modules/pictureResolver.js +1 -1
- package/snapdom/src/modules/pseudo.js +1 -1
- package/snapdom/src/modules/rasterize.js +1 -1
- package/snapdom/src/modules/snapFetch.js +1 -1
- package/snapdom/src/modules/styles.js +1 -1
- package/snapdom/src/modules/svgDefs.js +1 -1
- package/snapdom/src/utils/browser.js +1 -1
- package/snapdom/src/utils/capture.helpers.js +1 -1
- package/snapdom/src/utils/clone.helpers.js +1 -1
- package/snapdom/src/utils/css.js +1 -1
- package/snapdom/src/utils/debug.js +1 -1
- package/snapdom/src/utils/helpers.js +1 -1
- package/snapdom/src/utils/image.js +1 -1
- package/snapdom/src/utils/index.js +1 -1
- package/snapdom/src/utils/prepare.helpers.js +1 -1
- package/snapdom/src/utils/transforms.helpers.js +1 -1
- package/string/chars.js +1 -1
- package/string/index.js +1 -1
- package/tinycolor/conversion.js +1 -1
- package/tinycolor/css-color-names.js +1 -1
- package/tinycolor/format-input.js +1 -1
- package/tinycolor/from-ratio.js +1 -1
- package/tinycolor/index.js +1 -1
- package/tinycolor/interfaces.js +1 -1
- package/tinycolor/public_api.js +1 -1
- package/tinycolor/random.js +1 -1
- package/tinycolor/readability.js +1 -1
- package/tinycolor/to-ms-filter.js +1 -1
- package/tinycolor/umd_api.js +1 -1
- package/tinycolor/utils.js +1 -1
- package/tree/index.js +1 -1
- package/tree/searchTree.js +1 -1
- package/tween/easing.js +1 -1
- package/tween/index.js +1 -1
- package/tween/tween.js +1 -1
- package/ui-color/compareColorByRange.js +1 -1
- package/ui-color/index.js +1 -1
- package/url-toolkit/index.js +1 -1
- package/validate/index.js +1 -1
- package/validate/interface.js +1 -1
- package/validate/locale/en-US.js +1 -1
- package/validate/locale/index.js +1 -1
- package/validate/locale/zh-CN.js +1 -1
- package/validate/rules/array.js +1 -1
- package/validate/rules/base.js +1 -1
- package/validate/rules/boolean.js +1 -1
- package/validate/rules/custom.js +1 -1
- package/validate/rules/number.js +1 -1
- package/validate/rules/object.js +1 -1
- package/validate/rules/string.js +1 -1
- package/validate/rules/type.js +1 -1
- package/version/index.js +1 -1
- package/xlsx/crc32.js +1 -1
- package/xlsx/index.js +1 -1
- package/xlsx/xlsx.js +1 -1
- package/pinyin/core.d.ts +0 -3
- package/pinyin/core.js +0 -136
- package/pinyin/simplified.d.ts +0 -4
- package/pinyin/simplified.js +0 -8
- package/pinyin/simplified_dict.d.ts +0 -408
- package/pinyin/simplified_dict.js +0 -411
- package/pinyin/traditional.d.ts +0 -4
- package/pinyin/traditional.js +0 -8
- package/pinyin/traditional_dict.d.ts +0 -401
- package/pinyin/traditional_dict.js +0 -404
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FastDictFactory } from '../../common/utils';
|
|
2
|
+
type CustomHandleType = 'add' | 'replace';
|
|
3
|
+
type CustomDictType = 'pinyin' | 'multiple' | 'polyphonic';
|
|
4
|
+
interface CustomPinyinOptions {
|
|
5
|
+
/**
|
|
6
|
+
* @description: multiple 对于 customPinyin 补充词汇的处理
|
|
7
|
+
*/
|
|
8
|
+
multiple?: CustomHandleType;
|
|
9
|
+
/**
|
|
10
|
+
* @description: polyphonic 对于 customPinyin 补充词汇的处理
|
|
11
|
+
*/
|
|
12
|
+
polyphonic?: CustomHandleType;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @description: 用户自定义拼音
|
|
16
|
+
* @param {{ [key: string]: string }} config 用户自定义的拼音映射(支持汉字、词语、句子的映射),若匹配到该映射,优先将汉字转换为该映射
|
|
17
|
+
* @param {CustomPinyinOptions} options multiple/polyphonic 对于 customPinyin 补充词汇的处理
|
|
18
|
+
*/
|
|
19
|
+
export declare function customPinyin(config?: {
|
|
20
|
+
[word: string]: string;
|
|
21
|
+
}, options?: CustomPinyinOptions): void;
|
|
22
|
+
export declare const getCustomMultpileDict: () => FastDictFactory;
|
|
23
|
+
export declare const getCustomPolyphonicDict: () => FastDictFactory;
|
|
24
|
+
export declare function clearCustomDict(dict: CustomDictType | CustomDictType[]): void;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-21 17:01:48 星期四 山东省济南市 */
|
|
2
|
+
import { Priority as e, Probability as t } from "../../common/constant.js";
|
|
3
|
+
import { FastDictFactory as n, splitString as r, stringLength as i } from "../../common/utils.js";
|
|
4
|
+
import { acTree as a } from "../../common/segmentit/index.js";
|
|
5
|
+
import o from "../../data/dict1.js";
|
|
6
|
+
//#region utils/pinyin/lib/core/custom/index.ts
|
|
7
|
+
var s = {}, c = new n(), l = new n(), u = Symbol("custom");
|
|
8
|
+
function d(n = {}, r) {
|
|
9
|
+
Object.keys(n).sort((e, t) => i(t) - i(e)).forEach((e) => {
|
|
10
|
+
s[e] = n[e];
|
|
11
|
+
});
|
|
12
|
+
let o = Object.keys(s).map((n) => ({
|
|
13
|
+
zh: n,
|
|
14
|
+
pinyin: s[n],
|
|
15
|
+
probability: t.Custom + i(n),
|
|
16
|
+
length: i(n),
|
|
17
|
+
priority: e.Custom,
|
|
18
|
+
dict: u
|
|
19
|
+
}));
|
|
20
|
+
a.build(o), r?.multiple && f(n, c, r.multiple), r?.polyphonic && f(n, l, r.polyphonic);
|
|
21
|
+
}
|
|
22
|
+
function f(e, t, n) {
|
|
23
|
+
for (let i in e) {
|
|
24
|
+
let a = e[i];
|
|
25
|
+
r(i).forEach((e, r) => {
|
|
26
|
+
let i = a.split(" ")[r] || "";
|
|
27
|
+
n === "replace" || n === "add" && !t.get(e) && !o.get(e) ? t.set(e, i) : (t.set(e, t.get(e) || o.get(e)), t.get(e).split(" ").includes(i) || t.set(e, `${t.get(e)} ${i}`.trim()));
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
var p = () => c, m = () => l;
|
|
32
|
+
function h(e) {
|
|
33
|
+
(e === "pinyin" || e.indexOf("pinyin") !== -1) && (Object.keys(s).forEach(function(e) {
|
|
34
|
+
delete s[e];
|
|
35
|
+
}), a.removeDict(u)), (e === "multiple" || e.indexOf("multiple") !== -1) && c.clear(), (e === "polyphonic" || e.indexOf("polyphonic") !== -1) && l.clear();
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { h as clearCustomDict, d as customPinyin, p as getCustomMultpileDict, m as getCustomPolyphonicDict };
|
|
39
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type DICT = {
|
|
2
|
+
[key: string]: string | [string] | [string, number] | [string, number, string];
|
|
3
|
+
};
|
|
4
|
+
type DictOptions = {
|
|
5
|
+
name?: string;
|
|
6
|
+
dict1?: 'add' | 'replace' | 'ignore';
|
|
7
|
+
};
|
|
8
|
+
export declare function addDict(dict: DICT | {}, options?: string | DictOptions): void;
|
|
9
|
+
export declare function removeDict(dictName?: string): void;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-21 17:01:48 星期四 山东省济南市 */
|
|
2
|
+
import { Priority as e, Probability as t } from "../../common/constant.js";
|
|
3
|
+
import { stringLength as n } from "../../common/utils.js";
|
|
4
|
+
import { acTree as r } from "../../common/segmentit/index.js";
|
|
5
|
+
import i from "../../data/dict1.js";
|
|
6
|
+
//#region utils/pinyin/lib/core/dict/index.ts
|
|
7
|
+
var a = Symbol("default"), o = /* @__PURE__ */ new Map();
|
|
8
|
+
function s(i, o) {
|
|
9
|
+
let s = [], c = (typeof o == "object" ? o.name : o) || a, u = o?.dict1 || "add";
|
|
10
|
+
for (let r in i) {
|
|
11
|
+
let a = i[r], o = Array.isArray(a) ? a[0] : a, d = n(r);
|
|
12
|
+
d === 1 && l(c, r, o, u), Array.isArray(a) ? s.push({
|
|
13
|
+
zh: r,
|
|
14
|
+
pinyin: o,
|
|
15
|
+
probability: typeof a[1] == "number" ? a[1] : t.DICT * d * d,
|
|
16
|
+
length: d,
|
|
17
|
+
priority: e.Normal,
|
|
18
|
+
dict: c,
|
|
19
|
+
pos: typeof a[2] == "string" ? a[2] : ""
|
|
20
|
+
}) : s.push({
|
|
21
|
+
zh: r,
|
|
22
|
+
pinyin: o,
|
|
23
|
+
probability: t.DICT * d * d,
|
|
24
|
+
length: d,
|
|
25
|
+
priority: e.Normal,
|
|
26
|
+
dict: c
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
r.build(s);
|
|
30
|
+
}
|
|
31
|
+
function c(e) {
|
|
32
|
+
r.removeDict(e || a), u(e || a);
|
|
33
|
+
}
|
|
34
|
+
function l(e, t, n, r = "add") {
|
|
35
|
+
o.get(e) || o.set(e, {});
|
|
36
|
+
let a = o.get(e);
|
|
37
|
+
if (a[t] || (a[t] = i.get(t)), r === "add") {
|
|
38
|
+
let e = i.get(t);
|
|
39
|
+
e && !e.split(" ").includes(n) ? i.set(t, `${e} ${n}`) : i.get(t) || i.set(t, n);
|
|
40
|
+
} else r === "replace" && i.set(t, n);
|
|
41
|
+
}
|
|
42
|
+
function u(e) {
|
|
43
|
+
let t = o.get(e) || {};
|
|
44
|
+
for (let e in t) i.set(e, t[e]), delete t[e];
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { s as addDict, c as removeDict };
|
|
48
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { BasicOptions } from '../pinyin';
|
|
2
|
+
type HtmlBaseOptions = Pick<BasicOptions, 'toneType' | 'v' | 'toneSandhi' | 'segmentit' | 'traditional' | 'surname' | 'mode'>;
|
|
3
|
+
interface HtmlOptions extends HtmlBaseOptions {
|
|
4
|
+
/**
|
|
5
|
+
* @description html 结果中每个字+拼音外层 span 标签的类名。默认为 py-result-item
|
|
6
|
+
*/
|
|
7
|
+
resultClass?: string;
|
|
8
|
+
/**
|
|
9
|
+
* @description html 结果中拼音 rt 标签的类名。默认为 py-pinyin-item
|
|
10
|
+
*/
|
|
11
|
+
pinyinClass?: string;
|
|
12
|
+
/**
|
|
13
|
+
* @description html 结果中汉字 span 标签的类名。默认为 py-chinese-item
|
|
14
|
+
*/
|
|
15
|
+
chineseClass?: string;
|
|
16
|
+
/**
|
|
17
|
+
* @description 是否用 span 标签包装非汉字字符的结果。默认为 false。建议输入的文本为纯文本时可以设置为 true;输入文本本身为 html 富文本字符串设置为 false
|
|
18
|
+
*/
|
|
19
|
+
wrapNonChinese?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* @description html 非汉字字符外层 span 标签的类名,仅当 wrapNonChinese 为 true 时生效。默认为 py-non-chinese-item
|
|
22
|
+
*/
|
|
23
|
+
nonChineseClass?: string;
|
|
24
|
+
/**
|
|
25
|
+
* @description 对于指定的汉字及字符,在 result 上额外补充的拼音
|
|
26
|
+
*/
|
|
27
|
+
customClassMap?: {
|
|
28
|
+
[classname: string]: string[];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @description 是否保留 <rp>(</rp> 标签,默认为保留
|
|
32
|
+
* @value true:保留 <rp>(</rp>
|
|
33
|
+
* @value false:移除 <rp>(</rp>
|
|
34
|
+
*/
|
|
35
|
+
rp?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @description: 获取带拼音汉字的 html 字符串
|
|
39
|
+
* @param {string} text 要转换的字符串
|
|
40
|
+
* @param {HtmlOptions=} options html 中标签类名相关配置
|
|
41
|
+
* @return {string} 带汉字的拼音字符串
|
|
42
|
+
*/
|
|
43
|
+
export declare const html: (text: string, options?: HtmlOptions) => string;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-21 17:01:48 星期四 山东省济南市 */
|
|
2
|
+
import { pinyin as e } from "../pinyin/index.js";
|
|
3
|
+
//#region utils/pinyin/lib/core/html/index.ts
|
|
4
|
+
var t = {
|
|
5
|
+
resultClass: "py-result-item",
|
|
6
|
+
chineseClass: "py-chinese-item",
|
|
7
|
+
pinyinClass: "py-pinyin-item",
|
|
8
|
+
nonChineseClass: "py-non-chinese-item",
|
|
9
|
+
wrapNonChinese: !1,
|
|
10
|
+
toneType: "symbol",
|
|
11
|
+
customClassMap: {},
|
|
12
|
+
toneSandhi: !0,
|
|
13
|
+
rp: !0,
|
|
14
|
+
v: !1,
|
|
15
|
+
traditional: !1
|
|
16
|
+
}, n = (n, r) => {
|
|
17
|
+
let i = {
|
|
18
|
+
...t,
|
|
19
|
+
...r || {}
|
|
20
|
+
};
|
|
21
|
+
return e(n, {
|
|
22
|
+
type: "all",
|
|
23
|
+
...i
|
|
24
|
+
}).map((e) => {
|
|
25
|
+
let n = "";
|
|
26
|
+
for (let t in i.customClassMap) i.customClassMap[t].includes(e.origin) && (n += ` ${t}`);
|
|
27
|
+
if (e.isZh) {
|
|
28
|
+
let r = i.resultClass || t.resultClass, a = i.chineseClass || t.chineseClass, o = i.pinyinClass || t.pinyinClass;
|
|
29
|
+
return `<span class="${r}${n}"><ruby><span class="${a}">${e.origin}</span>${i.rp ? "<rp>(</rp>" : ""}<rt class="${o}">${e.pinyin}</rt>${i.rp ? "<rp>)</rp>" : ""}</ruby></span>`;
|
|
30
|
+
} else if (i.wrapNonChinese) return `<span class="${i.nonChineseClass || t.nonChineseClass}${n}">${e.origin}</span>`;
|
|
31
|
+
else return e.origin;
|
|
32
|
+
}).join("");
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { n as html };
|
|
36
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
interface MatchOptions {
|
|
2
|
+
/**
|
|
3
|
+
* @description 每个汉字和拼音需要遵从的匹配精度
|
|
4
|
+
*/
|
|
5
|
+
precision?: 'first' | 'start' | 'every' | 'any';
|
|
6
|
+
/**
|
|
7
|
+
* @description 匹配的汉字下标是否为连续的才算匹配成功
|
|
8
|
+
*/
|
|
9
|
+
continuous?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* @description 匹配时对于空格的处理
|
|
12
|
+
*/
|
|
13
|
+
space?: 'ignore' | 'preserve';
|
|
14
|
+
/**
|
|
15
|
+
* @description 最后一个字的匹配精度
|
|
16
|
+
*/
|
|
17
|
+
lastPrecision?: 'first' | 'start' | 'every' | 'any';
|
|
18
|
+
/**
|
|
19
|
+
* @description 是否大小写不敏感
|
|
20
|
+
*/
|
|
21
|
+
insensitive?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* @description 是否将 ü 替换成 v 进行匹配
|
|
24
|
+
*/
|
|
25
|
+
v?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @description: 检测汉语字符串和拼音是否匹配
|
|
29
|
+
* @param {string} text 汉语字符串
|
|
30
|
+
* @param {string} pinyin 拼音,支持各种缩写形式
|
|
31
|
+
* @param {MatchOptions=} options 配置项
|
|
32
|
+
* @return {Array | null} 若匹配成功,返回 text 中匹配成功的下标数组;若匹配失败,返回 null
|
|
33
|
+
*/
|
|
34
|
+
export declare const match: (text: string, pinyin: string, options?: MatchOptions) => number[] | null;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-21 17:01:48 星期四 山东省济南市 */
|
|
2
|
+
import { splitString as e } from "../../common/utils.js";
|
|
3
|
+
import { pinyin as t } from "../pinyin/index.js";
|
|
4
|
+
//#region utils/pinyin/lib/core/match/index.ts
|
|
5
|
+
var n = {
|
|
6
|
+
precision: "first",
|
|
7
|
+
continuous: !1,
|
|
8
|
+
space: "ignore",
|
|
9
|
+
lastPrecision: "start",
|
|
10
|
+
insensitive: !0,
|
|
11
|
+
v: !1
|
|
12
|
+
}, r = 6, i = (e, t, r) => {
|
|
13
|
+
r?.precision === "any" && (r.lastPrecision = "any"), r?.v && (t = t.replace(/ü/g, "v"));
|
|
14
|
+
let i = {
|
|
15
|
+
...n,
|
|
16
|
+
...r || {}
|
|
17
|
+
};
|
|
18
|
+
i.insensitive !== !1 && (e = e.toLowerCase(), t = t.toLowerCase()), i.space === "ignore" && (t = t.replace(/\s/g, ""));
|
|
19
|
+
let a = r?.precision === "any" ? o(e, t, i) : s(e, t, i);
|
|
20
|
+
return c(e, a);
|
|
21
|
+
}, a = (e, t) => {
|
|
22
|
+
let n = 0;
|
|
23
|
+
for (let r = 0; r < e.length; r++) e[r] === t[n] && n++;
|
|
24
|
+
return n;
|
|
25
|
+
}, o = (n, r, i) => {
|
|
26
|
+
let o = [], s = e(n), c = i.space === "ignore";
|
|
27
|
+
for (let e = 0; e < s.length; e++) {
|
|
28
|
+
if (c && s[e] === " ") {
|
|
29
|
+
o.push(e);
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (s[e] === r[0]) {
|
|
33
|
+
r = r.slice(1), o.push(e);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
let n = t(s[e], {
|
|
37
|
+
toneType: "none",
|
|
38
|
+
multiple: !0,
|
|
39
|
+
type: "array",
|
|
40
|
+
v: i.v
|
|
41
|
+
}), l = 0;
|
|
42
|
+
if (n.forEach((e) => {
|
|
43
|
+
let t = a(e, r);
|
|
44
|
+
t > l && (l = t);
|
|
45
|
+
}), l && (r = r.slice(l), o.push(e)), !r) break;
|
|
46
|
+
}
|
|
47
|
+
if (r) return null;
|
|
48
|
+
if (i.continuous) {
|
|
49
|
+
let e = o;
|
|
50
|
+
if (o.some((t, n) => n > 0 && t !== e[n - 1] + 1)) return null;
|
|
51
|
+
}
|
|
52
|
+
return i.space === "ignore" && (o = o.filter((e) => s[e] !== " ")), o.length ? o : null;
|
|
53
|
+
}, s = (n, i, a) => {
|
|
54
|
+
let o = e(n), s = Array(o.length + 1);
|
|
55
|
+
for (let e = 0; e < s.length; e++) s[e] = Array(i.length + 1), s[e][0] = [];
|
|
56
|
+
for (let e = 0; e < s[0].length; e++) s[0][e] = [];
|
|
57
|
+
for (let e = 1; e < s.length; e++) {
|
|
58
|
+
if (!a.continuous || a.space == "ignore" && o[e - 1] === " ") for (let t = 1; t <= i.length; t++) s[e][t - 1] = s[e - 1][t - 1];
|
|
59
|
+
for (let n = 1; n <= i.length; n++) if (!s[e - 1][n - 1]) continue;
|
|
60
|
+
else if (n !== 1 && !s[e - 1][n - 1].length) continue;
|
|
61
|
+
else {
|
|
62
|
+
let c = t(o[e - 1], {
|
|
63
|
+
type: "array",
|
|
64
|
+
toneType: "none",
|
|
65
|
+
multiple: !0,
|
|
66
|
+
v: a.v
|
|
67
|
+
});
|
|
68
|
+
if (o[e - 1] === i[n - 1]) {
|
|
69
|
+
let t = [...s[e - 1][n - 1], e - 1];
|
|
70
|
+
if ((!s[e][n] || t.length > s[e][n].length) && (s[e][n] = t), n === i.length) return s[e][n];
|
|
71
|
+
}
|
|
72
|
+
if (i.length - n <= r && c.some((e) => a.lastPrecision === "any" ? e.includes(i.slice(n - 1, i.length)) : a.lastPrecision === "start" ? e.startsWith(i.slice(n - 1, i.length)) : a.lastPrecision === "first" ? e[0] === i.slice(n - 1, i.length) : a.lastPrecision === "every" ? e === i.slice(n - 1, i.length) : !1)) return [...s[e - 1][n - 1], e - 1];
|
|
73
|
+
let l = a.precision;
|
|
74
|
+
if (l === "start" && c.forEach((t) => {
|
|
75
|
+
let r = n, a = [...s[e - 1][n - 1], e - 1];
|
|
76
|
+
for (; r <= i.length && t.startsWith(i.slice(n - 1, r));) (!s[e][r] || a.length > s[e][r].length) && (s[e][r] = a), r++;
|
|
77
|
+
}), l === "first" && c.some((e) => e[0] === i[n - 1])) {
|
|
78
|
+
let t = [...s[e - 1][n - 1], e - 1];
|
|
79
|
+
(!s[e][n] || t.length > s[e][n].length) && (s[e][n] = t);
|
|
80
|
+
}
|
|
81
|
+
let u = c.find((e) => e === i.slice(n - 1, n - 1 + e.length));
|
|
82
|
+
if (u) {
|
|
83
|
+
let t = [...s[e - 1][n - 1], e - 1], r = n - 1 + u.length;
|
|
84
|
+
(!s[e][r] || t.length > s[e][r].length) && (s[e][r] = t);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
};
|
|
90
|
+
function c(t, n) {
|
|
91
|
+
if (!n) return null;
|
|
92
|
+
let r = [], i = 0, a = e(t), o = 0;
|
|
93
|
+
for (let e = 0; e < n.length; e++) {
|
|
94
|
+
let t = n[e];
|
|
95
|
+
for (; o <= t;) a[o].length === 2 && i++, o++;
|
|
96
|
+
let s = t + i;
|
|
97
|
+
a[t].length === 2 ? r.push(s - 1, s) : r.push(s);
|
|
98
|
+
}
|
|
99
|
+
return r;
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
export { i as match };
|
|
103
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { MatchPattern } from '../../common/segmentit/TrieNode';
|
|
2
|
+
import { TokenizationAlgorithm } from '../../common/segmentit/TrieNode';
|
|
3
|
+
import type { InitialPattern, SingleWordResult, SurnameMode } from '../../common/type';
|
|
4
|
+
/**
|
|
5
|
+
* @description: 获取单个字符的拼音
|
|
6
|
+
* @param {string} char
|
|
7
|
+
* @return {string}
|
|
8
|
+
*/
|
|
9
|
+
type GetSingleWordPinyin = (char: string) => string;
|
|
10
|
+
export declare const getSingleWordPinyin: GetSingleWordPinyin;
|
|
11
|
+
export declare const getPinyin: (word: string, list: SingleWordResult[], surname: SurnameMode, segmentit: TokenizationAlgorithm, traditional?: boolean) => {
|
|
12
|
+
list: SingleWordResult[];
|
|
13
|
+
matches: MatchPattern[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* @description: 将带音调符号拼音转换为不带音调拼音
|
|
17
|
+
* @param {string} pinyin
|
|
18
|
+
* @return {string}
|
|
19
|
+
*/
|
|
20
|
+
type GetPinyinWithoutTone = (pinyin: string) => string;
|
|
21
|
+
declare const getPinyinWithoutTone: GetPinyinWithoutTone;
|
|
22
|
+
/**
|
|
23
|
+
* @description: 获取单字符的多音拼音
|
|
24
|
+
* @param {string} char
|
|
25
|
+
* @return {WordResult[]}
|
|
26
|
+
*/
|
|
27
|
+
type GetAllPinyin = (char: string, surname?: SurnameMode) => string[];
|
|
28
|
+
export declare const getAllPinyin: GetAllPinyin;
|
|
29
|
+
/**
|
|
30
|
+
* @description: 获取单字符的多音拼音
|
|
31
|
+
* @param {string} word
|
|
32
|
+
* @return {WordResult[]}
|
|
33
|
+
*/
|
|
34
|
+
type GetMultiplePinyin = (word: string, surname?: SurnameMode) => SingleWordResult[];
|
|
35
|
+
declare const getMultiplePinyin: GetMultiplePinyin;
|
|
36
|
+
/**
|
|
37
|
+
* @description: 获取拼音的声母和韵母
|
|
38
|
+
* @param {string} pinyin
|
|
39
|
+
* @param {InitialPattern} initialPattern
|
|
40
|
+
* @return {*}
|
|
41
|
+
*/
|
|
42
|
+
type GetInitialAndFinal = (pinyin: string, initialPattern?: InitialPattern) => {
|
|
43
|
+
final: string;
|
|
44
|
+
initial: string;
|
|
45
|
+
};
|
|
46
|
+
declare const getInitialAndFinal: GetInitialAndFinal;
|
|
47
|
+
/**
|
|
48
|
+
* @description: 获取韵母的韵头、韵腹和韵尾
|
|
49
|
+
* @param {string} pinyin
|
|
50
|
+
* @return {*}
|
|
51
|
+
*/
|
|
52
|
+
type GetFinalParts = (pinyin: string) => {
|
|
53
|
+
head: string;
|
|
54
|
+
body: string;
|
|
55
|
+
tail: string;
|
|
56
|
+
};
|
|
57
|
+
declare const getFinalParts: GetFinalParts;
|
|
58
|
+
/**
|
|
59
|
+
* @description: 将带音调符号拼音转换为带音调数字
|
|
60
|
+
* @param {string} pinyin
|
|
61
|
+
* @return {string}
|
|
62
|
+
*/
|
|
63
|
+
type GetNumOfTone = (pinyin: string) => string;
|
|
64
|
+
declare const getNumOfTone: GetNumOfTone;
|
|
65
|
+
/**
|
|
66
|
+
* @description: 将带音调符号拼音转换为带音调数字拼音
|
|
67
|
+
* @param {string} pinyin
|
|
68
|
+
* @param {string} originPinyin
|
|
69
|
+
* @return {string}
|
|
70
|
+
*/
|
|
71
|
+
type GetPinyinWithNum = (pinyin: string, originPinyin: string) => string;
|
|
72
|
+
declare const getPinyinWithNum: GetPinyinWithNum;
|
|
73
|
+
/**
|
|
74
|
+
* @description: 获取拼音的首字母
|
|
75
|
+
* @param {string} pinyin
|
|
76
|
+
* @return {string}
|
|
77
|
+
*/
|
|
78
|
+
type GetFirstLetter = (pinyin: string, isZh: boolean) => string;
|
|
79
|
+
declare const getFirstLetter: GetFirstLetter;
|
|
80
|
+
export declare function processToneSandhi(cur: string, pre: string, next: string): string | undefined;
|
|
81
|
+
export { getFinalParts, getFirstLetter, getInitialAndFinal, getMultiplePinyin, getNumOfTone, getPinyinWithNum, getPinyinWithoutTone, };
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-21 17:01:48 星期四 山东省济南市 */
|
|
2
|
+
import { Priority as e } from "../../common/constant.js";
|
|
3
|
+
import { splitString as t } from "../../common/utils.js";
|
|
4
|
+
import { InitialList as n, SpecialFinalList as r, SpecialFinalMap as i, SpecialInitialList as a, doubleFinalList as o, toneSandhiIgnoreSuffix as s, toneSandhiList as c, toneSandhiMap as l } from "../../data/special.js";
|
|
5
|
+
import u from "../../data/surname.js";
|
|
6
|
+
import { acTree as d } from "../../common/segmentit/index.js";
|
|
7
|
+
import f from "../../data/dict1.js";
|
|
8
|
+
import { getCustomMultpileDict as p } from "../custom/index.js";
|
|
9
|
+
import { getTraditionalDict as m } from "../traditional/index.js";
|
|
10
|
+
//#region utils/pinyin/lib/core/pinyin/handle.ts
|
|
11
|
+
var h = (e) => {
|
|
12
|
+
let t = f.get(e);
|
|
13
|
+
return t ? t.split(" ")[0] : e;
|
|
14
|
+
}, g = (e) => {
|
|
15
|
+
let t = [], n = m();
|
|
16
|
+
for (let r = 0; r < e.length; r++) {
|
|
17
|
+
let i = e[r], a = i.charCodeAt(0);
|
|
18
|
+
n[a] ? t[r] = n[a] : t[r] = i;
|
|
19
|
+
}
|
|
20
|
+
return t.join("");
|
|
21
|
+
}, _ = (n, r, i, a, o) => {
|
|
22
|
+
let s = o ? g(n) : n, c = d.search(s, i, a), l = 0, u = t(n);
|
|
23
|
+
for (let t = 0; t < u.length;) {
|
|
24
|
+
let n = c[l];
|
|
25
|
+
if (n && t === n.index) {
|
|
26
|
+
if (n.length === 1 && n.priority <= e.Normal) {
|
|
27
|
+
let e = u[t];
|
|
28
|
+
n.zh = e;
|
|
29
|
+
let i = "";
|
|
30
|
+
i = k(e, u[t - 1], u[t + 1]), r[t] = {
|
|
31
|
+
origin: e,
|
|
32
|
+
result: i,
|
|
33
|
+
isZh: i !== e,
|
|
34
|
+
originPinyin: i
|
|
35
|
+
}, t++, l++;
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
let i = n.pinyin.split(" "), a = 0;
|
|
39
|
+
o && (n.zh = u.slice(n.index, n.index + n.length).join(""));
|
|
40
|
+
for (let e = 0; e < n.length; e++) r[t + e] = {
|
|
41
|
+
origin: u[e + n.index],
|
|
42
|
+
result: i[a] || "",
|
|
43
|
+
isZh: !0,
|
|
44
|
+
originPinyin: i[a] || ""
|
|
45
|
+
}, a++;
|
|
46
|
+
t += n.length, l++;
|
|
47
|
+
} else {
|
|
48
|
+
let e = u[t], n = "";
|
|
49
|
+
n = k(e, u[t - 1], u[t + 1]), r[t] = {
|
|
50
|
+
origin: e,
|
|
51
|
+
result: n,
|
|
52
|
+
isZh: n !== e,
|
|
53
|
+
originPinyin: n
|
|
54
|
+
}, t++;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
list: r,
|
|
59
|
+
matches: c
|
|
60
|
+
};
|
|
61
|
+
}, v = (e) => e.replace(/(ā|á|ǎ|à)/g, "a").replace(/(ō|ó|ǒ|ò)/g, "o").replace(/(ē|é|ě|è)/g, "e").replace(/(ī|í|ǐ|ì)/g, "i").replace(/(ū|ú|ǔ|ù)/g, "u").replace(/(ǖ|ǘ|ǚ|ǜ)/g, "ü").replace(/(n̄|ń|ň|ǹ)/g, "n").replace(/(m̄|ḿ|m̌|m̀)/g, "m").replace(/(ê̄|ế|ê̌|ề)/g, "ê"), y = (e, t = "off") => {
|
|
62
|
+
let n = p(), r = f.get(e) ? f.get(e).split(" ") : [];
|
|
63
|
+
if (n.get(e)) r = n.get(e).split(" ");
|
|
64
|
+
else if (t !== "off") {
|
|
65
|
+
let t = u[e];
|
|
66
|
+
t && (r = [t].concat(r.filter((e) => e !== t)));
|
|
67
|
+
}
|
|
68
|
+
return r;
|
|
69
|
+
}, b = (e, t = "off") => {
|
|
70
|
+
let n = y(e, t);
|
|
71
|
+
return n.length > 0 ? n.map((t) => ({
|
|
72
|
+
origin: e,
|
|
73
|
+
result: t,
|
|
74
|
+
isZh: !0,
|
|
75
|
+
originPinyin: t
|
|
76
|
+
})) : [{
|
|
77
|
+
origin: e,
|
|
78
|
+
result: e,
|
|
79
|
+
isZh: !1,
|
|
80
|
+
originPinyin: e
|
|
81
|
+
}];
|
|
82
|
+
}, x = (e, t) => {
|
|
83
|
+
let o = e.split(" "), s = [], c = [];
|
|
84
|
+
for (let e of o) for (let t of n) if (e.startsWith(t)) {
|
|
85
|
+
let n = e.slice(t.length);
|
|
86
|
+
a.indexOf(t) !== -1 && r.indexOf(n) !== -1 && (n = i[n]), s.push(t), c.push(n);
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
return t === "standard" && s.forEach((e, t) => {
|
|
90
|
+
(e === "y" || e === "w") && (s[t] = "");
|
|
91
|
+
}), {
|
|
92
|
+
final: c.join(" "),
|
|
93
|
+
initial: s.join(" ")
|
|
94
|
+
};
|
|
95
|
+
}, S = (e) => {
|
|
96
|
+
let { final: t } = x(e), n = "", r = "", i = "";
|
|
97
|
+
return o.indexOf(v(t)) === -1 ? (r = t[0] || "", i = t.slice(1) || "") : (n = t[0], r = t[1], i = t.slice(2)), {
|
|
98
|
+
head: n,
|
|
99
|
+
body: r,
|
|
100
|
+
tail: i
|
|
101
|
+
};
|
|
102
|
+
}, C = (e) => {
|
|
103
|
+
let t = /(ā|ō|ē|ī|ū|ǖ|n̄|m̄|ê̄)/, n = /(á|ó|é|í|ú|ǘ|ń|ḿ|ế)/, r = /(ǎ|ǒ|ě|ǐ|ǔ|ǚ|ň|m̌|ê̌)/, i = /(à|ò|è|ì|ù|ǜ|ǹ|m̀|ề)/, a = /(a|o|e|i|u|ü|ê)/, o = /(n|m)$/, s = [];
|
|
104
|
+
return e.split(" ").forEach((e) => {
|
|
105
|
+
t.test(e) ? s.push("1") : n.test(e) ? s.push("2") : r.test(e) ? s.push("3") : i.test(e) ? s.push("4") : a.test(e) || o.test(e) ? s.push("0") : s.push("");
|
|
106
|
+
}), s.join(" ");
|
|
107
|
+
}, w = (e, t) => {
|
|
108
|
+
let n = v(e).split(" "), r = C(t).split(" "), i = [];
|
|
109
|
+
return n.forEach((e, t) => {
|
|
110
|
+
i.push(`${e}${r[t]}`);
|
|
111
|
+
}), i.join(" ");
|
|
112
|
+
}, T = (e, t) => {
|
|
113
|
+
let n = [];
|
|
114
|
+
return e.split(" ").forEach((e) => {
|
|
115
|
+
n.push(t ? e[0] : e);
|
|
116
|
+
}), n.join(" ");
|
|
117
|
+
};
|
|
118
|
+
function E(e, t, n) {
|
|
119
|
+
if (c.indexOf(e) === -1) return h(e);
|
|
120
|
+
if (t === n && t && h(t) !== t) return v(h(e));
|
|
121
|
+
if (n && !s[e].includes(n)) {
|
|
122
|
+
let t = h(n);
|
|
123
|
+
if (t !== n) {
|
|
124
|
+
let n = C(t), r = l[e];
|
|
125
|
+
for (let e in r) if (r[e].indexOf(Number(n)) !== -1) return e;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function D(e, t) {
|
|
130
|
+
if (e === "了" && (!t || !f.get(t))) return "liǎo";
|
|
131
|
+
}
|
|
132
|
+
function O(e, t) {
|
|
133
|
+
if (e === "々") return !t || !f.get(t) ? "tóng" : f.get(t).split(" ")[0];
|
|
134
|
+
}
|
|
135
|
+
function k(e, t, n) {
|
|
136
|
+
return O(e, t) || D(e, t) || E(e, t, n) || h(e);
|
|
137
|
+
}
|
|
138
|
+
//#endregion
|
|
139
|
+
export { y as getAllPinyin, S as getFinalParts, T as getFirstLetter, x as getInitialAndFinal, b as getMultiplePinyin, C as getNumOfTone, _ as getPinyin, w as getPinyinWithNum, v as getPinyinWithoutTone };
|
|
140
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { TokenizationAlgorithm } from '../../common/segmentit/TrieNode';
|
|
2
|
+
import type { CommonOptions, PinyinMode, SurnameMode } from '../../common/type';
|
|
3
|
+
export interface BasicOptions extends CommonOptions {
|
|
4
|
+
/**
|
|
5
|
+
* @description 是否返回单个汉字的所有多音,仅针对输入的 word 为单个汉字生效
|
|
6
|
+
* @value false:返回最常用的一个拼音 (默认值)
|
|
7
|
+
* @value true:返回所有读音
|
|
8
|
+
*/
|
|
9
|
+
multiple?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* @description 优先的拼音匹配模式
|
|
12
|
+
* @value normal:正常匹配模式 (默认值)
|
|
13
|
+
* @value surname:姓氏模式,遇到姓氏表中的汉字时,优先匹配姓氏读音
|
|
14
|
+
*/
|
|
15
|
+
mode?: PinyinMode;
|
|
16
|
+
/**
|
|
17
|
+
* @description surname 模式作用的范围
|
|
18
|
+
* @value off:不启用 surname 模式(默认值为 off)
|
|
19
|
+
* @value all:作用于整个汉语字符串(当设置了 `mode: surname` 时,默认值为 all)
|
|
20
|
+
* @value head:作用于汉语字符串开头
|
|
21
|
+
*/
|
|
22
|
+
surname?: SurnameMode;
|
|
23
|
+
/**
|
|
24
|
+
* @description 是否开启「一」和 「不」字的变调。默认开启。参考:https://zh.wiktionary.org/wiki/Appendix:%E2%80%9C%E4%B8%80%E2%80%9D%E5%8F%8A%E2%80%9C%E4%B8%8D%E2%80%9D%E7%9A%84%E5%8F%98%E8%B0%83
|
|
25
|
+
* @value true:开启
|
|
26
|
+
* @value false:不开启
|
|
27
|
+
*/
|
|
28
|
+
toneSandhi?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* @description 要使用的分词算法。默认为逆向最大匹配分词
|
|
31
|
+
* @value 1:逆向最大匹配分词(速度最快,准确率适中)
|
|
32
|
+
* @value 2:最大概率分词(速度适中,准确率高)
|
|
33
|
+
* @value 2:最少分词数分词(速度适中,准确率高)
|
|
34
|
+
*/
|
|
35
|
+
segmentit?: TokenizationAlgorithm;
|
|
36
|
+
}
|
|
37
|
+
interface AllData {
|
|
38
|
+
origin: string;
|
|
39
|
+
pinyin: string;
|
|
40
|
+
initial: string;
|
|
41
|
+
final: string;
|
|
42
|
+
num: number;
|
|
43
|
+
first: string;
|
|
44
|
+
finalHead: string;
|
|
45
|
+
finalBody: string;
|
|
46
|
+
finalTail: string;
|
|
47
|
+
isZh: boolean;
|
|
48
|
+
polyphonic: string[];
|
|
49
|
+
inZhRange: boolean;
|
|
50
|
+
result: string;
|
|
51
|
+
}
|
|
52
|
+
interface OptionsReturnString extends BasicOptions {
|
|
53
|
+
/**
|
|
54
|
+
* @description 返回结果的格式
|
|
55
|
+
* @value string:以字符串格式返回,拼音之间用空格隔开 (默认值)
|
|
56
|
+
* @value array:以数组格式返回
|
|
57
|
+
* @value array: 返回全部信息数组
|
|
58
|
+
*/
|
|
59
|
+
type?: 'string';
|
|
60
|
+
/**
|
|
61
|
+
* @description 拼音之间的分隔符,默认为空格,仅在 type 为 'string' 时生效
|
|
62
|
+
*/
|
|
63
|
+
separator?: string;
|
|
64
|
+
}
|
|
65
|
+
interface OptionsReturnArray extends BasicOptions {
|
|
66
|
+
/**
|
|
67
|
+
* @description 返回结果的格式
|
|
68
|
+
* @value string:以字符串格式返回,拼音之间用空格隔开 (默认值)
|
|
69
|
+
* @value array:以数组格式返回
|
|
70
|
+
* @value array: 返回全部信息数组
|
|
71
|
+
*/
|
|
72
|
+
type: 'array';
|
|
73
|
+
}
|
|
74
|
+
interface OptionsReturnAll extends BasicOptions {
|
|
75
|
+
/**
|
|
76
|
+
* @description 返回结果的格式
|
|
77
|
+
* @value string:以字符串格式返回,拼音之间用空格隔开 (默认值)
|
|
78
|
+
* @value array:以数组格式返回
|
|
79
|
+
* @value array: 返回全部信息数组
|
|
80
|
+
*/
|
|
81
|
+
type: 'all';
|
|
82
|
+
}
|
|
83
|
+
export interface CompleteOptions extends BasicOptions {
|
|
84
|
+
/**
|
|
85
|
+
* @description 返回结果的格式
|
|
86
|
+
* @value string:以字符串格式返回,拼音之间用空格隔开 (默认值)
|
|
87
|
+
* @value array:以数组格式返回
|
|
88
|
+
* @value array: 返回全部信息数组
|
|
89
|
+
*/
|
|
90
|
+
type?: 'string' | 'array' | 'all';
|
|
91
|
+
/**
|
|
92
|
+
* @description 拼音之间的分隔符,默认为空格,仅在 type 为 'string' 时生效
|
|
93
|
+
*/
|
|
94
|
+
separator?: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* @description: 获取汉语字符串的拼音
|
|
98
|
+
* @param {string} word 要转换的汉语字符串
|
|
99
|
+
* @param {OptionsReturnString=} options 配置项
|
|
100
|
+
* @return {string | string[] | AllData[]} options.type 为 string 时,返回字符串,中间用空格隔开;为 array 时,返回拼音字符串数组;为 all 时返回全部信息的数组
|
|
101
|
+
*/
|
|
102
|
+
declare function pinyin(word: string, options?: OptionsReturnString): string;
|
|
103
|
+
/**
|
|
104
|
+
* @description: 获取汉语字符串的拼音
|
|
105
|
+
* @param {string} word 要转换的汉语字符串
|
|
106
|
+
* @param {OptionsReturnArray=} options 配置项
|
|
107
|
+
* @return {string | string[] | AllData[]} options.type 为 string 时,返回字符串,中间用空格隔开;为 array 时,返回拼音字符串数组;为 all 时返回全部信息的数组
|
|
108
|
+
*/
|
|
109
|
+
declare function pinyin(word: string, options?: OptionsReturnArray): string[];
|
|
110
|
+
/**
|
|
111
|
+
* @description: 获取汉语字符串的拼音
|
|
112
|
+
* @param {string} word 要转换的汉语字符串
|
|
113
|
+
* @param {OptionsReturnAll=} options 配置项
|
|
114
|
+
* @return {string | string[] | AllData[]} options.type 为 string 时,返回字符串,中间用空格隔开;为 array 时,返回拼音字符串数组;为 all 时返回全部信息的数组
|
|
115
|
+
*/
|
|
116
|
+
declare function pinyin(word: string, options?: OptionsReturnAll): AllData[];
|
|
117
|
+
export { pinyin };
|