Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pinyin-pro

Package Overview
Dependencies
Maintainers
1
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pinyin-pro - npm Package Compare versions

Comparing version 3.18.6 to 3.19.0

4

CHANGELOG.md
# 更新日志
## 3.19.0
- 【feat】`customPinyin`: `customPinyin` 支持对 `multiple` 和 `polyphonic` 生效
## 3.18.6

@@ -4,0 +8,0 @@

2

package.json
{
"name": "pinyin-pro",
"version": "3.18.6",
"version": "3.19.0",
"description": "准确率和性能最优异的汉字转拼音库。获取中文拼音、韵母、声母、声调、首字母,支持拼音匹配",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

@@ -0,11 +1,28 @@

type CustomHandleType = 'add' | 'replace';
type CustomDictType = 'pinyin' | 'multiple' | 'polyphonic';
interface CustomPinyinOptions {
/**
* @description: multiple 对于 customPinyin 补充词汇的处理
*/
multiple?: CustomHandleType;
/**
* @description: polyphonic 对于 customPinyin 补充词汇的处理
*/
polyphonic?: CustomHandleType;
}
/**
* @description: 用户自定义拼音
* @param {{ [key: string]: string }} config 用户自定义的拼音映射(支持汉字、词语、句子的映射),若匹配到该映射,优先将汉字转换为该映射
* @param {CustomPinyinOptions} options multiple/polyphonic 对于 customPinyin 补充词汇的处理
*/
export declare function customPinyin(config?: {
[key: string]: string;
}): void;
}, options?: CustomPinyinOptions): void;
export declare const getCustomDict: () => {
[key: string]: string;
};
export declare const getCustomMultpileDict: () => string[];
export declare const getCustomPolyphonicDict: () => string[];
export declare function clearCustomDict(dict: CustomDictType | CustomDictType[]): void;
export declare function hasCustomConfig(): boolean;
export {};
export { pinyin } from './core/pinyin';
export { customPinyin } from './core/custom';
export { customPinyin, clearCustomDict } from './core/custom';
export { match } from './core/match';

@@ -4,0 +4,0 @@ export { html } from './core/html';

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc