@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,32 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-21 17:01:48 星期四 山东省济南市 */
|
|
2
|
+
import { stringLength as e } from "../../common/utils.js";
|
|
3
|
+
import { TokenizationAlgorithm as t } from "../../common/segmentit/TrieNode.js";
|
|
4
|
+
import { getPinyin as n } from "./handle.js";
|
|
5
|
+
import { middleWareNonZh as r, middlewareMultiple as i, middlewarePattern as a, middlewareToneSandhi as o, middlewareToneType as s, middlewareType as c, middlewareV as l, validateType as u } from "./middlewares.js";
|
|
6
|
+
//#region utils/pinyin/lib/core/pinyin/index.ts
|
|
7
|
+
var d = {
|
|
8
|
+
pattern: "pinyin",
|
|
9
|
+
toneType: "symbol",
|
|
10
|
+
type: "string",
|
|
11
|
+
multiple: !1,
|
|
12
|
+
mode: "normal",
|
|
13
|
+
removeNonZh: !1,
|
|
14
|
+
nonZh: "spaced",
|
|
15
|
+
v: !1,
|
|
16
|
+
separator: " ",
|
|
17
|
+
toneSandhi: !0,
|
|
18
|
+
segmentit: t.MaxProbability
|
|
19
|
+
};
|
|
20
|
+
function f(t, f) {
|
|
21
|
+
if (f = {
|
|
22
|
+
...d,
|
|
23
|
+
...f || {}
|
|
24
|
+
}, !u(t)) return t;
|
|
25
|
+
if (t === "") return f.type === "array" || f.type === "all" ? [] : "";
|
|
26
|
+
f.surname === void 0 && (f.mode === "surname" ? f.surname = "all" : f.surname = "off"), f.type === "all" && (f.pattern = "pinyin"), f.pattern === "num" && (f.toneType = "none"), f.removeNonZh && (f.nonZh = "removed");
|
|
27
|
+
let { list: p } = n(t, Array(e(t)), f.surname, f.segmentit, f.traditional);
|
|
28
|
+
return p = o(p, f.toneSandhi), p = r(p, f), i(t, f) && (p = i(t, f)), a(p, f), s(p, f), l(p, f), c(p, f, t);
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { f as pinyin };
|
|
32
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SingleWordResult } from '../../common/type';
|
|
2
|
+
import type { CompleteOptions } from './index';
|
|
3
|
+
export declare const validateType: (word: unknown) => boolean;
|
|
4
|
+
export declare function isNonZhScope(char: string, scope?: RegExp): boolean;
|
|
5
|
+
export declare const middleWareNonZh: (list: SingleWordResult[], options: CompleteOptions) => SingleWordResult[];
|
|
6
|
+
export declare const middlewareMultiple: (word: string, options: CompleteOptions) => SingleWordResult[] | false;
|
|
7
|
+
export declare const middlewarePattern: (list: SingleWordResult[], options: CompleteOptions) => void;
|
|
8
|
+
export declare const middlewareToneType: (list: SingleWordResult[], options: CompleteOptions) => void;
|
|
9
|
+
export declare const middlewareV: (list: SingleWordResult[], options: CompleteOptions) => void;
|
|
10
|
+
export declare const middlewareType: (list: SingleWordResult[], options: CompleteOptions, word: string) => string | string[] | {
|
|
11
|
+
origin: string;
|
|
12
|
+
pinyin: string;
|
|
13
|
+
initial: string;
|
|
14
|
+
final: string;
|
|
15
|
+
first: string;
|
|
16
|
+
finalHead: string;
|
|
17
|
+
finalBody: string;
|
|
18
|
+
finalTail: string;
|
|
19
|
+
num: number;
|
|
20
|
+
isZh: boolean;
|
|
21
|
+
polyphonic: string[];
|
|
22
|
+
inZhRange: boolean;
|
|
23
|
+
result: string;
|
|
24
|
+
}[];
|
|
25
|
+
export declare const middlewareToneSandhi: (list: SingleWordResult[], toneSandhi: boolean) => SingleWordResult[];
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-21 17:01:48 星期四 山东省济南市 */
|
|
2
|
+
import { stringLength as e } from "../../common/utils.js";
|
|
3
|
+
import t from "../../data/dict1.js";
|
|
4
|
+
import { getAllPinyin as n, getFinalParts as r, getFirstLetter as i, getInitialAndFinal as a, getMultiplePinyin as o, getNumOfTone as s, getPinyinWithNum as c, getPinyinWithoutTone as l } from "./handle.js";
|
|
5
|
+
//#region utils/pinyin/lib/core/pinyin/middlewares.ts
|
|
6
|
+
var u = (e) => typeof e == "string" ? !0 : (console.error("The first param of pinyin is error: " + e + " is not assignable to type \"string\"."), !1);
|
|
7
|
+
function d(e, t) {
|
|
8
|
+
return t instanceof RegExp ? t.test(e) : !0;
|
|
9
|
+
}
|
|
10
|
+
var f = (e, t) => {
|
|
11
|
+
let n = t.nonZh;
|
|
12
|
+
if (n === "removed") return e.filter((e) => e.isZh || !d(e.origin, t.nonZhScope));
|
|
13
|
+
if (n === "consecutive") {
|
|
14
|
+
for (let n = e.length - 2; n >= 0; n--) {
|
|
15
|
+
let r = e[n], i = e[n + 1];
|
|
16
|
+
!r.isZh && !i.isZh && d(r.origin, t.nonZhScope) && d(i.origin, t.nonZhScope) && (r.origin += i.origin, r.result += i.result, i.delete = !0);
|
|
17
|
+
}
|
|
18
|
+
return e.filter((e) => !e.delete);
|
|
19
|
+
} else return e;
|
|
20
|
+
}, p = (t, n) => e(t) === 1 && n.multiple ? o(t, n.surname) : !1, m = (e, t) => {
|
|
21
|
+
switch (t.pattern) {
|
|
22
|
+
case "pinyin": break;
|
|
23
|
+
case "num":
|
|
24
|
+
e.forEach((e) => {
|
|
25
|
+
e.result = e.isZh ? s(e.result) : "";
|
|
26
|
+
});
|
|
27
|
+
break;
|
|
28
|
+
case "initial":
|
|
29
|
+
e.forEach((e) => {
|
|
30
|
+
e.result = e.isZh ? a(e.result, t.initialPattern).initial : "";
|
|
31
|
+
});
|
|
32
|
+
break;
|
|
33
|
+
case "final":
|
|
34
|
+
e.forEach((e) => {
|
|
35
|
+
e.result = e.isZh ? a(e.result, t.initialPattern).final : "";
|
|
36
|
+
});
|
|
37
|
+
break;
|
|
38
|
+
case "first":
|
|
39
|
+
e.forEach((e) => {
|
|
40
|
+
e.result = i(e.result, e.isZh);
|
|
41
|
+
});
|
|
42
|
+
break;
|
|
43
|
+
case "finalHead":
|
|
44
|
+
e.forEach((e) => {
|
|
45
|
+
e.result = e.isZh ? r(e.result).head : "";
|
|
46
|
+
});
|
|
47
|
+
break;
|
|
48
|
+
case "finalBody":
|
|
49
|
+
e.forEach((e) => {
|
|
50
|
+
e.result = e.isZh ? r(e.result).body : "";
|
|
51
|
+
});
|
|
52
|
+
break;
|
|
53
|
+
case "finalTail":
|
|
54
|
+
e.forEach((e) => {
|
|
55
|
+
e.result = e.isZh ? r(e.result).tail : "";
|
|
56
|
+
});
|
|
57
|
+
break;
|
|
58
|
+
default: break;
|
|
59
|
+
}
|
|
60
|
+
}, h = (e, t) => {
|
|
61
|
+
switch (t.toneType) {
|
|
62
|
+
case "symbol": break;
|
|
63
|
+
case "none":
|
|
64
|
+
e.forEach((e) => {
|
|
65
|
+
e.isZh && (e.result = l(e.result));
|
|
66
|
+
});
|
|
67
|
+
break;
|
|
68
|
+
case "num":
|
|
69
|
+
e.forEach((e) => {
|
|
70
|
+
e.isZh && (e.result = c(e.result, e.originPinyin));
|
|
71
|
+
});
|
|
72
|
+
break;
|
|
73
|
+
default: break;
|
|
74
|
+
}
|
|
75
|
+
}, g = (e, t) => {
|
|
76
|
+
t.v && e.forEach((e) => {
|
|
77
|
+
e.isZh && (e.result = e.result.replace(/ü/g, typeof t.v == "string" ? t.v : "v"));
|
|
78
|
+
});
|
|
79
|
+
}, _ = (o, c, l) => {
|
|
80
|
+
if (c.multiple && e(l) === 1) {
|
|
81
|
+
let e = "";
|
|
82
|
+
o = o.filter((t) => {
|
|
83
|
+
let n = t.result !== e;
|
|
84
|
+
return e = t.result, n;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return c.type === "array" ? o.map((e) => e.result) : c.type === "all" ? o.map((e) => {
|
|
88
|
+
let o = e.isZh ? e.result : "", { initial: l, final: u } = a(o, c.initialPattern), { head: d, body: f, tail: p } = r(o), m = [];
|
|
89
|
+
return o !== "" && (m = [o].concat(n(e.origin, c.surname).filter((e) => e !== o))), {
|
|
90
|
+
origin: e.origin,
|
|
91
|
+
pinyin: o,
|
|
92
|
+
initial: l,
|
|
93
|
+
final: u,
|
|
94
|
+
first: i(e.result, e.isZh),
|
|
95
|
+
finalHead: d,
|
|
96
|
+
finalBody: f,
|
|
97
|
+
finalTail: p,
|
|
98
|
+
num: Number(s(e.originPinyin)),
|
|
99
|
+
isZh: e.isZh,
|
|
100
|
+
polyphonic: m,
|
|
101
|
+
inZhRange: !!t.get(e.origin),
|
|
102
|
+
result: e.result
|
|
103
|
+
};
|
|
104
|
+
}) : o.map((e) => e.result).join(c.separator);
|
|
105
|
+
}, v = (e, t) => (t === !1 && e.forEach((e) => {
|
|
106
|
+
e.origin === "一" ? e.result = e.originPinyin = "yī" : e.origin === "不" && (e.result = e.originPinyin = "bù");
|
|
107
|
+
}), e);
|
|
108
|
+
//#endregion
|
|
109
|
+
export { f as middleWareNonZh, p as middlewareMultiple, m as middlewarePattern, v as middlewareToneSandhi, h as middlewareToneType, _ as middlewareType, g as middlewareV, u as validateType };
|
|
110
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { CommonOptions, SingleWordResult } from '../../common/type';
|
|
2
|
+
interface BasicOptions extends CommonOptions {
|
|
3
|
+
}
|
|
4
|
+
interface AllData {
|
|
5
|
+
origin: string;
|
|
6
|
+
pinyin: string;
|
|
7
|
+
initial: string;
|
|
8
|
+
final: string;
|
|
9
|
+
num: number;
|
|
10
|
+
first: string;
|
|
11
|
+
finalHead: string;
|
|
12
|
+
finalBody: string;
|
|
13
|
+
finalTail: string;
|
|
14
|
+
isZh: boolean;
|
|
15
|
+
inZhRange: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface OptionsReturnString extends BasicOptions {
|
|
18
|
+
/**
|
|
19
|
+
* @description 返回结果的格式
|
|
20
|
+
* @value string:以字符串格式返回,拼音之间用空格隔开 (默认值)
|
|
21
|
+
* @value array:以数组格式返回
|
|
22
|
+
* @value array: 返回全部信息数组
|
|
23
|
+
*/
|
|
24
|
+
type?: 'string';
|
|
25
|
+
}
|
|
26
|
+
interface OptionsReturnArray extends BasicOptions {
|
|
27
|
+
/**
|
|
28
|
+
* @description 返回结果的格式
|
|
29
|
+
* @value string:以字符串格式返回,拼音之间用空格隔开 (默认值)
|
|
30
|
+
* @value array:以数组格式返回
|
|
31
|
+
* @value array: 返回全部信息数组
|
|
32
|
+
*/
|
|
33
|
+
type: 'array';
|
|
34
|
+
}
|
|
35
|
+
interface OptionsReturnAll extends BasicOptions {
|
|
36
|
+
/**
|
|
37
|
+
* @description 返回结果的格式
|
|
38
|
+
* @value string:以字符串格式返回,拼音之间用空格隔开 (默认值)
|
|
39
|
+
* @value array:以数组格式返回
|
|
40
|
+
* @value array: 返回全部信息数组
|
|
41
|
+
*/
|
|
42
|
+
type: 'all';
|
|
43
|
+
}
|
|
44
|
+
export interface CompleteOptions extends BasicOptions {
|
|
45
|
+
/**
|
|
46
|
+
* @description 返回结果的格式
|
|
47
|
+
* @value string:以字符串格式返回,拼音之间用空格隔开 (默认值)
|
|
48
|
+
* @value array:以数组格式返回
|
|
49
|
+
* @value array: 返回全部信息数组
|
|
50
|
+
*/
|
|
51
|
+
type?: 'string' | 'array' | 'all';
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* @description: 获取每个汉字的所有读音
|
|
55
|
+
* @param {string} text 要转换的汉语字符串
|
|
56
|
+
* @param {OptionsReturnString=} options 配置项
|
|
57
|
+
* @return {string[] | string[][] | AllData[][]} options.type 为 string 时,返回字符串数组,中间用空格隔开;为 array 时,返回二维拼音字符串数组;为 all 时返回二维全部信息的数组
|
|
58
|
+
*/
|
|
59
|
+
declare function polyphonic(text: string, options?: OptionsReturnString): string[];
|
|
60
|
+
/**
|
|
61
|
+
* @description: 获取每个汉字的所有读音
|
|
62
|
+
* @param {string} text 要转换的汉语字符串
|
|
63
|
+
* @param {OptionsReturnArray=} options 配置项
|
|
64
|
+
* @return {string[] | string[][] | AllData[][]} options.type 为 string 时,返回字符串数组,中间用空格隔开;为 array 时,返回二维拼音字符串数组;为 all 时返回二维全部信息的数组
|
|
65
|
+
*/
|
|
66
|
+
declare function polyphonic(text: string, options?: OptionsReturnArray): string[][];
|
|
67
|
+
/**
|
|
68
|
+
* @description: 获取每个汉字的所有读音
|
|
69
|
+
* @param {string} text 要转换的汉语字符串
|
|
70
|
+
* @param {OptionsReturnAll=} options 配置项
|
|
71
|
+
* @return {string[] | string[][] | AllData[][]} options.type 为 string 时,返回字符串数组,中间用空格隔开;为 array 时,返回二维拼音字符串数组;为 all 时返回二维全部信息的数组
|
|
72
|
+
*/
|
|
73
|
+
declare function polyphonic(text: string, options?: OptionsReturnAll): AllData[][];
|
|
74
|
+
export declare const handleType: (list: SingleWordResult[], options: CompleteOptions) => string | string[] | {
|
|
75
|
+
origin: string;
|
|
76
|
+
pinyin: string;
|
|
77
|
+
initial: string;
|
|
78
|
+
final: string;
|
|
79
|
+
first: string;
|
|
80
|
+
finalHead: string;
|
|
81
|
+
finalBody: string;
|
|
82
|
+
finalTail: string;
|
|
83
|
+
num: number;
|
|
84
|
+
isZh: boolean;
|
|
85
|
+
inZhRange: boolean;
|
|
86
|
+
}[];
|
|
87
|
+
export { polyphonic };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-21 17:01:48 星期四 山东省济南市 */
|
|
2
|
+
import { splitString as e } from "../../common/utils.js";
|
|
3
|
+
import t from "../../data/dict1.js";
|
|
4
|
+
import { getCustomPolyphonicDict as n } from "../custom/index.js";
|
|
5
|
+
import { getFinalParts as r, getFirstLetter as i, getInitialAndFinal as a, getNumOfTone as o } from "../pinyin/handle.js";
|
|
6
|
+
import { middleWareNonZh as s, middlewarePattern as c, middlewareToneType as l, middlewareV as u, validateType as d } from "../pinyin/middlewares.js";
|
|
7
|
+
//#region utils/pinyin/lib/core/polyphonic/index.ts
|
|
8
|
+
var f = {
|
|
9
|
+
pattern: "pinyin",
|
|
10
|
+
toneType: "symbol",
|
|
11
|
+
type: "string",
|
|
12
|
+
v: !1,
|
|
13
|
+
nonZh: "spaced"
|
|
14
|
+
};
|
|
15
|
+
function p(e, t = f) {
|
|
16
|
+
if (!d(e) || e === "") return [];
|
|
17
|
+
t.type === "all" && (t.pattern = "pinyin"), t.pattern === "num" && (t.toneType = "none"), t.removeNonZh && (t.nonZh = "removed");
|
|
18
|
+
let n = m(e);
|
|
19
|
+
n = s(n, t);
|
|
20
|
+
let r = h(n);
|
|
21
|
+
return r.forEach((e) => {
|
|
22
|
+
c(e, t);
|
|
23
|
+
}), r.forEach((e) => {
|
|
24
|
+
l(e, t);
|
|
25
|
+
}), r.forEach((e) => {
|
|
26
|
+
u(e, t);
|
|
27
|
+
}), r.map((e) => g(e, t));
|
|
28
|
+
}
|
|
29
|
+
var m = (r) => e(r).map((e) => {
|
|
30
|
+
let r = n().get(e) || t.get(e) || e;
|
|
31
|
+
return {
|
|
32
|
+
origin: e,
|
|
33
|
+
result: r,
|
|
34
|
+
isZh: r !== e,
|
|
35
|
+
originPinyin: r
|
|
36
|
+
};
|
|
37
|
+
}), h = (e) => e.map((e) => e.isZh ? e.result.split(" ").map((t) => ({
|
|
38
|
+
origin: e.origin,
|
|
39
|
+
result: t,
|
|
40
|
+
isZh: !0,
|
|
41
|
+
originPinyin: t
|
|
42
|
+
})) : [e]), g = (e, n) => n.type === "array" ? Array.from(new Set(e.map((e) => e.result))) : n.type === "all" ? e.map((e) => {
|
|
43
|
+
let s = e.isZh ? e.result : "", { initial: c, final: l } = a(s, n.initialPattern), { head: u, body: d, tail: f } = r(s);
|
|
44
|
+
return {
|
|
45
|
+
origin: e.origin,
|
|
46
|
+
pinyin: s,
|
|
47
|
+
initial: c,
|
|
48
|
+
final: l,
|
|
49
|
+
first: i(e.result, e.isZh),
|
|
50
|
+
finalHead: u,
|
|
51
|
+
finalBody: d,
|
|
52
|
+
finalTail: f,
|
|
53
|
+
num: Number(o(e.originPinyin)),
|
|
54
|
+
isZh: e.isZh,
|
|
55
|
+
inZhRange: !!t.get(e.origin)
|
|
56
|
+
};
|
|
57
|
+
}) : Array.from(new Set(e.map((e) => e.result))).join(" ");
|
|
58
|
+
//#endregion
|
|
59
|
+
export { p as polyphonic };
|
|
60
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { BasicOptions } from '../pinyin';
|
|
2
|
+
import type { Output } from './middlewares';
|
|
3
|
+
import { OutputFormat } from './middlewares';
|
|
4
|
+
type SegmentBaseOptions = Pick<BasicOptions, 'toneType' | 'mode' | 'surname' | 'nonZh' | 'v' | 'toneSandhi' | 'segmentit' | 'traditional'>;
|
|
5
|
+
interface AllSegmentReturnOptions extends SegmentBaseOptions {
|
|
6
|
+
/**
|
|
7
|
+
* @description 以片段格式返回全部信息
|
|
8
|
+
*/
|
|
9
|
+
format?: OutputFormat.AllSegment;
|
|
10
|
+
}
|
|
11
|
+
interface AllArrayReturnOptions extends SegmentBaseOptions {
|
|
12
|
+
/**
|
|
13
|
+
* @description 以数组格式返回全部信息
|
|
14
|
+
*/
|
|
15
|
+
format?: OutputFormat.AllArray;
|
|
16
|
+
}
|
|
17
|
+
interface AllStringReturnOptions extends SegmentBaseOptions {
|
|
18
|
+
/**
|
|
19
|
+
* @description 以字符串格式返回全部信息
|
|
20
|
+
*/
|
|
21
|
+
format?: OutputFormat.AllString;
|
|
22
|
+
/**
|
|
23
|
+
* @description 分隔符,默认为空格,仅在 format 为 AllString(3)、PinyinString(6)、ZhString(9) 时生效
|
|
24
|
+
*/
|
|
25
|
+
separator?: string;
|
|
26
|
+
}
|
|
27
|
+
interface PinyinSegmentReturnOptions extends SegmentBaseOptions {
|
|
28
|
+
/**
|
|
29
|
+
* @description 以片段格式返回拼音
|
|
30
|
+
*/
|
|
31
|
+
format?: OutputFormat.PinyinSegment;
|
|
32
|
+
}
|
|
33
|
+
interface PinyinArrayReturnOptions extends SegmentBaseOptions {
|
|
34
|
+
/**
|
|
35
|
+
* @description 以数组格式返回拼音
|
|
36
|
+
*/
|
|
37
|
+
format?: OutputFormat.PinyinArray;
|
|
38
|
+
}
|
|
39
|
+
interface PinyinStringReturnOptions extends SegmentBaseOptions {
|
|
40
|
+
/**
|
|
41
|
+
* @description 以字符串格式返回拼音
|
|
42
|
+
*/
|
|
43
|
+
format?: OutputFormat.PinyinString;
|
|
44
|
+
/**
|
|
45
|
+
* @description 分隔符,默认为空格,仅在 format 为 AllString(3)、PinyinString(6)、ZhString(9) 时生效
|
|
46
|
+
*/
|
|
47
|
+
separator?: string;
|
|
48
|
+
}
|
|
49
|
+
interface ZhSegmentReturnOptions extends SegmentBaseOptions {
|
|
50
|
+
/**
|
|
51
|
+
* @description 以片段格式返回中文
|
|
52
|
+
*/
|
|
53
|
+
format?: OutputFormat.ZhSegment;
|
|
54
|
+
}
|
|
55
|
+
interface ZhArrayReturnOptions extends SegmentBaseOptions {
|
|
56
|
+
/**
|
|
57
|
+
* @description 以数组格式返回中文
|
|
58
|
+
*/
|
|
59
|
+
format?: OutputFormat.ZhArray;
|
|
60
|
+
}
|
|
61
|
+
interface ZhStringReturnOptions extends SegmentBaseOptions {
|
|
62
|
+
/**
|
|
63
|
+
* @description 以字符串格式返回中文
|
|
64
|
+
*/
|
|
65
|
+
format?: OutputFormat.ZhString;
|
|
66
|
+
/**
|
|
67
|
+
* @description 分隔符,默认为空格,仅在 format 为 AllString(3)、PinyinString(6)、ZhString(9) 时生效
|
|
68
|
+
*/
|
|
69
|
+
separator?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface SegmentCompleteOptions extends SegmentBaseOptions {
|
|
72
|
+
format?: OutputFormat;
|
|
73
|
+
/**
|
|
74
|
+
* @description 分隔符,默认为空格,仅在 format 为 AllString(3)、PinyinString(6)、ZhString(9) 时生效
|
|
75
|
+
*/
|
|
76
|
+
separator?: string;
|
|
77
|
+
}
|
|
78
|
+
export declare function segment(word: string, options?: AllSegmentReturnOptions): Output['AllSegment'];
|
|
79
|
+
export declare function segment(word: string, options?: AllArrayReturnOptions): Output['AllArray'];
|
|
80
|
+
export declare function segment(word: string, options?: AllStringReturnOptions): Output['AllString'];
|
|
81
|
+
export declare function segment(word: string, options?: PinyinSegmentReturnOptions): Output['PinyinSegment'];
|
|
82
|
+
export declare function segment(word: string, options?: PinyinArrayReturnOptions): Output['PinyinArray'];
|
|
83
|
+
export declare function segment(word: string, options?: PinyinStringReturnOptions): Output['PinyinString'];
|
|
84
|
+
export declare function segment(word: string, options?: ZhSegmentReturnOptions): Output['ZhSegment'];
|
|
85
|
+
export declare function segment(word: string, options?: ZhArrayReturnOptions): Output['ZhArray'];
|
|
86
|
+
export declare function segment(word: string, options?: ZhStringReturnOptions): Output['ZhString'];
|
|
87
|
+
export { OutputFormat };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-21 17:01:48 星期四 山东省济南市 */
|
|
2
|
+
import { stringLength as e } from "../../common/utils.js";
|
|
3
|
+
import { TokenizationAlgorithm as t } from "../../common/segmentit/TrieNode.js";
|
|
4
|
+
import { getPinyin as n } from "../pinyin/handle.js";
|
|
5
|
+
import { middleWareNonZh as r, middlewareToneSandhi as i, middlewareToneType as a, middlewareV as o, validateType as s } from "../pinyin/middlewares.js";
|
|
6
|
+
import { OutputFormat as c, middlewareOutputFormat as l, middlewareSegment as u } from "./middlewares.js";
|
|
7
|
+
//#region utils/pinyin/lib/core/segment/index.ts
|
|
8
|
+
var d = {
|
|
9
|
+
toneType: "symbol",
|
|
10
|
+
mode: "normal",
|
|
11
|
+
nonZh: "spaced",
|
|
12
|
+
v: !1,
|
|
13
|
+
separator: " ",
|
|
14
|
+
toneSandhi: !0,
|
|
15
|
+
segmentit: t.MaxProbability,
|
|
16
|
+
format: c.AllSegment,
|
|
17
|
+
traditional: !1
|
|
18
|
+
};
|
|
19
|
+
function f(t, c) {
|
|
20
|
+
if (c = {
|
|
21
|
+
...d,
|
|
22
|
+
...c || {}
|
|
23
|
+
}, !s(t)) return t;
|
|
24
|
+
c.surname === void 0 && (c.mode === "surname" ? c.surname = "all" : c.surname = "off");
|
|
25
|
+
let { list: f, matches: p } = n(t, Array(e(t)), c.surname, c.segmentit, c.traditional);
|
|
26
|
+
return f = i(f, c.toneSandhi), f = r(f, c), a(f, c), o(f, c), l(u(f, p), {
|
|
27
|
+
format: c.format,
|
|
28
|
+
separator: c.separator
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { f as segment };
|
|
33
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { MatchPattern } from '../../common/segmentit/TrieNode';
|
|
2
|
+
import type { SingleWordResult } from '../../common/type';
|
|
3
|
+
interface OriginSegment {
|
|
4
|
+
segment: {
|
|
5
|
+
origin: string;
|
|
6
|
+
result: string;
|
|
7
|
+
}[];
|
|
8
|
+
isZh: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare enum OutputFormat {
|
|
11
|
+
AllSegment = 1,
|
|
12
|
+
AllArray = 2,
|
|
13
|
+
AllString = 3,
|
|
14
|
+
PinyinSegment = 4,
|
|
15
|
+
PinyinArray = 5,
|
|
16
|
+
PinyinString = 6,
|
|
17
|
+
ZhSegment = 7,
|
|
18
|
+
ZhArray = 8,
|
|
19
|
+
ZhString = 9
|
|
20
|
+
}
|
|
21
|
+
export interface Output {
|
|
22
|
+
AllSegment: {
|
|
23
|
+
origin: string;
|
|
24
|
+
result: string;
|
|
25
|
+
}[];
|
|
26
|
+
AllArray: {
|
|
27
|
+
origin: string;
|
|
28
|
+
result: string;
|
|
29
|
+
}[][];
|
|
30
|
+
AllString: {
|
|
31
|
+
origin: string;
|
|
32
|
+
result: string;
|
|
33
|
+
};
|
|
34
|
+
PinyinSegment: string[];
|
|
35
|
+
PinyinArray: string[][];
|
|
36
|
+
PinyinString: string;
|
|
37
|
+
ZhSegment: string[];
|
|
38
|
+
ZhArray: string[][];
|
|
39
|
+
ZhString: string;
|
|
40
|
+
}
|
|
41
|
+
export declare function middlewareSegment(list: SingleWordResult[], matches: MatchPattern[]): OriginSegment[];
|
|
42
|
+
export declare function middlewareOutputFormat(segments: OriginSegment[], options: {
|
|
43
|
+
format?: OutputFormat;
|
|
44
|
+
separator?: string;
|
|
45
|
+
}): string | string[] | string[][] | {
|
|
46
|
+
origin: string;
|
|
47
|
+
result: string;
|
|
48
|
+
}[] | {
|
|
49
|
+
origin: string;
|
|
50
|
+
result: string;
|
|
51
|
+
}[][] | {
|
|
52
|
+
origin: string;
|
|
53
|
+
result: string;
|
|
54
|
+
} | undefined;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-21 17:01:48 星期四 山东省济南市 */
|
|
2
|
+
import { splitString as e } from "../../common/utils.js";
|
|
3
|
+
//#region utils/pinyin/lib/core/segment/middlewares.ts
|
|
4
|
+
var t = /* @__PURE__ */ function(e) {
|
|
5
|
+
return e[e.AllSegment = 1] = "AllSegment", e[e.AllArray = 2] = "AllArray", e[e.AllString = 3] = "AllString", e[e.PinyinSegment = 4] = "PinyinSegment", e[e.PinyinArray = 5] = "PinyinArray", e[e.PinyinString = 6] = "PinyinString", e[e.ZhSegment = 7] = "ZhSegment", e[e.ZhArray = 8] = "ZhArray", e[e.ZhString = 9] = "ZhString", e;
|
|
6
|
+
}({});
|
|
7
|
+
function n(t, n) {
|
|
8
|
+
let r = [], i = 0, a = 0;
|
|
9
|
+
for (; i < t.length && a < n.length;) {
|
|
10
|
+
let o = n[a], s = t[i];
|
|
11
|
+
if (o.zh.startsWith(s.origin)) {
|
|
12
|
+
let n = i, s = e(o.zh), c = n + 1;
|
|
13
|
+
for (; c < t.length && t[c].origin === s[c - n];) c++;
|
|
14
|
+
let l = t.slice(n, c);
|
|
15
|
+
r.push({
|
|
16
|
+
segment: l.map((e) => ({
|
|
17
|
+
origin: e.origin,
|
|
18
|
+
result: e.result
|
|
19
|
+
})),
|
|
20
|
+
isZh: !0
|
|
21
|
+
}), i += c - n, a++;
|
|
22
|
+
} else r.push({
|
|
23
|
+
segment: [{
|
|
24
|
+
origin: s.origin,
|
|
25
|
+
result: s.result
|
|
26
|
+
}],
|
|
27
|
+
isZh: !1
|
|
28
|
+
}), i++;
|
|
29
|
+
}
|
|
30
|
+
for (; i < t.length;) {
|
|
31
|
+
let e = t[i];
|
|
32
|
+
r.push({
|
|
33
|
+
segment: [{
|
|
34
|
+
origin: e.origin,
|
|
35
|
+
result: e.result
|
|
36
|
+
}],
|
|
37
|
+
isZh: !1
|
|
38
|
+
}), i++;
|
|
39
|
+
}
|
|
40
|
+
return r;
|
|
41
|
+
}
|
|
42
|
+
function r(e, t) {
|
|
43
|
+
let { format: n = 1, separator: r = " " } = t;
|
|
44
|
+
if (n === 1) return e.map((e) => ({
|
|
45
|
+
origin: e.segment.map((e) => e.origin).join(""),
|
|
46
|
+
result: e.segment.map((e) => e.result).join("")
|
|
47
|
+
}));
|
|
48
|
+
if (n === 2) return e.map((e) => e.segment);
|
|
49
|
+
if (n === 3) {
|
|
50
|
+
let t = e.map((e) => ({
|
|
51
|
+
origin: e.segment.map((e) => e.origin).join(""),
|
|
52
|
+
result: e.segment.map((e) => e.result).join("")
|
|
53
|
+
}));
|
|
54
|
+
return {
|
|
55
|
+
origin: t.map((e) => e.origin).join(r),
|
|
56
|
+
result: t.map((e) => e.result).join(r)
|
|
57
|
+
};
|
|
58
|
+
} else if (n === 4) return e.map((e) => e.segment.map((e) => e.result).join(""));
|
|
59
|
+
else if (n === 5) return e.map((e) => e.segment.map((e) => e.result));
|
|
60
|
+
else if (n === 6) return e.map((e) => e.segment.map((e) => e.result).join("")).join(r);
|
|
61
|
+
else if (n === 7) return e.map((e) => e.segment.map((e) => e.origin).join(""));
|
|
62
|
+
else if (n === 8) return e.map((e) => e.segment.map((e) => e.origin));
|
|
63
|
+
else if (n === 9) return e.map((e) => e.segment.map((e) => e.origin).join("")).join(r);
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { t as OutputFormat, r as middlewareOutputFormat, n as middlewareSegment };
|
|
67
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-21 17:01:48 星期四 山东省济南市 */
|
|
2
|
+
//#region utils/pinyin/lib/core/traditional/index.ts
|
|
3
|
+
var e = [];
|
|
4
|
+
function t(t) {
|
|
5
|
+
for (let n in t) {
|
|
6
|
+
let r = t[n], i = n.charCodeAt(0);
|
|
7
|
+
e[i] = r;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function n() {
|
|
11
|
+
return e;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { t as addTraditionalDict, n as getTraditionalDict };
|
|
15
|
+
/* 独立思考,明辨是非 */
|