@kensio/pinyinjs 1.9.2 → 1.9.4
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/data/core.entries +3 -3
- package/data/full.entries +10423 -10423
- package/data/manifest.json +6 -6
- package/data/standard.entries +1148 -1148
- package/dist/decode/cai-rule.d.ts +25 -0
- package/dist/decode/cai-rule.d.ts.map +1 -0
- package/dist/decode/cai-rule.js +78 -0
- package/dist/decode/cai-rule.js.map +1 -0
- package/dist/decode/dou-rule.d.ts +23 -0
- package/dist/decode/dou-rule.d.ts.map +1 -0
- package/dist/decode/dou-rule.js +40 -0
- package/dist/decode/dou-rule.js.map +1 -0
- package/dist/decode/erhua-rule.d.ts +26 -0
- package/dist/decode/erhua-rule.d.ts.map +1 -0
- package/dist/decode/erhua-rule.js +34 -0
- package/dist/decode/erhua-rule.js.map +1 -0
- package/dist/decode/ge-rule.d.ts +23 -0
- package/dist/decode/ge-rule.d.ts.map +1 -0
- package/dist/decode/ge-rule.js +77 -0
- package/dist/decode/ge-rule.js.map +1 -0
- package/dist/decode/hua-modified.d.ts +19 -0
- package/dist/decode/hua-modified.d.ts.map +1 -0
- package/dist/decode/hua-modified.js +62 -0
- package/dist/decode/hua-modified.js.map +1 -0
- package/dist/decode/hua-rule.d.ts +2 -1
- package/dist/decode/hua-rule.d.ts.map +1 -1
- package/dist/decode/hua-rule.js +5 -1
- package/dist/decode/hua-rule.js.map +1 -1
- package/dist/decode/hua-words.d.ts +14 -0
- package/dist/decode/hua-words.d.ts.map +1 -1
- package/dist/decode/hua-words.js +67 -0
- package/dist/decode/hua-words.js.map +1 -1
- package/dist/decode/mei-rule.d.ts +22 -0
- package/dist/decode/mei-rule.d.ts.map +1 -0
- package/dist/decode/mei-rule.js +95 -0
- package/dist/decode/mei-rule.js.map +1 -0
- package/dist/decode/name-count-rule.d.ts +15 -0
- package/dist/decode/name-count-rule.d.ts.map +1 -0
- package/dist/decode/name-count-rule.js +81 -0
- package/dist/decode/name-count-rule.js.map +1 -0
- package/dist/decode/polyphone-rules.d.ts +3 -1
- package/dist/decode/polyphone-rules.d.ts.map +1 -1
- package/dist/decode/polyphone-rules.js +3 -1
- package/dist/decode/polyphone-rules.js.map +1 -1
- package/dist/decode/reading-rules.d.ts +5 -22
- package/dist/decode/reading-rules.d.ts.map +1 -1
- package/dist/decode/reading-rules.js +15 -35
- package/dist/decode/reading-rules.js.map +1 -1
- package/dist/dictionary/entry-invariants.d.ts.map +1 -1
- package/dist/dictionary/entry-invariants.js +16 -13
- package/dist/dictionary/entry-invariants.js.map +1 -1
- package/dist/dictionary/merge-types.d.ts +3 -0
- package/dist/dictionary/merge-types.d.ts.map +1 -1
- package/dist/dictionary/merge-types.js.map +1 -1
- package/dist/dictionary/merge-word.d.ts.map +1 -1
- package/dist/dictionary/merge-word.js +2 -2
- package/dist/dictionary/merge-word.js.map +1 -1
- package/dist/dictionary/merge.d.ts.map +1 -1
- package/dist/dictionary/merge.js +2 -0
- package/dist/dictionary/merge.js.map +1 -1
- package/dist/dictionary/proper-noun.d.ts +14 -1
- package/dist/dictionary/proper-noun.d.ts.map +1 -1
- package/dist/dictionary/proper-noun.js +46 -7
- package/dist/dictionary/proper-noun.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/sources/cedict.d.ts +8 -0
- package/dist/sources/cedict.d.ts.map +1 -1
- package/dist/sources/cedict.js +11 -0
- package/dist/sources/cedict.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The 美的 that is an adjective and its 的, and not the brand.
|
|
3
|
+
*
|
|
4
|
+
* 美的 is a word, the name of the appliance maker read `Měidí`, and the
|
|
5
|
+
* dictionary holds it as a proper noun. The same two characters are far more
|
|
6
|
+
* often 美 *beautiful* and the particle after it: 最美的姑娘, 很美的动物, 多美的日出.
|
|
7
|
+
* The decode took the name every time, so a learner's sentence about a
|
|
8
|
+
* sunrise came out with a capitalised `Měidí` in it.
|
|
9
|
+
*/
|
|
10
|
+
import { type EdgeRule } from "./rules.js";
|
|
11
|
+
/**
|
|
12
|
+
* 美的 is taken apart where a degree word or a 是 grades it.
|
|
13
|
+
*
|
|
14
|
+
* Taking the edge away leaves 美 and 的 to read as themselves, `měi de`, which
|
|
15
|
+
* is the reading as well as the spacing: the name's 的 is `dí`.
|
|
16
|
+
*
|
|
17
|
+
* Over the 139,893 distinct Han runs of Tatoeba and the Chinese Boost example
|
|
18
|
+
* sentences, the decode read 美的 as the name in 28 runs and none of them was
|
|
19
|
+
* the company.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ADJECTIVAL_MEI: EdgeRule;
|
|
22
|
+
//# sourceMappingURL=mei-rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mei-rule.d.ts","sourceRoot":"","sources":["../../src/decode/mei-rule.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAEL,KAAK,QAAQ,EAId,MAAM,YAAY,CAAC;AA0EpB;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,EAAE,QAQ5B,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The 美的 that is an adjective and its 的, and not the brand.
|
|
3
|
+
*
|
|
4
|
+
* 美的 is a word, the name of the appliance maker read `Měidí`, and the
|
|
5
|
+
* dictionary holds it as a proper noun. The same two characters are far more
|
|
6
|
+
* often 美 *beautiful* and the particle after it: 最美的姑娘, 很美的动物, 多美的日出.
|
|
7
|
+
* The decode took the name every time, so a learner's sentence about a
|
|
8
|
+
* sunrise came out with a capitalised `Měidí` in it.
|
|
9
|
+
*/
|
|
10
|
+
import { tagOf, wordStartingAt, wordsEndingAt, } from "./rules.js";
|
|
11
|
+
/**
|
|
12
|
+
* The word, in both scripts.
|
|
13
|
+
*/
|
|
14
|
+
const BRAND = new Set(["美的"]);
|
|
15
|
+
/**
|
|
16
|
+
* The words that grade or assert an adjective, in both scripts.
|
|
17
|
+
*
|
|
18
|
+
* Each one says something about how beautiful a thing is, and a company name
|
|
19
|
+
* takes none of them: 最美的, 非常美的, 这么美的. 多 is in for 多美的日出啊, the
|
|
20
|
+
* exclamation.
|
|
21
|
+
*/
|
|
22
|
+
const DEGREE = new Set([
|
|
23
|
+
"最",
|
|
24
|
+
"很",
|
|
25
|
+
"更",
|
|
26
|
+
"太",
|
|
27
|
+
"真",
|
|
28
|
+
"挺",
|
|
29
|
+
"多",
|
|
30
|
+
"多么",
|
|
31
|
+
"多麼",
|
|
32
|
+
"非常",
|
|
33
|
+
"十分",
|
|
34
|
+
"特别",
|
|
35
|
+
"特別",
|
|
36
|
+
"极其",
|
|
37
|
+
"極其",
|
|
38
|
+
"比较",
|
|
39
|
+
"比較",
|
|
40
|
+
"相当",
|
|
41
|
+
"相當",
|
|
42
|
+
"如此",
|
|
43
|
+
"这么",
|
|
44
|
+
"這麼",
|
|
45
|
+
"那么",
|
|
46
|
+
"那麼",
|
|
47
|
+
"这样",
|
|
48
|
+
"這樣",
|
|
49
|
+
"那样",
|
|
50
|
+
"那樣",
|
|
51
|
+
]);
|
|
52
|
+
/**
|
|
53
|
+
* The copula, which asserts 美 of its subject (都是美的) and also names what a
|
|
54
|
+
* thing is (这是美的冰箱, a Midea fridge).
|
|
55
|
+
*/
|
|
56
|
+
const COPULA = "是";
|
|
57
|
+
/**
|
|
58
|
+
* The tag prefix jieba gives a noun.
|
|
59
|
+
*/
|
|
60
|
+
const NOUN_TAG = "n";
|
|
61
|
+
/**
|
|
62
|
+
* Whether the 美的 starting at a position is graded or asserted.
|
|
63
|
+
*
|
|
64
|
+
* A degree word in front always grades it. A 是 asserts it only where nothing
|
|
65
|
+
* follows for 美的 to name: 都是美的 is beautiful, and 这是美的冰箱 and
|
|
66
|
+
* 这是美的牌冰箱 are the brand.
|
|
67
|
+
*/
|
|
68
|
+
function isGraded(context, from, to) {
|
|
69
|
+
const before = wordsEndingAt(context, from, 2);
|
|
70
|
+
if (before.some((word) => DEGREE.has(word))) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
return (before.includes(COPULA) &&
|
|
74
|
+
!tagOf(context, wordStartingAt(context, to)).startsWith(NOUN_TAG));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 美的 is taken apart where a degree word or a 是 grades it.
|
|
78
|
+
*
|
|
79
|
+
* Taking the edge away leaves 美 and 的 to read as themselves, `měi de`, which
|
|
80
|
+
* is the reading as well as the spacing: the name's 的 is `dí`.
|
|
81
|
+
*
|
|
82
|
+
* Over the 139,893 distinct Han runs of Tatoeba and the Chinese Boost example
|
|
83
|
+
* sentences, the decode read 美的 as the name in 28 runs and none of them was
|
|
84
|
+
* the company.
|
|
85
|
+
*/
|
|
86
|
+
export const ADJECTIVAL_MEI = {
|
|
87
|
+
name: "adjectival-mei",
|
|
88
|
+
verdictFor: (context) => {
|
|
89
|
+
const { edge } = context;
|
|
90
|
+
return BRAND.has(edge.text) && isGraded(context, edge.from, edge.to)
|
|
91
|
+
? "forbid"
|
|
92
|
+
: "keep";
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=mei-rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mei-rule.js","sourceRoot":"","sources":["../../src/decode/mei-rule.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAGL,KAAK,EACL,cAAc,EACd,aAAa,GACd,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC;IACrB,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;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ACF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type EdgeRule } from "./rules.js";
|
|
2
|
+
/**
|
|
3
|
+
* A proper noun is taken apart where its 量词 is counting with a number.
|
|
4
|
+
*
|
|
5
|
+
* Two shapes are caught. The name starts with the number and the 量词 follows
|
|
6
|
+
* (三本书, 五本书) and no title follows, or the name starts with the 量词 and the
|
|
7
|
+
* number is just in front of it (一堵墙). Taking the edge away leaves each
|
|
8
|
+
* character to read as itself, and the spacing follows the count.
|
|
9
|
+
*
|
|
10
|
+
* Over the 139,893 distinct Han runs of Tatoeba and the Chinese Boost example
|
|
11
|
+
* sentences, the rule changes 13 runs, 9 of them 三本 and 4 堵墙, and each one
|
|
12
|
+
* is a count.
|
|
13
|
+
*/
|
|
14
|
+
export declare const COUNTED_NAME: EdgeRule;
|
|
15
|
+
//# sourceMappingURL=name-count-rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name-count-rule.d.ts","sourceRoot":"","sources":["../../src/decode/name-count-rule.ts"],"names":[],"mappings":"AAWA,OAAO,EAAoB,KAAK,QAAQ,EAAkB,MAAM,YAAY,CAAC;AA+C7E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,EAAE,QAkB1B,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The proper noun that is really a number and the 量词 counting with it.
|
|
3
|
+
*
|
|
4
|
+
* 三本 is a Japanese surname and 堵墙 a place, and jieba tags both as names
|
|
5
|
+
* (`ns` and `nr`). In running text they are 三本书 (three books) and 一堵墙 (a
|
|
6
|
+
* wall), and the decode read them as one word: `sānběn shū`, `yì dǔqiáng`.
|
|
7
|
+
* {@link import("./measure-rule.js").COUNTED_MEASURE} keeps a counted 量词
|
|
8
|
+
* out of the next word, and it finds the 量词 by its tag. 本 is tagged `r` and
|
|
9
|
+
* 堵 `v`, so it never sees these two.
|
|
10
|
+
*/
|
|
11
|
+
import { QUANTITY_CHARACTERS } from "../numerals/characters.js";
|
|
12
|
+
import { wordStartingAt } from "./rules.js";
|
|
13
|
+
/**
|
|
14
|
+
* The tags jieba gives a person, a place and another proper name.
|
|
15
|
+
*
|
|
16
|
+
* Asked as well as the proper-noun flag, because a word only jieba tags as a
|
|
17
|
+
* name keeps the tag and loses the flag.
|
|
18
|
+
*/
|
|
19
|
+
const NAME_TAG = /^n[rsz]/u;
|
|
20
|
+
/**
|
|
21
|
+
* The 量词 the dictionary does not tag `q` and a proper noun has taken in.
|
|
22
|
+
*
|
|
23
|
+
* Kept to the two the corpus shows. The untagged 量词 are many (条, 件, 只 and
|
|
24
|
+
* 块 among them), and a wider set would reach names such as 四川, whose 川 is
|
|
25
|
+
* no 量词 at all.
|
|
26
|
+
*/
|
|
27
|
+
const UNTAGGED_MEASURES = new Set(["本", "堵"]);
|
|
28
|
+
/**
|
|
29
|
+
* The titles that follow a surname, in both scripts.
|
|
30
|
+
*
|
|
31
|
+
* 三本先生 is Mr Sanbon, and a title after the name says the name is meant.
|
|
32
|
+
*/
|
|
33
|
+
const TITLES = new Set([
|
|
34
|
+
"先生",
|
|
35
|
+
"小姐",
|
|
36
|
+
"女士",
|
|
37
|
+
"太太",
|
|
38
|
+
"老师",
|
|
39
|
+
"老師",
|
|
40
|
+
"同学",
|
|
41
|
+
"同學",
|
|
42
|
+
]);
|
|
43
|
+
/**
|
|
44
|
+
* Whether a character is a numeral, or 几 asking how many.
|
|
45
|
+
*/
|
|
46
|
+
function isNumeral(character) {
|
|
47
|
+
return (character !== undefined &&
|
|
48
|
+
(QUANTITY_CHARACTERS.has(character) ||
|
|
49
|
+
character === "几" ||
|
|
50
|
+
character === "幾"));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A proper noun is taken apart where its 量词 is counting with a number.
|
|
54
|
+
*
|
|
55
|
+
* Two shapes are caught. The name starts with the number and the 量词 follows
|
|
56
|
+
* (三本书, 五本书) and no title follows, or the name starts with the 量词 and the
|
|
57
|
+
* number is just in front of it (一堵墙). Taking the edge away leaves each
|
|
58
|
+
* character to read as itself, and the spacing follows the count.
|
|
59
|
+
*
|
|
60
|
+
* Over the 139,893 distinct Han runs of Tatoeba and the Chinese Boost example
|
|
61
|
+
* sentences, the rule changes 13 runs, 9 of them 三本 and 4 堵墙, and each one
|
|
62
|
+
* is a count.
|
|
63
|
+
*/
|
|
64
|
+
export const COUNTED_NAME = {
|
|
65
|
+
name: "counted-name",
|
|
66
|
+
verdictFor: (context) => {
|
|
67
|
+
const { characters, edge } = context;
|
|
68
|
+
if (!edge.isProperNoun && !NAME_TAG.test(edge.partOfSpeech)) {
|
|
69
|
+
return "keep";
|
|
70
|
+
}
|
|
71
|
+
const first = characters[edge.from];
|
|
72
|
+
const second = characters[edge.from + 1];
|
|
73
|
+
const startsWithCount = isNumeral(first) &&
|
|
74
|
+
UNTAGGED_MEASURES.has(second ?? "") &&
|
|
75
|
+
!TITLES.has(wordStartingAt(context, edge.to) ?? "");
|
|
76
|
+
const followsCount = UNTAGGED_MEASURES.has(first ?? "") &&
|
|
77
|
+
isNumeral(characters[edge.from - 1]);
|
|
78
|
+
return startsWithCount || followsCount ? "forbid" : "keep";
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=name-count-rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name-count-rule.js","sourceRoot":"","sources":["../../src/decode/name-count-rule.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAmC,cAAc,EAAE,MAAM,YAAY,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,UAAU,CAAC;AAE5B;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAE9C;;;;GAIG;AACH,MAAM,MAAM,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C,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;IAC7D,CAAC;CACF,CAAC"}
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 弹 is `tán` or `dàn`, and which one a text means is a question about the
|
|
5
5
|
* neighbours rather than about the character. 长 is the same question and has
|
|
6
|
-
* a file of its own, and
|
|
6
|
+
* a file of its own, and 好学, 美的 and 花都 are the same question asked of a word. The other rules in `reading-rules.ts` are about particles
|
|
7
7
|
* and 儿化, which is a different kind of evidence.
|
|
8
8
|
*/
|
|
9
9
|
export { ADJECTIVAL_CHANG } from "./chang-rule.js";
|
|
10
10
|
export { PLAYING_TAN } from "./tan-rule.js";
|
|
11
11
|
export { EASY_HAO } from "./hao-rule.js";
|
|
12
|
+
export { ADJECTIVAL_MEI } from "./mei-rule.js";
|
|
13
|
+
export { SUMMING_DOU } from "./dou-rule.js";
|
|
12
14
|
//# sourceMappingURL=polyphone-rules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polyphone-rules.d.ts","sourceRoot":"","sources":["../../src/decode/polyphone-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"polyphone-rules.d.ts","sourceRoot":"","sources":["../../src/decode/polyphone-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 弹 is `tán` or `dàn`, and which one a text means is a question about the
|
|
5
5
|
* neighbours rather than about the character. 长 is the same question and has
|
|
6
|
-
* a file of its own, and
|
|
6
|
+
* a file of its own, and 好学, 美的 and 花都 are the same question asked of a word. The other rules in `reading-rules.ts` are about particles
|
|
7
7
|
* and 儿化, which is a different kind of evidence.
|
|
8
8
|
*/
|
|
9
9
|
export { ADJECTIVAL_CHANG } from "./chang-rule.js";
|
|
10
10
|
export { PLAYING_TAN } from "./tan-rule.js";
|
|
11
11
|
export { EASY_HAO } from "./hao-rule.js";
|
|
12
|
+
export { ADJECTIVAL_MEI } from "./mei-rule.js";
|
|
13
|
+
export { SUMMING_DOU } from "./dou-rule.js";
|
|
12
14
|
//# sourceMappingURL=polyphone-rules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polyphone-rules.js","sourceRoot":"","sources":["../../src/decode/polyphone-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"polyphone-rules.js","sourceRoot":"","sources":["../../src/decode/polyphone-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export { MODAL_DE, NOUN_HUA, PARTICLE_DE, POTENTIAL_DE } from "./de-rule.js";
|
|
2
2
|
export { TAXI_DI } from "./taxi-rule.js";
|
|
3
3
|
export { COUNTED_MEASURE } from "./measure-rule.js";
|
|
4
|
+
export { COUNTED_GE } from "./ge-rule.js";
|
|
5
|
+
export { COUNTED_NAME } from "./name-count-rule.js";
|
|
6
|
+
export { MODAL_CAI } from "./cai-rule.js";
|
|
4
7
|
export { EXPERIENTIAL_GUO } from "./guo-rule.js";
|
|
5
8
|
export { TEACHING_JIAO } from "./jiao-rule.js";
|
|
6
9
|
export { DOMINANT_READING } from "./dominant-rule.js";
|
|
@@ -13,28 +16,8 @@ export { OBTAINING_DE } from "./obtain-rule.js";
|
|
|
13
16
|
export { REDUPLICATED_VERB } from "./reduplication-rule.js";
|
|
14
17
|
export { VERBAL_READING } from "./verbal-rule.js";
|
|
15
18
|
import type { EdgeRule } from "./rules.js";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
* 儿化 is a per-word dictionary fact taken from CC-CEDICT's explicit `r5`
|
|
20
|
-
* token, and 2,009 of the 2,067 keys ending in 儿 carry it. What that leaves is
|
|
21
|
-
* an edge: 这边儿, 上边儿 and 旁边儿 are all listed and 那边儿 is not, so
|
|
22
|
-
* 我得跑到那边儿去 read the 儿 as a syllable of its own — `nàbian ér` — and the
|
|
23
|
-
* decode was choosing between 那边 plus 儿 and 那 plus 边儿 on frequency alone.
|
|
24
|
-
*
|
|
25
|
-
* This forbids the bare 儿 edge when the character in front of it makes an
|
|
26
|
-
* attested 儿化 word, so the only paths left are the ones that absorb it. That
|
|
27
|
-
* asserts nothing the dictionary does not already say — 边儿 is `biānr` because
|
|
28
|
-
* CC-CEDICT says so — which is what separates it from synthesising 儿化 with a
|
|
29
|
-
* suffix rule, the thing ORTHOGRAPHY.md rejects and the old project got wrong.
|
|
30
|
-
*
|
|
31
|
-
* Measured over the same 88,866 lines it fires 7 times, and all 7 are right:
|
|
32
|
-
* 照片儿, 出门儿, 热点儿, 辣味儿, 晚会儿, 针管儿, 碍事儿. It is deliberately
|
|
33
|
-
* silent on the 20 bare 儿 with no attested 儿化 behind them, which are 马儿,
|
|
34
|
-
* 门铃儿 and a row of Mongol names transliterated with 儿.
|
|
35
|
-
*/
|
|
36
|
-
export declare const ATTESTED_ERHUA: EdgeRule;
|
|
37
|
-
export { ADJECTIVAL_CHANG, EASY_HAO, PLAYING_TAN } from "./polyphone-rules.js";
|
|
19
|
+
export { ATTESTED_ERHUA } from "./erhua-rule.js";
|
|
20
|
+
export { ADJECTIVAL_CHANG, ADJECTIVAL_MEI, EASY_HAO, PLAYING_TAN, SUMMING_DOU, } from "./polyphone-rules.js";
|
|
38
21
|
/**
|
|
39
22
|
* The rules the lattice decode applies, in order.
|
|
40
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reading-rules.d.ts","sourceRoot":"","sources":["../../src/decode/reading-rules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reading-rules.d.ts","sourceRoot":"","sources":["../../src/decode/reading-rules.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAUjD,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,QAAQ,EACR,WAAW,EACX,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,QAAQ,EA2B5C,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { MODAL_DE, NOUN_HUA, PARTICLE_DE, POTENTIAL_DE } from "./de-rule.js";
|
|
2
2
|
import { TAXI_DI } from "./taxi-rule.js";
|
|
3
3
|
import { COUNTED_MEASURE } from "./measure-rule.js";
|
|
4
|
+
import { COUNTED_GE } from "./ge-rule.js";
|
|
5
|
+
import { COUNTED_NAME } from "./name-count-rule.js";
|
|
6
|
+
import { MODAL_CAI } from "./cai-rule.js";
|
|
4
7
|
import { EXPERIENTIAL_GUO } from "./guo-rule.js";
|
|
5
8
|
import { TEACHING_JIAO } from "./jiao-rule.js";
|
|
6
9
|
import { DOMINANT_READING } from "./dominant-rule.js";
|
|
@@ -15,6 +18,9 @@ import { VERBAL_READING } from "./verbal-rule.js";
|
|
|
15
18
|
export { MODAL_DE, NOUN_HUA, PARTICLE_DE, POTENTIAL_DE } from "./de-rule.js";
|
|
16
19
|
export { TAXI_DI } from "./taxi-rule.js";
|
|
17
20
|
export { COUNTED_MEASURE } from "./measure-rule.js";
|
|
21
|
+
export { COUNTED_GE } from "./ge-rule.js";
|
|
22
|
+
export { COUNTED_NAME } from "./name-count-rule.js";
|
|
23
|
+
export { MODAL_CAI } from "./cai-rule.js";
|
|
18
24
|
export { EXPERIENTIAL_GUO } from "./guo-rule.js";
|
|
19
25
|
export { TEACHING_JIAO } from "./jiao-rule.js";
|
|
20
26
|
export { DOMINANT_READING } from "./dominant-rule.js";
|
|
@@ -26,41 +32,10 @@ export { POTENTIAL_LIAO } from "./liao-rule.js";
|
|
|
26
32
|
export { OBTAINING_DE } from "./obtain-rule.js";
|
|
27
33
|
export { REDUPLICATED_VERB } from "./reduplication-rule.js";
|
|
28
34
|
export { VERBAL_READING } from "./verbal-rule.js";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* token, and 2,009 of the 2,067 keys ending in 儿 carry it. What that leaves is
|
|
34
|
-
* an edge: 这边儿, 上边儿 and 旁边儿 are all listed and 那边儿 is not, so
|
|
35
|
-
* 我得跑到那边儿去 read the 儿 as a syllable of its own — `nàbian ér` — and the
|
|
36
|
-
* decode was choosing between 那边 plus 儿 and 那 plus 边儿 on frequency alone.
|
|
37
|
-
*
|
|
38
|
-
* This forbids the bare 儿 edge when the character in front of it makes an
|
|
39
|
-
* attested 儿化 word, so the only paths left are the ones that absorb it. That
|
|
40
|
-
* asserts nothing the dictionary does not already say — 边儿 is `biānr` because
|
|
41
|
-
* CC-CEDICT says so — which is what separates it from synthesising 儿化 with a
|
|
42
|
-
* suffix rule, the thing ORTHOGRAPHY.md rejects and the old project got wrong.
|
|
43
|
-
*
|
|
44
|
-
* Measured over the same 88,866 lines it fires 7 times, and all 7 are right:
|
|
45
|
-
* 照片儿, 出门儿, 热点儿, 辣味儿, 晚会儿, 针管儿, 碍事儿. It is deliberately
|
|
46
|
-
* silent on the 20 bare 儿 with no attested 儿化 behind them, which are 马儿,
|
|
47
|
-
* 门铃儿 and a row of Mongol names transliterated with 儿.
|
|
48
|
-
*/
|
|
49
|
-
export const ATTESTED_ERHUA = {
|
|
50
|
-
name: "attested-erhua",
|
|
51
|
-
verdictFor: (context) => {
|
|
52
|
-
const { characters, edge } = context;
|
|
53
|
-
if (edge.text !== "儿" || edge.from === 0) {
|
|
54
|
-
return "keep";
|
|
55
|
-
}
|
|
56
|
-
/* c8 ignore next -- the edge starts inside the run it was built from */
|
|
57
|
-
const absorbed = `${characters[edge.from - 1] ?? ""}儿`;
|
|
58
|
-
const reading = context.dictionary.lookup(absorbed)?.reading;
|
|
59
|
-
return (reading?.at(-1)?.erhua ?? false) ? "forbid" : "keep";
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
import { ADJECTIVAL_CHANG, EASY_HAO, PLAYING_TAN } from "./polyphone-rules.js";
|
|
63
|
-
export { ADJECTIVAL_CHANG, EASY_HAO, PLAYING_TAN } from "./polyphone-rules.js";
|
|
35
|
+
import { ATTESTED_ERHUA } from "./erhua-rule.js";
|
|
36
|
+
export { ATTESTED_ERHUA } from "./erhua-rule.js";
|
|
37
|
+
import { ADJECTIVAL_CHANG, ADJECTIVAL_MEI, EASY_HAO, PLAYING_TAN, SUMMING_DOU, } from "./polyphone-rules.js";
|
|
38
|
+
export { ADJECTIVAL_CHANG, ADJECTIVAL_MEI, EASY_HAO, PLAYING_TAN, SUMMING_DOU, } from "./polyphone-rules.js";
|
|
64
39
|
/**
|
|
65
40
|
* The rules the lattice decode applies, in order.
|
|
66
41
|
*/
|
|
@@ -73,6 +48,8 @@ export const READING_RULES = [
|
|
|
73
48
|
TEACHING_JIAO,
|
|
74
49
|
ATTESTED_ERHUA,
|
|
75
50
|
COUNTED_MEASURE,
|
|
51
|
+
COUNTED_GE,
|
|
52
|
+
COUNTED_NAME,
|
|
76
53
|
ADJECTIVAL_CHANG,
|
|
77
54
|
PLAYING_TAN,
|
|
78
55
|
EXPERIENTIAL_GUO,
|
|
@@ -86,5 +63,8 @@ export const READING_RULES = [
|
|
|
86
63
|
VERBAL_READING,
|
|
87
64
|
DOMINANT_READING,
|
|
88
65
|
EASY_HAO,
|
|
66
|
+
ADJECTIVAL_MEI,
|
|
67
|
+
SUMMING_DOU,
|
|
68
|
+
MODAL_CAI,
|
|
89
69
|
];
|
|
90
70
|
//# sourceMappingURL=reading-rules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reading-rules.js","sourceRoot":"","sources":["../../src/decode/reading-rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAA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MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,QAAQ,EACR,WAAW,EACX,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,QAAQ,EACR,WAAW,EACX,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAwB;IAChD,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,OAAO;IACP,QAAQ;IACR,aAAa;IACb,cAAc;IACd,eAAe;IACf,UAAU;IACV,YAAY;IACZ,gBAAgB;IAChB,WAAW;IACX,gBAAgB;IAChB,kBAAkB;IAClB,iBAAiB;IACjB,cAAc;IACd,cAAc;IACd,YAAY;IACZ,cAAc;IACd,YAAY;IACZ,cAAc;IACd,gBAAgB;IAChB,QAAQ;IACR,cAAc;IACd,WAAW;IACX,SAAS;CACV,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-invariants.d.ts","sourceRoot":"","sources":["../../src/dictionary/entry-invariants.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,uBAAuB,CAAC;AAE7E,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,
|
|
1
|
+
{"version":3,"file":"entry-invariants.d.ts","sourceRoot":"","sources":["../../src/dictionary/entry-invariants.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,uBAAuB,CAAC;AAE7E,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EA0GrD,CAAC"}
|
|
@@ -13,11 +13,12 @@ export const ENTRY_INVARIANTS = [
|
|
|
13
13
|
: "北京 is not marked as a proper noun",
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
|
-
// jieba tags all
|
|
17
|
-
//
|
|
18
|
-
|
|
16
|
+
// jieba tags all of these a proper noun, and the decoder capitalises
|
|
17
|
+
// straight off this bit. CC-CEDICT writes the first four in lower case
|
|
18
|
+
// and has no entry at all for 小姑娘 or 老先生.
|
|
19
|
+
description: "沙发, 城市, 阿姨, 长大, 小姑娘 and 老先生 are not proper nouns",
|
|
19
20
|
check: (dictionary) => {
|
|
20
|
-
const wrong = ["沙发", "城市", "阿姨", "长大"].filter((word) => dictionary.get(word)?.isProperNoun === true);
|
|
21
|
+
const wrong = ["沙发", "城市", "阿姨", "长大", "小姑娘", "老先生"].filter((word) => dictionary.get(word)?.isProperNoun === true);
|
|
21
22
|
return wrong.length === 0
|
|
22
23
|
? undefined
|
|
23
24
|
: `marked as proper nouns: ${wrong.join(", ")}`;
|
|
@@ -25,10 +26,11 @@ export const ENTRY_INVARIANTS = [
|
|
|
25
26
|
},
|
|
26
27
|
{
|
|
27
28
|
// The veto only demotes. These stay proper nouns, and 人民政府 is the
|
|
28
|
-
// control that shows the veto still fires on an institution.
|
|
29
|
-
|
|
29
|
+
// control that shows the veto still fires on an institution. CC-CEDICT
|
|
30
|
+
// has no 梁山伯 or 肯塔基州, which keep the flag on 梁 and on 肯塔基.
|
|
31
|
+
description: "齐白石, 国务院, 湖北, 梁山伯 and 肯塔基州 stay proper nouns",
|
|
30
32
|
check: (dictionary) => {
|
|
31
|
-
const wrong = ["齐白石", "国务院", "湖北"].filter((word) => dictionary.get(word)?.isProperNoun !== true);
|
|
33
|
+
const wrong = ["齐白石", "国务院", "湖北", "梁山伯", "肯塔基州"].filter((word) => dictionary.get(word)?.isProperNoun !== true);
|
|
32
34
|
return wrong.length === 0
|
|
33
35
|
? undefined
|
|
34
36
|
: `no longer proper nouns: ${wrong.join(", ")}`;
|
|
@@ -36,13 +38,14 @@ export const ENTRY_INVARIANTS = [
|
|
|
36
38
|
},
|
|
37
39
|
{
|
|
38
40
|
// A capitalised sense that only says `see 長壽區|长寿区` is the district's
|
|
39
|
-
// capital, not the word's.
|
|
40
|
-
//
|
|
41
|
-
// pointing at it.
|
|
42
|
-
|
|
41
|
+
// capital, not the word's. 美's is a bound form, the 美 of 美元 and 中美.
|
|
42
|
+
// 保安 and 京都 are the control: both hold a lowercase sense too, and both
|
|
43
|
+
// state their proper noun rather than pointing at it. 江 holds a surname
|
|
44
|
+
// beside its bound form.
|
|
45
|
+
description: "长寿, 友谊, 温泉 and 美 are not proper nouns, 保安, 京都 and 江 are",
|
|
43
46
|
check: (dictionary) => {
|
|
44
|
-
const wrong = ["长寿", "友谊", "温泉"].filter((word) => dictionary.get(word)?.isProperNoun === true);
|
|
45
|
-
const missing = ["保安", "京都"].filter((word) => dictionary.get(word)?.isProperNoun !== true);
|
|
47
|
+
const wrong = ["长寿", "友谊", "温泉", "美"].filter((word) => dictionary.get(word)?.isProperNoun === true);
|
|
48
|
+
const missing = ["保安", "京都", "江"].filter((word) => dictionary.get(word)?.isProperNoun !== true);
|
|
46
49
|
if (wrong.length > 0) {
|
|
47
50
|
return `marked as proper nouns: ${wrong.join(", ")}`;
|
|
48
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-invariants.js","sourceRoot":"","sources":["../../src/dictionary/entry-invariants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,MAAM,CAAC,MAAM,gBAAgB,GAA8B;IACzD;QACE,WAAW,EAAE,iDAAiD;QAC9D,KAAK,EAAE,CAAC,UAA2B,EAAsB,EAAE,CACzD,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,YAAY,KAAK,IAAI;YACzC,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,mCAAmC;KAC1C;IACD;QACE,qEAAqE;QACrE,
|
|
1
|
+
{"version":3,"file":"entry-invariants.js","sourceRoot":"","sources":["../../src/dictionary/entry-invariants.ts"],"names":[],"mappings":"AA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
|
|
@@ -10,6 +10,7 @@ import type { UnihanReadings, UnihanVariants } from "../sources/unihan.js";
|
|
|
10
10
|
import type { Syllable } from "../syllable/syllable.js";
|
|
11
11
|
import type { DictionaryEntry } from "./entry.js";
|
|
12
12
|
import type { NameMassTable } from "./name-mass.js";
|
|
13
|
+
import type { NameLookup } from "./proper-noun.js";
|
|
13
14
|
import type { TraditionalTable } from "./traditional-table.js";
|
|
14
15
|
/**
|
|
15
16
|
* The parsed sources the merge combines.
|
|
@@ -99,6 +100,8 @@ export interface WordSources {
|
|
|
99
100
|
readonly jieba: ReadonlyMap<string, JiebaEntry>;
|
|
100
101
|
/** What each character heads in jieba's word list, for {@link import("./proper-noun.js").properNounOf}. */
|
|
101
102
|
readonly nameMass: NameMassTable;
|
|
103
|
+
/** What the merge can read of other words, for the same. */
|
|
104
|
+
readonly names: NameLookup;
|
|
102
105
|
readonly unihanReadings: ReadonlyMap<string, UnihanReadings>;
|
|
103
106
|
readonly traditional: TraditionalTable;
|
|
104
107
|
readonly defaults: ReadonlyMap<string, readonly Syllable[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-types.d.ts","sourceRoot":"","sources":["../../src/dictionary/merge-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,YAA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ceRoot":"","sources":["../../src/dictionary/merge-word.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,UAAU,EAAY,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/E,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE3E;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"merge-word.d.ts","sourceRoot":"","sources":["../../src/dictionary/merge-word.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,UAAU,EAAY,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/E,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE3E;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,UAAU,CAkHxE"}
|
|
@@ -19,7 +19,7 @@ import { NO_TALLY } from "./merge-types.js";
|
|
|
19
19
|
* Merge one word.
|
|
20
20
|
*/
|
|
21
21
|
export function mergeWord(word, sources) {
|
|
22
|
-
const { cedictByWord, cedictByHant, phrase, jieba, nameMass, unihanReadings, traditional, defaults, } = sources;
|
|
22
|
+
const { cedictByWord, cedictByHant, phrase, jieba, nameMass, names, unihanReadings, traditional, defaults, } = sources;
|
|
23
23
|
const cedictEntries = cedictByWord.get(word) ?? [];
|
|
24
24
|
const cedictReadings = cedictReadingsOf(word, cedictEntries);
|
|
25
25
|
// Every reading CC-CEDICT gives this spelling, under either script.
|
|
@@ -47,7 +47,7 @@ export function mergeWord(word, sources) {
|
|
|
47
47
|
const taiwan = taiwanReadingOf(word, senses, senseReadings, reading, unihanReadings.get(word));
|
|
48
48
|
// ── Frequency, part of speech and the proper noun bit ─────
|
|
49
49
|
const jiebaEntry = jieba.get(word);
|
|
50
|
-
const { isProperNoun, boundaries, isVetoed } = properNounOf(word, jiebaEntry, cedictEntries, senses, reading, nameMass);
|
|
50
|
+
const { isProperNoun, boundaries, isVetoed } = properNounOf(word, jiebaEntry, cedictEntries, senses, reading, nameMass, names);
|
|
51
51
|
// ── Polyphone priors, for single characters only ──────────
|
|
52
52
|
const isCharacter = isSingleCharacter(word);
|
|
53
53
|
const characterReadings = defaults.get(word) ?? [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-word.js","sourceRoot":"","sources":["../../src/dictionary/merge-word.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAwB,aAAa,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAmB,QAAQ,EAAoB,MAAM,kBAAkB,CAAC;AAI/E;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,OAAoB;IAC1D,MAAM,EACJ,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,KAAK,EACL,QAAQ,EACR,cAAc,EACd,WAAW,EACX,QAAQ,GACT,GAAG,OAAO,CAAC;IAEZ,MAAM,aAAa,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACnD,MAAM,cAAc,GAAG,gBAAgB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAC7D,oEAAoE;IACpE,MAAM,aAAa,GAAG;QACpB,GAA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AAc,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5C,gBAAgB,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAClC,cAAc,EAAE,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7C,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/B,WAAW,EAAE,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAChD,WAAW,EAAE,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC9C;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/dictionary/merge.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/dictionary/merge.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAe,MAAM,kBAAkB,CAAC;AAE/E,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9E;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW,CAuE/D"}
|
package/dist/dictionary/merge.js
CHANGED
|
@@ -12,6 +12,7 @@ import { repairConstituentReadings } from "./constituent-repair.js";
|
|
|
12
12
|
import { settleMeasureTones } from "./measure-tone.js";
|
|
13
13
|
import { mergeWords, wordList } from "./merge-walk.js";
|
|
14
14
|
import { countNameMass } from "./name-mass.js";
|
|
15
|
+
import { nameLookupOf } from "./proper-noun.js";
|
|
15
16
|
import { carryToTraditional } from "./traditional-carry.js";
|
|
16
17
|
/**
|
|
17
18
|
* Build the merged dictionary from the four parsed sources.
|
|
@@ -37,6 +38,7 @@ export function mergeSources(sources) {
|
|
|
37
38
|
phrase,
|
|
38
39
|
jieba: sources.jieba,
|
|
39
40
|
nameMass: countNameMass(sources.jieba),
|
|
41
|
+
names: nameLookupOf(sources.jieba, cedictByWord),
|
|
40
42
|
unihanReadings: sources.unihanReadings,
|
|
41
43
|
traditional,
|
|
42
44
|
defaults,
|