pinyin-ime 0.7.0 → 0.7.1

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.
@@ -0,0 +1,12 @@
1
+ import { P as PinyinDict } from '../dist-bllJYkRT.js';
2
+
3
+ /**
4
+ * 合并多个 {@link PinyinDict}:对每个 key 合并其 value 数组;重复词条取较大 `f`。
5
+ *
6
+ * @param dicts - 至少一个词典
7
+ * @returns 新的顶层对象(不修改入参)
8
+ */
9
+ declare function mergePinyinDicts(...dicts: PinyinDict[]): PinyinDict;
10
+ declare const dict: PinyinDict;
11
+
12
+ export { dict, mergePinyinDicts };
@@ -0,0 +1,6 @@
1
+ import { P as PinyinDict } from '../dist-bllJYkRT.js';
2
+
3
+ /** 内嵌 Google 拼音风格词典(体积大;按需改用 `getDictionary` / `createPinyinEngine`) */
4
+ declare const dict: PinyinDict;
5
+
6
+ export { dict };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * One candidate word or phrase with an optional corpus frequency weight.
3
+ */
4
+ type DictEntry = {
5
+ w: string;
6
+ f: number;
7
+ };
8
+ /**
9
+ * Map from lowercase pinyin key to ranked candidates (larger corpora use long keys).
10
+ */
11
+ type PinyinDict = Record<string, DictEntry[]>;
12
+
13
+ export type { PinyinDict as P };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinyin-ime",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "拼音转汉字输入法能力:在无法使用系统输入法的场景使用,通过候选框选词上屏",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -11,8 +11,14 @@
11
11
  "import": "./dist/index.js",
12
12
  "types": "./dist/index.d.ts"
13
13
  },
14
- "./dictionary/dota2_pinyin_dict": "./dist/dictionary/dota2_pinyin_dict.js",
15
- "./dictionary/google_pinyin_dict": "./dist/dictionary/google_pinyin_dict.js",
14
+ "./dictionary/dota2_pinyin_dict": {
15
+ "import": "./dist/dictionary/dota2_pinyin_dict.js",
16
+ "types": "./dist/dictionary/dota2_pinyin_dict.d.ts"
17
+ },
18
+ "./dictionary/google_pinyin_dict": {
19
+ "import": "./dist/dictionary/google_pinyin_dict.js",
20
+ "types": "./dist/dictionary/google_pinyin_dict.d.ts"
21
+ },
16
22
  "./pinyin-ime.css": "./dist/pinyin-ime.css"
17
23
  },
18
24
  "files": [