@kensio/pinyinjs 1.7.14 → 1.8.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.
- package/dist/decode/huan-rule.d.ts +26 -0
- package/dist/decode/huan-rule.d.ts.map +1 -0
- package/dist/decode/huan-rule.js +81 -0
- package/dist/decode/huan-rule.js.map +1 -0
- package/dist/decode/reading-rules.d.ts +2 -0
- package/dist/decode/reading-rules.d.ts.map +1 -1
- package/dist/decode/reading-rules.js +6 -0
- package/dist/decode/reading-rules.js.map +1 -1
- package/dist/decode/reduplication-rule.d.ts +23 -0
- package/dist/decode/reduplication-rule.d.ts.map +1 -0
- package/dist/decode/reduplication-rule.js +157 -0
- package/dist/decode/reduplication-rule.js.map +1 -0
- package/dist/decode/sandhi-grouping.d.ts +55 -0
- package/dist/decode/sandhi-grouping.d.ts.map +1 -0
- package/dist/decode/sandhi-grouping.js +81 -0
- package/dist/decode/sandhi-grouping.js.map +1 -0
- package/dist/decode/sandhi-input.d.ts +14 -9
- package/dist/decode/sandhi-input.d.ts.map +1 -1
- package/dist/decode/sandhi-input.js +11 -6
- package/dist/decode/sandhi-input.js.map +1 -1
- package/dist/decode/sandhi-tones.d.ts +19 -3
- package/dist/decode/sandhi-tones.d.ts.map +1 -1
- package/dist/decode/sandhi-tones.js +25 -5
- package/dist/decode/sandhi-tones.js.map +1 -1
- package/dist/decode/sandhi.d.ts +20 -19
- package/dist/decode/sandhi.d.ts.map +1 -1
- package/dist/decode/sandhi.js +31 -52
- package/dist/decode/sandhi.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/package.json +2 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Syllable } from "../syllable/syllable.js";
|
|
2
|
+
import { type EdgeRule } from "./rules.js";
|
|
3
|
+
/**
|
|
4
|
+
* Whether a syllable is `huán`, the verbal reading of 还.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isHuan(syllable: Syllable | undefined): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* 还 read as `huán` where it gives back money, a book or an account.
|
|
9
|
+
*
|
|
10
|
+
* The character is stored `hái` with `huán` as an alternate, and the adverb is
|
|
11
|
+
* by far the commoner of the two. The verb mostly lives in words that carry
|
|
12
|
+
* their own reading (还给, 归还, 偿还, 还债). 还钱 is a word in the full tier
|
|
13
|
+
* only, since no frequency list counts it, so the standard tier read
|
|
14
|
+
* 我得去银行还钱 as `hái qián`. See {@link RETURNED} for the objects.
|
|
15
|
+
*
|
|
16
|
+
* An untagged pair ending in 还 is taken off the lattice where it reads the 还
|
|
17
|
+
* `hái`, for the reason {@link TEACHING_JIAO} gives. 倒还 is a key the full
|
|
18
|
+
* tier holds with no part of speech.
|
|
19
|
+
*
|
|
20
|
+
* Over 88,866 lines of Tatoeba and zh.wikipedia and both CPP splits, this
|
|
21
|
+
* moves 5 decodes in the standard tier and all 5 are corrections (還錢 three
|
|
22
|
+
* times, 还钱 and 還書). Each now reads what the full tier reads through the
|
|
23
|
+
* word. Nothing moves in the full tier.
|
|
24
|
+
*/
|
|
25
|
+
export declare const RETURNING_HUAN: EdgeRule;
|
|
26
|
+
//# sourceMappingURL=huan-rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"huan-rule.d.ts","sourceRoot":"","sources":["../../src/decode/huan-rule.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAEL,KAAK,QAAQ,EAGd,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAI9D;AAoCD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,cAAc,EAAE,QAiB5B,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a 还 is giving something back or is the adverb.
|
|
3
|
+
*
|
|
4
|
+
* The adverb `hái` comes in front of a verb or an adjective. The verb `huán`
|
|
5
|
+
* takes an object, and what is given back is most often money, a book or a
|
|
6
|
+
* debt.
|
|
7
|
+
*/
|
|
8
|
+
import { toCharacters } from "../script/characters.js";
|
|
9
|
+
import { tagOf, wordsStartingAt, } from "./rules.js";
|
|
10
|
+
/**
|
|
11
|
+
* Whether a syllable is `huán`, the verbal reading of 还.
|
|
12
|
+
*/
|
|
13
|
+
export function isHuan(syllable) {
|
|
14
|
+
return (syllable?.initial === "h" && syllable.final === "uan" && syllable.tone === 2);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The character in both scripts.
|
|
18
|
+
*/
|
|
19
|
+
const RETURNING = new Set(["还", "還"]);
|
|
20
|
+
/**
|
|
21
|
+
* What a 还 gives back, in both scripts.
|
|
22
|
+
*
|
|
23
|
+
* Money, a book and an account. The full tier holds 还钱, 还书 and 还账 as
|
|
24
|
+
* words, all three `huán`, and the standard tier holds none of them. 还债 and
|
|
25
|
+
* 还款 are in both tiers and need nothing here.
|
|
26
|
+
*
|
|
27
|
+
* Written out because the tags will not do it. jieba tags 有点, 客气, 问 and
|
|
28
|
+
* 头 `n`, and 还有点, 还客气, 还问 and 还头一回 are all the adverb. Over 88,866
|
|
29
|
+
* lines of Tatoeba and zh.wikipedia, the standard tier decodes 39 standalone
|
|
30
|
+
* 还 in front of a word with a noun tag, and 30 of them are the adverb.
|
|
31
|
+
*/
|
|
32
|
+
const RETURNED = new Set(["钱", "錢", "书", "書", "账", "賬", "帳"]);
|
|
33
|
+
/**
|
|
34
|
+
* Whether the 还 at a position has something given back after it.
|
|
35
|
+
*
|
|
36
|
+
* The object has to stand clear of a tagged word of its own. 他还书法很好 has
|
|
37
|
+
* 书法 after the 还, and that 还 is the adverb.
|
|
38
|
+
*/
|
|
39
|
+
function isReturningAt(context, at) {
|
|
40
|
+
if (!RETURNED.has(context.characters[at + 1] ?? "")) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
return !wordsStartingAt(context, at + 1).some((word) => toCharacters(word).length > 1 && tagOf(context, word) !== "");
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 还 read as `huán` where it gives back money, a book or an account.
|
|
47
|
+
*
|
|
48
|
+
* The character is stored `hái` with `huán` as an alternate, and the adverb is
|
|
49
|
+
* by far the commoner of the two. The verb mostly lives in words that carry
|
|
50
|
+
* their own reading (还给, 归还, 偿还, 还债). 还钱 is a word in the full tier
|
|
51
|
+
* only, since no frequency list counts it, so the standard tier read
|
|
52
|
+
* 我得去银行还钱 as `hái qián`. See {@link RETURNED} for the objects.
|
|
53
|
+
*
|
|
54
|
+
* An untagged pair ending in 还 is taken off the lattice where it reads the 还
|
|
55
|
+
* `hái`, for the reason {@link TEACHING_JIAO} gives. 倒还 is a key the full
|
|
56
|
+
* tier holds with no part of speech.
|
|
57
|
+
*
|
|
58
|
+
* Over 88,866 lines of Tatoeba and zh.wikipedia and both CPP splits, this
|
|
59
|
+
* moves 5 decodes in the standard tier and all 5 are corrections (還錢 three
|
|
60
|
+
* times, 还钱 and 還書). Each now reads what the full tier reads through the
|
|
61
|
+
* word. Nothing moves in the full tier.
|
|
62
|
+
*/
|
|
63
|
+
export const RETURNING_HUAN = {
|
|
64
|
+
name: "returning-huan",
|
|
65
|
+
verdictFor: (context) => {
|
|
66
|
+
const { edge } = context;
|
|
67
|
+
if (RETURNING.has(edge.text)) {
|
|
68
|
+
return isHuan(edge.reading[0]) && isReturningAt(context, edge.from)
|
|
69
|
+
? "force"
|
|
70
|
+
: "keep";
|
|
71
|
+
}
|
|
72
|
+
return edge.partOfSpeech === "" &&
|
|
73
|
+
RETURNING.has(toCharacters(edge.text).at(-1) ?? "") &&
|
|
74
|
+
edge.reading.length === edge.to - edge.from &&
|
|
75
|
+
!isHuan(edge.reading.at(-1)) &&
|
|
76
|
+
isReturningAt(context, edge.to -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AK,EAAE,CACvE,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAa;IACtC,IAAI,EAAE,gBAAgB;IACtB,UAAU,EAAE,CAAC,OAAoB,EAAE,EAAE;QACnC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QACzB,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7B,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC;gBACjE,CAAC,CAAC,OAAO;gBACT,CAAC,CAAC,MAAM,CAAC;QACb,CAAC;QACD,OAAO,IAAI,CAAC,YAAY,KAAK,EAAE;YAC7B,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YACnD,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI;YAC3C,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5B,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;YACnC,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,MAAM,CAAC;IACb,CAAC;CACF,CAAC"}
|
|
@@ -3,6 +3,8 @@ export { TAXI_DI } from "./taxi-rule.js";
|
|
|
3
3
|
export { EXPERIENTIAL_GUO } from "./guo-rule.js";
|
|
4
4
|
export { TEACHING_JIAO } from "./jiao-rule.js";
|
|
5
5
|
export { SEPARATED_COMPOUND } from "./split-rule.js";
|
|
6
|
+
export { RETURNING_HUAN } from "./huan-rule.js";
|
|
7
|
+
export { REDUPLICATED_VERB } from "./reduplication-rule.js";
|
|
6
8
|
import { type EdgeRule } from "./rules.js";
|
|
7
9
|
/**
|
|
8
10
|
* 儿 does not stand on its own where the dictionary attests the 儿化.
|
|
@@ -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":"AASA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAEL,KAAK,QAAQ,EAGd,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,cAAc,EAAE,QAY5B,CAAC;AAsCF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,eAAe,EAAE,QAuB7B,CAAC;AAIF,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,QAAQ,EAc5C,CAAC"}
|
|
@@ -4,11 +4,15 @@ import { TAXI_DI } from "./taxi-rule.js";
|
|
|
4
4
|
import { EXPERIENTIAL_GUO } from "./guo-rule.js";
|
|
5
5
|
import { TEACHING_JIAO } from "./jiao-rule.js";
|
|
6
6
|
import { SEPARATED_COMPOUND } from "./split-rule.js";
|
|
7
|
+
import { RETURNING_HUAN } from "./huan-rule.js";
|
|
8
|
+
import { REDUPLICATED_VERB } from "./reduplication-rule.js";
|
|
7
9
|
export { MODAL_DE, PARTICLE_DE, POTENTIAL_DE } from "./de-rule.js";
|
|
8
10
|
export { TAXI_DI } from "./taxi-rule.js";
|
|
9
11
|
export { EXPERIENTIAL_GUO } from "./guo-rule.js";
|
|
10
12
|
export { TEACHING_JIAO } from "./jiao-rule.js";
|
|
11
13
|
export { SEPARATED_COMPOUND } from "./split-rule.js";
|
|
14
|
+
export { RETURNING_HUAN } from "./huan-rule.js";
|
|
15
|
+
export { REDUPLICATED_VERB } from "./reduplication-rule.js";
|
|
12
16
|
import { toCharacters } from "../script/characters.js";
|
|
13
17
|
import { tagOf, wordEndingAt, } from "./rules.js";
|
|
14
18
|
/**
|
|
@@ -144,5 +148,7 @@ export const READING_RULES = [
|
|
|
144
148
|
PLAYING_TAN,
|
|
145
149
|
EXPERIENTIAL_GUO,
|
|
146
150
|
SEPARATED_COMPOUND,
|
|
151
|
+
REDUPLICATED_VERB,
|
|
152
|
+
RETURNING_HUAN,
|
|
147
153
|
];
|
|
148
154
|
//# 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,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"reading-rules.js","sourceRoot":"","sources":["../../src/decode/reading-r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|
|
1
|
+
import { type EdgeRule } from "./rules.js";
|
|
2
|
+
/**
|
|
3
|
+
* A verb said twice around 了 or 一 takes its verbal reading on both halves.
|
|
4
|
+
*
|
|
5
|
+
* 数 is stored `shù`, the noun, with `shǔ` as an alternate. 数数 is a word and
|
|
6
|
+
* reads `shǔshù`. Put 了 between the halves and the word is gone, so 他数了数
|
|
7
|
+
* 桌上的数字 came out `shù le shù`. The full tier holds 数一数 as a word and
|
|
8
|
+
* the standard tier does not, so 数一数 went the same way there.
|
|
9
|
+
*
|
|
10
|
+
* The same shape split other verbs down the middle. 弹了弹 read `tán le dàn`,
|
|
11
|
+
* because the 弹 rule saw the 了 after the first half and nothing after the
|
|
12
|
+
* second. 教了教 read `jiāo le jiào` for the same reason. See
|
|
13
|
+
* {@link VERBAL_READINGS} for the characters and {@link reduplicatedAt} for
|
|
14
|
+
* the shapes turned away.
|
|
15
|
+
*
|
|
16
|
+
* Over 88,866 lines of Tatoeba and zh.wikipedia, A了A and A一A appear 107
|
|
17
|
+
* times with an AA key behind them, across 43 shapes led by 想一想, 看了看 and
|
|
18
|
+
* 看一看. None of them is one of these characters, and every one already read
|
|
19
|
+
* both halves alike. Across those lines and both CPP splits, the rule moves no
|
|
20
|
+
* decode in either tier.
|
|
21
|
+
*/
|
|
22
|
+
export declare const REDUPLICATED_VERB: EdgeRule;
|
|
23
|
+
//# sourceMappingURL=reduplication-rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reduplication-rule.d.ts","sourceRoot":"","sources":["../../src/decode/reduplication-rule.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,QAAQ,EAId,MAAM,YAAY,CAAC;AAqIpB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAc/B,CAAC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a verb is read when it is said twice with 了 or 一 between.
|
|
3
|
+
*
|
|
4
|
+
* 数了数 and 数一数 are one verb said twice. Each half is a character of its
|
|
5
|
+
* own to the lattice, and each falls back on the character's default.
|
|
6
|
+
*/
|
|
7
|
+
import { isSameSyllable } from "../dictionary/entry.js";
|
|
8
|
+
import { QUANTITY_CHARACTERS } from "../numerals/characters.js";
|
|
9
|
+
import { toCharacters } from "../script/characters.js";
|
|
10
|
+
import { readSyllable } from "../syllable/syllable.js";
|
|
11
|
+
import { tagOf, wordsEndingAt, wordsStartingAt, } from "./rules.js";
|
|
12
|
+
/**
|
|
13
|
+
* What can stand between the halves of a reduplicated verb.
|
|
14
|
+
*
|
|
15
|
+
* 看了看 is the completed form and 看一看 the tentative one. Both are verbal
|
|
16
|
+
* shapes. A noun or a 量词 repeats with 一 as well (一天一天, 一种一种), and
|
|
17
|
+
* {@link reduplicatedAt} turns that shape away by the numeral in front.
|
|
18
|
+
*/
|
|
19
|
+
const INFIX = new Set(["了", "一"]);
|
|
20
|
+
/**
|
|
21
|
+
* The polyphones whose verbal reading is not their default.
|
|
22
|
+
*
|
|
23
|
+
* The default is the reading a character takes in most text. For these that
|
|
24
|
+
* reading is a noun (数 `shù`, 种 `zhǒng`), an adjective (凉 `liáng`) or the
|
|
25
|
+
* reading their compounds take (教 `jiào`, 弹 `dàn`, 削 `xuē`). A
|
|
26
|
+
* reduplicated character is a verb, and the verbal reading is the one it
|
|
27
|
+
* wants.
|
|
28
|
+
*
|
|
29
|
+
* 卷 is in for its tail. Its default is already `juǎn`, and 卷一卷 read the
|
|
30
|
+
* second half `juàn` off 一卷, a word the dictionary tags `m`.
|
|
31
|
+
*
|
|
32
|
+
* Written out by hand because the dictionary has no tag per reading. The
|
|
33
|
+
* nearest thing it holds is the reduplicated word itself, and that is the
|
|
34
|
+
* wrong evidence. Of the 19 AA keys in the standard tier whose first syllable
|
|
35
|
+
* differs from the character's default, 数数 (in both scripts) is the only
|
|
36
|
+
* verb said twice. The rest are literary reduplicatives (查查 `zhāzhā`, 拜拜 `báibái`, 累累
|
|
37
|
+
* `léiléi`), and reading 查一查 off 查查 would turn a correct `chá` into `zhā`.
|
|
38
|
+
*/
|
|
39
|
+
const VERBAL_READINGS = new Map([
|
|
40
|
+
["数", "shǔ"],
|
|
41
|
+
["數", "shǔ"],
|
|
42
|
+
["凉", "liàng"],
|
|
43
|
+
["涼", "liàng"],
|
|
44
|
+
["种", "zhòng"],
|
|
45
|
+
["種", "zhòng"],
|
|
46
|
+
["教", "jiāo"],
|
|
47
|
+
["弹", "tán"],
|
|
48
|
+
["彈", "tán"],
|
|
49
|
+
["卷", "juǎn"],
|
|
50
|
+
["削", "xiāo"],
|
|
51
|
+
].map(([character, text]) => {
|
|
52
|
+
const syllable = readSyllable(text);
|
|
53
|
+
/* c8 ignore next 3 -- every reading above is a syllable */
|
|
54
|
+
if (syllable === undefined) {
|
|
55
|
+
throw new Error(`${text} is not a syllable`);
|
|
56
|
+
}
|
|
57
|
+
return [character, syllable];
|
|
58
|
+
}));
|
|
59
|
+
/**
|
|
60
|
+
* Whether a tagged word of more than one character starts or ends at a
|
|
61
|
+
* position.
|
|
62
|
+
*/
|
|
63
|
+
function isInTaggedWord(words, context) {
|
|
64
|
+
return words.some((word) => toCharacters(word).length > 1 && tagOf(context, word) !== "");
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Where the reduplication covering a position starts, or undefined.
|
|
68
|
+
*
|
|
69
|
+
* The position is either half. Three things turn the shape away. A numeral in
|
|
70
|
+
* front makes it a count said twice (一种一种, 一卷一卷). A tagged word ending
|
|
71
|
+
* at the first half claims that half (多数一数 holds 多数). A tagged word
|
|
72
|
+
* starting at the second half claims that one, and that is how 数了数字 keeps
|
|
73
|
+
* 数字 `shùzì`.
|
|
74
|
+
*/
|
|
75
|
+
function reduplicatedAt(context, at) {
|
|
76
|
+
const { characters } = context;
|
|
77
|
+
const character = characters[at] ?? "";
|
|
78
|
+
let head;
|
|
79
|
+
if (INFIX.has(characters[at + 1] ?? "") && characters[at + 2] === character) {
|
|
80
|
+
head = at;
|
|
81
|
+
}
|
|
82
|
+
else if (INFIX.has(characters[at - 1] ?? "") &&
|
|
83
|
+
characters[at - 2] === character) {
|
|
84
|
+
head = at - 2;
|
|
85
|
+
}
|
|
86
|
+
if (head === undefined ||
|
|
87
|
+
QUANTITY_CHARACTERS.has(characters[head - 1] ?? "") ||
|
|
88
|
+
isInTaggedWord(wordsEndingAt(context, head + 1), context) ||
|
|
89
|
+
isInTaggedWord(wordsStartingAt(context, head + 2), context)) {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
return head;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The syllable a reduplication gives the character at a position, or
|
|
96
|
+
* undefined where it gives none.
|
|
97
|
+
*/
|
|
98
|
+
function verbalSyllableAt(context, at) {
|
|
99
|
+
const verbal = VERBAL_READINGS.get(context.characters[at] ?? "");
|
|
100
|
+
if (verbal === undefined) {
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
return reduplicatedAt(context, at) === undefined ? undefined : verbal;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Whether an edge longer than one character reads either half another way.
|
|
107
|
+
*
|
|
108
|
+
* 一卷 reaches into the second half of 卷一卷, and the decode read it
|
|
109
|
+
* `juǎn yíjuàn` through that word. The full tier's 数一数 is `shǔ yī shù`, and
|
|
110
|
+
* that reading of the second half goes too. The rule reads it `shǔ yì shǔ`.
|
|
111
|
+
*/
|
|
112
|
+
function readsAgainst(context) {
|
|
113
|
+
const { edge } = context;
|
|
114
|
+
if (edge.reading.length !== edge.to - edge.from) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
return edge.reading.some((syllable, offset) => {
|
|
118
|
+
const said = verbalSyllableAt(context, edge.from + offset);
|
|
119
|
+
return said !== undefined && !isSameSyllable(syllable, said);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* A verb said twice around 了 or 一 takes its verbal reading on both halves.
|
|
124
|
+
*
|
|
125
|
+
* 数 is stored `shù`, the noun, with `shǔ` as an alternate. 数数 is a word and
|
|
126
|
+
* reads `shǔshù`. Put 了 between the halves and the word is gone, so 他数了数
|
|
127
|
+
* 桌上的数字 came out `shù le shù`. The full tier holds 数一数 as a word and
|
|
128
|
+
* the standard tier does not, so 数一数 went the same way there.
|
|
129
|
+
*
|
|
130
|
+
* The same shape split other verbs down the middle. 弹了弹 read `tán le dàn`,
|
|
131
|
+
* because the 弹 rule saw the 了 after the first half and nothing after the
|
|
132
|
+
* second. 教了教 read `jiāo le jiào` for the same reason. See
|
|
133
|
+
* {@link VERBAL_READINGS} for the characters and {@link reduplicatedAt} for
|
|
134
|
+
* the shapes turned away.
|
|
135
|
+
*
|
|
136
|
+
* Over 88,866 lines of Tatoeba and zh.wikipedia, A了A and A一A appear 107
|
|
137
|
+
* times with an AA key behind them, across 43 shapes led by 想一想, 看了看 and
|
|
138
|
+
* 看一看. None of them is one of these characters, and every one already read
|
|
139
|
+
* both halves alike. Across those lines and both CPP splits, the rule moves no
|
|
140
|
+
* decode in either tier.
|
|
141
|
+
*/
|
|
142
|
+
export const REDUPLICATED_VERB = {
|
|
143
|
+
name: "reduplicated-verb",
|
|
144
|
+
verdictFor: (context) => {
|
|
145
|
+
const { edge } = context;
|
|
146
|
+
if (edge.to - edge.from !== 1) {
|
|
147
|
+
return readsAgainst(context) ? "forbid" : "keep";
|
|
148
|
+
}
|
|
149
|
+
const said = verbalSyllableAt(context, edge.from);
|
|
150
|
+
const here = edge.reading[0];
|
|
151
|
+
if (said === undefined || here === undefined) {
|
|
152
|
+
return "keep";
|
|
153
|
+
}
|
|
154
|
+
return isSameSyllable(here, said) ? "force" : "keep";
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
//# sourceMappingURL=reduplication-rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reduplication-rule.js","sourceRoot":"","sources":["../../src/decode/reduplication-rule.ts"],"names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CAAC;QACnD,CAAC;QACD,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAClD,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YAC7C,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IACvD,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the syllables group, and the two things sandhi reads out of a grouping.
|
|
3
|
+
*
|
|
4
|
+
* Third-tone sandhi wants the junctions, since its domain is the prosodic foot
|
|
5
|
+
* and a foot is built from structure. 一 wants the word ends, since a 一 that
|
|
6
|
+
* closes a longer word counts nothing after it. Both are answered here so that
|
|
7
|
+
* `sandhi.ts` holds the rules rather than the bookkeeping.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* How the syllables group, for sandhi to read.
|
|
11
|
+
*
|
|
12
|
+
* One entry per word: its syllable count, or the counts of the constituents it
|
|
13
|
+
* divides into. 老板 很 好 is `[2, 1, 1]` and 纸老虎 is `[[1, 2]]`.
|
|
14
|
+
*
|
|
15
|
+
* Third-tone sandhi's domain is the prosodic foot rather than the word, and the
|
|
16
|
+
* foot is built from structure — which is why this is worth carrying. See
|
|
17
|
+
* {@link import("./sandhi.js").applySandhi}.
|
|
18
|
+
*/
|
|
19
|
+
export type SandhiGrouping = readonly (number | readonly number[])[];
|
|
20
|
+
/**
|
|
21
|
+
* Where sandhi may apply, as the index of the syllable that would lower.
|
|
22
|
+
*
|
|
23
|
+
* Every junction is between adjacent syllables — words and their constituents
|
|
24
|
+
* cover the reading end to end — so one index says all of it, and the three
|
|
25
|
+
* lists are the three passes third-tone sandhi makes.
|
|
26
|
+
*/
|
|
27
|
+
export interface SandhiJunctions {
|
|
28
|
+
/** Inside a constituent. */
|
|
29
|
+
readonly inner: readonly number[];
|
|
30
|
+
/** Between the constituents of a word. */
|
|
31
|
+
readonly parts: readonly number[];
|
|
32
|
+
/** Between a single-syllable word and the word after it. */
|
|
33
|
+
readonly words: readonly number[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Read a grouping as the junctions it puts in the syllable array.
|
|
37
|
+
*
|
|
38
|
+
* The whole array is treated as one undivided word where no grouping is given,
|
|
39
|
+
* or where the one given does not account for exactly the syllables there are —
|
|
40
|
+
* a grouping that does not fit is describing some other text, and guessing
|
|
41
|
+
* which syllables it meant would be worse than ignoring it.
|
|
42
|
+
*/
|
|
43
|
+
export declare function junctionsOf(length: number, grouping?: SandhiGrouping): SandhiJunctions;
|
|
44
|
+
/**
|
|
45
|
+
* Where a word of more than one syllable ends, as indices into the array.
|
|
46
|
+
*
|
|
47
|
+
* Empty without a grouping, and empty for a grouping that does not fit, which
|
|
48
|
+
* is the judgement {@link junctionsOf} makes and for the same reason.
|
|
49
|
+
*
|
|
50
|
+
* A one-syllable word is deliberately not an ending here. 一 on its own is a
|
|
51
|
+
* word and it counts the word after it: see
|
|
52
|
+
* {@link import("./sandhi.js").applySandhi}.
|
|
53
|
+
*/
|
|
54
|
+
export declare function endingsOf(length: number, grouping?: SandhiGrouping): ReadonlySet<number>;
|
|
55
|
+
//# sourceMappingURL=sandhi-grouping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandhi-grouping.d.ts","sourceRoot":"","sources":["../../src/decode/sandhi-grouping.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC;AAErE;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,4BAA4B;IAC5B,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,0CAA0C;IAC1C,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AASD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,cAAc,GACxB,eAAe,CAiCjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,cAAc,GACxB,WAAW,CAAC,MAAM,CAAC,CAerB"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the syllables group, and the two things sandhi reads out of a grouping.
|
|
3
|
+
*
|
|
4
|
+
* Third-tone sandhi wants the junctions, since its domain is the prosodic foot
|
|
5
|
+
* and a foot is built from structure. 一 wants the word ends, since a 一 that
|
|
6
|
+
* closes a longer word counts nothing after it. Both are answered here so that
|
|
7
|
+
* `sandhi.ts` holds the rules rather than the bookkeeping.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The syllable counts one grouping entry holds, as a flat list of its parts.
|
|
11
|
+
*/
|
|
12
|
+
function partsOf(word) {
|
|
13
|
+
return typeof word === "number" ? [word] : word;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Read a grouping as the junctions it puts in the syllable array.
|
|
17
|
+
*
|
|
18
|
+
* The whole array is treated as one undivided word where no grouping is given,
|
|
19
|
+
* or where the one given does not account for exactly the syllables there are —
|
|
20
|
+
* a grouping that does not fit is describing some other text, and guessing
|
|
21
|
+
* which syllables it meant would be worse than ignoring it.
|
|
22
|
+
*/
|
|
23
|
+
export function junctionsOf(length, grouping) {
|
|
24
|
+
const undivided = {
|
|
25
|
+
inner: Array.from({ length: Math.max(length - 1, 0) }, (_, at) => at),
|
|
26
|
+
parts: [],
|
|
27
|
+
words: [],
|
|
28
|
+
};
|
|
29
|
+
if (grouping === undefined) {
|
|
30
|
+
return undivided;
|
|
31
|
+
}
|
|
32
|
+
const inner = [];
|
|
33
|
+
const parts = [];
|
|
34
|
+
const words = [];
|
|
35
|
+
let at = 0;
|
|
36
|
+
for (const [index, word] of grouping.entries()) {
|
|
37
|
+
const divisions = partsOf(word);
|
|
38
|
+
const from = at;
|
|
39
|
+
for (const [division, size] of divisions.entries()) {
|
|
40
|
+
for (let step = 1; step < size; step++) {
|
|
41
|
+
inner.push(at + step - 1);
|
|
42
|
+
}
|
|
43
|
+
at += size;
|
|
44
|
+
// The junction closing a word's last constituent is the one *around* the
|
|
45
|
+
// word rather than one inside it.
|
|
46
|
+
if (division < divisions.length - 1) {
|
|
47
|
+
parts.push(at - 1);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (at - from === 1 && index < grouping.length - 1) {
|
|
51
|
+
words.push(at - 1);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return at === length ? { inner, parts, words } : undivided;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Where a word of more than one syllable ends, as indices into the array.
|
|
58
|
+
*
|
|
59
|
+
* Empty without a grouping, and empty for a grouping that does not fit, which
|
|
60
|
+
* is the judgement {@link junctionsOf} makes and for the same reason.
|
|
61
|
+
*
|
|
62
|
+
* A one-syllable word is deliberately not an ending here. 一 on its own is a
|
|
63
|
+
* word and it counts the word after it: see
|
|
64
|
+
* {@link import("./sandhi.js").applySandhi}.
|
|
65
|
+
*/
|
|
66
|
+
export function endingsOf(length, grouping) {
|
|
67
|
+
const endings = new Set();
|
|
68
|
+
if (grouping === undefined) {
|
|
69
|
+
return endings;
|
|
70
|
+
}
|
|
71
|
+
let at = 0;
|
|
72
|
+
for (const word of grouping) {
|
|
73
|
+
const size = partsOf(word).reduce((total, part) => total + part, 0);
|
|
74
|
+
at += size;
|
|
75
|
+
if (size > 1) {
|
|
76
|
+
endings.add(at - 1);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return at === length ? endings : new Set();
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=sandhi-grouping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandhi-grouping.js","sourceRoot":"","sources":["../../src/decode/sandhi-grouping.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA8BH;;GAEG;AACH,SAAS,OAAO,CAAC,IAAgC;IAC/C,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAClD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CACzB,MAAc,EACd,QAAyB;IAEzB,MAAM,SAAS,GAAoB;QACjC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;QACrE,KAAK,EAAE,EAAE;QACT,KAAK,EAAE,EAAE;KACV,CAAC;IACF,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,EAAE,GAAG,CAAC,CAAC;IACX,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;QAC/C,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,IAAI,GAAG,EAAE,CAAC;QAChB,KAAK,MAAM,CAAC,QAAQ,EAAE,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I,GAAG,CAAC,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What the sandhi pass needs from a decoded run, beyond the syllables.
|
|
3
3
|
*
|
|
4
|
-
* Two questions sandhi cannot answer from a reading alone.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* is a
|
|
8
|
-
* the syllable array does not.
|
|
4
|
+
* Two questions sandhi cannot answer from a reading alone. Where the words and
|
|
5
|
+
* their parts are, which third-tone sandhi needs for the prosodic foot it
|
|
6
|
+
* applies inside and 一 needs for the word ends. And which 汉字 each syllable
|
|
7
|
+
* reads, which is what says a `yī` is 一 rather than 医 and what stands in front
|
|
8
|
+
* of it. Both are things the decode knows and the syllable array does not.
|
|
9
9
|
*/
|
|
10
10
|
import type { Dictionary } from "../dictionary/dictionary.js";
|
|
11
11
|
import type { Syllable } from "../syllable/syllable.js";
|
|
12
12
|
import type { SandhiGrouping } from "./sandhi.js";
|
|
13
13
|
import type { ScoredWord } from "./word.js";
|
|
14
14
|
/**
|
|
15
|
-
* Where the words and their constituents fall
|
|
15
|
+
* Where the words and their constituents fall.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* One entry per word always, because 一 sandhi reads the word ends: a 一 that
|
|
18
|
+
* closes a longer word is not counting the word after it, so 唯一 stays `wéiyī`
|
|
19
|
+
* in front of anything.
|
|
20
|
+
*
|
|
21
|
+
* Where a word *divides* is only worked out for third-tone sandhi, which is the
|
|
22
|
+
* only pass that reads it and costs a dictionary lookup per word to answer.
|
|
19
23
|
*/
|
|
20
|
-
export declare function groupingOf(dictionary: Dictionary, words: readonly ScoredWord[], readings: readonly (readonly Syllable[])[], isThirdTone: boolean): SandhiGrouping
|
|
24
|
+
export declare function groupingOf(dictionary: Dictionary, words: readonly ScoredWord[], readings: readonly (readonly Syllable[])[], isThirdTone: boolean): SandhiGrouping;
|
|
21
25
|
/**
|
|
22
26
|
* One 汉字 per syllable, where a word offers one.
|
|
23
27
|
*
|
|
24
28
|
* A word whose reading is a different length from its text — 玩儿 as `wánr` —
|
|
25
29
|
* has no character to give any one of its syllables, so its syllables get none
|
|
26
30
|
* and the pass falls back to their spellings. See
|
|
31
|
+
* {@link import("./sandhi-tones.js").isYi} and
|
|
27
32
|
* {@link import("./sandhi-tones.js").isCounting}.
|
|
28
33
|
*/
|
|
29
34
|
export declare function charactersPerSyllable(words: readonly ScoredWord[], readings: readonly (readonly Syllable[])[]): readonly (string | undefined)[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandhi-input.d.ts","sourceRoot":"","sources":["../../src/decode/sandhi-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C
|
|
1
|
+
{"version":3,"file":"sandhi-input.d.ts","sourceRoot":"","sources":["../../src/decode/sandhi-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACxB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,QAAQ,EAAE,SAAS,CAAC,SAAS,QAAQ,EAAE,CAAC,EAAE,EAC1C,WAAW,EAAE,OAAO,GACnB,cAAc,CAQhB;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,QAAQ,EAAE,SAAS,CAAC,SAAS,QAAQ,EAAE,CAAC,EAAE,GACzC,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAQjC"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { toCharacters } from "../script/characters.js";
|
|
2
2
|
import { divisionOf } from "./constituents.js";
|
|
3
3
|
/**
|
|
4
|
-
* Where the words and their constituents fall
|
|
4
|
+
* Where the words and their constituents fall.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* One entry per word always, because 一 sandhi reads the word ends: a 一 that
|
|
7
|
+
* closes a longer word is not counting the word after it, so 唯一 stays `wéiyī`
|
|
8
|
+
* in front of anything.
|
|
9
|
+
*
|
|
10
|
+
* Where a word *divides* is only worked out for third-tone sandhi, which is the
|
|
11
|
+
* only pass that reads it and costs a dictionary lookup per word to answer.
|
|
8
12
|
*/
|
|
9
13
|
export function groupingOf(dictionary, words, readings, isThirdTone) {
|
|
10
|
-
if (!isThirdTone) {
|
|
11
|
-
return undefined;
|
|
12
|
-
}
|
|
13
14
|
return words.map((scored, index) => {
|
|
14
15
|
const reading = readings[index] ?? [];
|
|
16
|
+
if (!isThirdTone) {
|
|
17
|
+
return reading.length;
|
|
18
|
+
}
|
|
15
19
|
return divisionOf(dictionary, scored.word.text, reading) ?? reading.length;
|
|
16
20
|
});
|
|
17
21
|
}
|
|
@@ -21,6 +25,7 @@ export function groupingOf(dictionary, words, readings, isThirdTone) {
|
|
|
21
25
|
* A word whose reading is a different length from its text — 玩儿 as `wánr` —
|
|
22
26
|
* has no character to give any one of its syllables, so its syllables get none
|
|
23
27
|
* and the pass falls back to their spellings. See
|
|
28
|
+
* {@link import("./sandhi-tones.js").isYi} and
|
|
24
29
|
* {@link import("./sandhi-tones.js").isCounting}.
|
|
25
30
|
*/
|
|
26
31
|
export function charactersPerSyllable(words, readings) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandhi-input.js","sourceRoot":"","sources":["../../src/decode/sandhi-input.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C
|
|
1
|
+
{"version":3,"file":"sandhi-input.js","sourceRoot":"","sources":["../../src/decode/sandhi-input.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CACxB,UAAsB,EACtB,KAA4B,EAC5B,QAA0C,EAC1C,WAAoB;IAEpB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;QACjC,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QACtC,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO,OAAO,CAAC,MAAM,CAAC;QACxB,CAAC;QACD,OAAO,UAAU,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC;IAC7E,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAA4B,EAC5B,QAA0C;IAE1C,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,KAAK,EAAmC,EAAE;QACtE,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,OAAO,IAAI,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM;YACnC,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,KAAK,CAAC,IAAI,CAAqB,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -7,13 +7,29 @@
|
|
|
7
7
|
import { type Syllable } from "../syllable/syllable.js";
|
|
8
8
|
import { type Tone } from "../tone/tone.js";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* The 汉字 一.
|
|
11
11
|
*/
|
|
12
|
-
export declare
|
|
12
|
+
export declare const YI_CHARACTER = "\u4E00";
|
|
13
|
+
/**
|
|
14
|
+
* The 汉字 不.
|
|
15
|
+
*/
|
|
16
|
+
export declare const BU_CHARACTER = "\u4E0D";
|
|
17
|
+
/**
|
|
18
|
+
* Whether a syllable is 一.
|
|
19
|
+
*
|
|
20
|
+
* **Answered from the 汉字 where the caller has one**, and from the spelling
|
|
21
|
+
* where it does not, the way {@link isCounting} is. The spelling is not the
|
|
22
|
+
* morpheme and never was: 医, 依, 衣 and 伊 are all `yī` and none of them
|
|
23
|
+
* changes tone for what follows it. This rule is a fact about one character.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isYi(syllable: Syllable, character?: string): boolean;
|
|
13
26
|
/**
|
|
14
27
|
* Whether a syllable is 不.
|
|
28
|
+
*
|
|
29
|
+
* Read from the 汉字 or the spelling on the same terms as {@link isYi}, and for
|
|
30
|
+
* the same reason: 部, 布, 步 and 埠 are all `bù` and none of them flattens.
|
|
15
31
|
*/
|
|
16
|
-
export declare function isBu(syllable: Syllable): boolean;
|
|
32
|
+
export declare function isBu(syllable: Syllable, character?: string): boolean;
|
|
17
33
|
/**
|
|
18
34
|
* The tone 一 takes before a given following tone.
|
|
19
35
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandhi-tones.d.ts","sourceRoot":"","sources":["../../src/decode/sandhi-tones.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,KAAK,QAAQ,EAAyB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAgB,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE1D;;GAEG;AACH,wBAAgB,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"sandhi-tones.d.ts","sourceRoot":"","sources":["../../src/decode/sandhi-tones.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,KAAK,QAAQ,EAAyB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAgB,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,YAAY,WAAM,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,YAAY,WAAM,CAAC;AAEhC;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAIpE;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAIpE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI,CAK9D;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,aAAyC,CAAC;AAEpE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,aAAsC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,aAS7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,2BAA2B,aAItC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB,WAAM,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,UAAU,CACxB,SAAS,EAAE,SAAS,QAAQ,EAAE,EAC9B,EAAE,EAAE,MAAM,EACV,UAAU,GAAE,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAO,GAC/C,OAAO,CAwBT"}
|
|
@@ -7,16 +7,36 @@
|
|
|
7
7
|
import { writeSyllableSpelling } from "../syllable/syllable.js";
|
|
8
8
|
import { NEUTRAL_TONE } from "../tone/tone.js";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* The 汉字 一.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
13
|
-
|
|
12
|
+
export const YI_CHARACTER = "一";
|
|
13
|
+
/**
|
|
14
|
+
* The 汉字 不.
|
|
15
|
+
*/
|
|
16
|
+
export const BU_CHARACTER = "不";
|
|
17
|
+
/**
|
|
18
|
+
* Whether a syllable is 一.
|
|
19
|
+
*
|
|
20
|
+
* **Answered from the 汉字 where the caller has one**, and from the spelling
|
|
21
|
+
* where it does not, the way {@link isCounting} is. The spelling is not the
|
|
22
|
+
* morpheme and never was: 医, 依, 衣 and 伊 are all `yī` and none of them
|
|
23
|
+
* changes tone for what follows it. This rule is a fact about one character.
|
|
24
|
+
*/
|
|
25
|
+
export function isYi(syllable, character) {
|
|
26
|
+
return character === undefined
|
|
27
|
+
? syllable.initial === "" && syllable.final === "i"
|
|
28
|
+
: character === YI_CHARACTER;
|
|
14
29
|
}
|
|
15
30
|
/**
|
|
16
31
|
* Whether a syllable is 不.
|
|
32
|
+
*
|
|
33
|
+
* Read from the 汉字 or the spelling on the same terms as {@link isYi}, and for
|
|
34
|
+
* the same reason: 部, 布, 步 and 埠 are all `bù` and none of them flattens.
|
|
17
35
|
*/
|
|
18
|
-
export function isBu(syllable) {
|
|
19
|
-
return
|
|
36
|
+
export function isBu(syllable, character) {
|
|
37
|
+
return character === undefined
|
|
38
|
+
? syllable.initial === "b" && syllable.final === "u"
|
|
39
|
+
: character === BU_CHARACTER;
|
|
20
40
|
}
|
|
21
41
|
/**
|
|
22
42
|
* The tone 一 takes before a given following tone.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandhi-tones.js","sourceRoot":"","sources":["../../src/decode/sandhi-tones.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAiB,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAa,MAAM,iBAAiB,CAAC;AAE1D;;GAEG;AACH,MAAM,UAAU,IAAI,CAAC,QAAkB;
|
|
1
|
+
{"version":3,"file":"sandhi-tones.js","sourceRoot":"","sources":["../../src/decode/sandhi-tones.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAiB,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAa,MAAM,iBAAiB,CAAC;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC;AAEhC;;;;;;;GAOG;AACH,MAAM,UAAU,IAAI,CAAC,QAAkB,EAAE,SAAkB;IACzD,OAAO,SAAS,KAAK,SAAS;QAC5B,CAAC,CAAC,QAAQ,CAAC,OAAO,KAAK,EAAE,IAAI,QAAQ,CAAC,KAAK,KAAK,GAAG;QACnD,CAAC,CAAC,SAAS,KAAK,YAAY,CAAC;AACjC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,IAAI,CAAC,QAAkB,EAAE,SAAkB;IACzD,OAAO,SAAS,KAAK,SAAS;QAC5B,CAAC,CAAC,QAAQ,CAAC,OAAO,KAAK,GAAG,IAAI,QAAQ,CAAC,KAAK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AC,CAAC;QAClC,OAAO,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IACvE,CAAC,CAAC;IACF,MAAM,MAAM,GAAG,UAAU,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IAClC,IACE,MAAM,KAAK,SAAS;QAClB,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,cAAc;QAClC,CAAC,CAAC,MAAM,KAAK,iBAAiB,EAChC,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IACE,MAAM,KAAK,SAAS;QAClB,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,EACnC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,KAAK,GAAG,UAAU,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IACjC,OAAO,KAAK,KAAK,SAAS;QACxB,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QACrC,CAAC,CAAC,2BAA2B,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC7C,CAAC"}
|
package/dist/decode/sandhi.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Syllable } from "../syllable/syllable.js";
|
|
2
|
+
import { type SandhiGrouping } from "./sandhi-grouping.js";
|
|
3
|
+
export type { SandhiGrouping } from "./sandhi-grouping.js";
|
|
2
4
|
/**
|
|
3
5
|
* How much of the sandhi to apply.
|
|
4
6
|
*/
|
|
@@ -19,17 +21,6 @@ export interface SandhiOptions {
|
|
|
19
21
|
*/
|
|
20
22
|
readonly thirdTone?: boolean;
|
|
21
23
|
}
|
|
22
|
-
/**
|
|
23
|
-
* How the syllables group, for third-tone sandhi to read.
|
|
24
|
-
*
|
|
25
|
-
* One entry per word: its syllable count, or the counts of the constituents it
|
|
26
|
-
* divides into. 老板 很 好 is `[2, 1, 1]` and 纸老虎 is `[[1, 2]]`.
|
|
27
|
-
*
|
|
28
|
-
* Sandhi's domain is the prosodic foot rather than the word, and the foot is
|
|
29
|
-
* built from structure — which is why this is worth carrying. See
|
|
30
|
-
* {@link applyThirdTone} for what is done with it.
|
|
31
|
-
*/
|
|
32
|
-
export type SandhiGrouping = readonly (number | readonly number[])[];
|
|
33
24
|
/**
|
|
34
25
|
* Apply the tone sandhi that standard orthography writes.
|
|
35
26
|
*
|
|
@@ -39,14 +30,24 @@ export type SandhiGrouping = readonly (number | readonly number[])[];
|
|
|
39
30
|
* contextual tone is put back, over the whole syllable array rather than within
|
|
40
31
|
* a word, which is what lets 不 in one word assimilate to a tone in the next.
|
|
41
32
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* them
|
|
33
|
+
* A caller holding nothing but a reading can still use this, and several do:
|
|
34
|
+
* `pinyinjs sandhi bùshì` and the numeral reader both hand over syllables and
|
|
35
|
+
* nothing else. `grouping` and `characters` are what a caller that knows more
|
|
36
|
+
* says so with, and each one is read on its own, since a caller can have one
|
|
37
|
+
* and not the other.
|
|
38
|
+
*
|
|
39
|
+
* `characters` holds one 汉字 per syllable, and is what tells 一 and 不 apart
|
|
40
|
+
* from the syllables that merely sound like them — 医生 is `yīshēng` and 部队
|
|
41
|
+
* is `bùduì`. Without it the pass falls back to the spellings, which is all
|
|
42
|
+
* bare pinyin offers. See {@link isYi} and {@link isCounting}.
|
|
43
|
+
*
|
|
44
|
+
* `grouping` says where the words and their parts are. Third-tone sandhi needs
|
|
45
|
+
* it because its domain is the prosodic foot rather than the syllable string,
|
|
46
|
+
* and 一 needs the word ends out of it: a 一 that closes a longer word is not
|
|
47
|
+
* counting the word after it. Without a grouping the whole array is taken for
|
|
48
|
+
* a single word, which is all a bare reading says.
|
|
49
|
+
*
|
|
50
|
+
* 不 is the one rule that needs neither: it assimilates to whatever follows.
|
|
50
51
|
*
|
|
51
52
|
* Never operates on a string. The old project patched output text with regexes,
|
|
52
53
|
* which is what made its rules order-dependent and untestable.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandhi.d.ts","sourceRoot":"","sources":["../../src/decode/sandhi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"sandhi.d.ts","sourceRoot":"","sources":["../../src/decode/sandhi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAG9B,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AA+DD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,SAAS,QAAQ,EAAE,EAC9B,OAAO,GAAE,aAAkB,EAC3B,QAAQ,CAAC,EAAE,cAAc,EACzB,UAAU,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GAC3C,SAAS,QAAQ,EAAE,CAsCrB"}
|
package/dist/decode/sandhi.js
CHANGED
|
@@ -1,45 +1,5 @@
|
|
|
1
|
+
import { endingsOf, junctionsOf, } from "./sandhi-grouping.js";
|
|
1
2
|
import { isBu, isCounting, isYi, yiToneBefore } from "./sandhi-tones.js";
|
|
2
|
-
/**
|
|
3
|
-
* Read a grouping as the junctions it puts in the syllable array.
|
|
4
|
-
*
|
|
5
|
-
* The whole array is treated as one undivided word where no grouping is given,
|
|
6
|
-
* or where the one given does not account for exactly the syllables there are —
|
|
7
|
-
* a grouping that does not fit is describing some other text, and guessing
|
|
8
|
-
* which syllables it meant would be worse than ignoring it.
|
|
9
|
-
*/
|
|
10
|
-
function junctionsOf(length, grouping) {
|
|
11
|
-
const undivided = {
|
|
12
|
-
inner: Array.from({ length: Math.max(length - 1, 0) }, (_, at) => at),
|
|
13
|
-
parts: [],
|
|
14
|
-
words: [],
|
|
15
|
-
};
|
|
16
|
-
if (grouping === undefined) {
|
|
17
|
-
return undivided;
|
|
18
|
-
}
|
|
19
|
-
const inner = [];
|
|
20
|
-
const parts = [];
|
|
21
|
-
const words = [];
|
|
22
|
-
let at = 0;
|
|
23
|
-
for (const [index, word] of grouping.entries()) {
|
|
24
|
-
const divisions = typeof word === "number" ? [word] : word;
|
|
25
|
-
const from = at;
|
|
26
|
-
for (const [division, size] of divisions.entries()) {
|
|
27
|
-
for (let step = 1; step < size; step++) {
|
|
28
|
-
inner.push(at + step - 1);
|
|
29
|
-
}
|
|
30
|
-
at += size;
|
|
31
|
-
// The junction closing a word's last constituent is the one *around* the
|
|
32
|
-
// word rather than one inside it.
|
|
33
|
-
if (division < divisions.length - 1) {
|
|
34
|
-
parts.push(at - 1);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if (at - from === 1 && index < grouping.length - 1) {
|
|
38
|
-
words.push(at - 1);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return at === length ? { inner, parts, words } : undivided;
|
|
42
|
-
}
|
|
43
3
|
/**
|
|
44
4
|
* Lower a third tone to a second where the syllable after it is a third too.
|
|
45
5
|
*
|
|
@@ -103,14 +63,24 @@ function applyThirdTone(syllables, grouping) {
|
|
|
103
63
|
* contextual tone is put back, over the whole syllable array rather than within
|
|
104
64
|
* a word, which is what lets 不 in one word assimilate to a tone in the next.
|
|
105
65
|
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* them
|
|
66
|
+
* A caller holding nothing but a reading can still use this, and several do:
|
|
67
|
+
* `pinyinjs sandhi bùshì` and the numeral reader both hand over syllables and
|
|
68
|
+
* nothing else. `grouping` and `characters` are what a caller that knows more
|
|
69
|
+
* says so with, and each one is read on its own, since a caller can have one
|
|
70
|
+
* and not the other.
|
|
71
|
+
*
|
|
72
|
+
* `characters` holds one 汉字 per syllable, and is what tells 一 and 不 apart
|
|
73
|
+
* from the syllables that merely sound like them — 医生 is `yīshēng` and 部队
|
|
74
|
+
* is `bùduì`. Without it the pass falls back to the spellings, which is all
|
|
75
|
+
* bare pinyin offers. See {@link isYi} and {@link isCounting}.
|
|
76
|
+
*
|
|
77
|
+
* `grouping` says where the words and their parts are. Third-tone sandhi needs
|
|
78
|
+
* it because its domain is the prosodic foot rather than the syllable string,
|
|
79
|
+
* and 一 needs the word ends out of it: a 一 that closes a longer word is not
|
|
80
|
+
* counting the word after it. Without a grouping the whole array is taken for
|
|
81
|
+
* a single word, which is all a bare reading says.
|
|
82
|
+
*
|
|
83
|
+
* 不 is the one rule that needs neither: it assimilates to whatever follows.
|
|
114
84
|
*
|
|
115
85
|
* Never operates on a string. The old project patched output text with regexes,
|
|
116
86
|
* which is what made its rules order-dependent and untestable.
|
|
@@ -120,19 +90,28 @@ export function applySandhi(syllables, options = {}, grouping, characters) {
|
|
|
120
90
|
const applied = thirdTone
|
|
121
91
|
? applyThirdTone(syllables, grouping)
|
|
122
92
|
: [...syllables];
|
|
93
|
+
const endings = endingsOf(syllables.length, grouping);
|
|
123
94
|
for (const [at, syllable] of applied.entries()) {
|
|
95
|
+
const character = characters?.[at];
|
|
124
96
|
const following = applied[at + 1];
|
|
125
|
-
if (yiBu && isYi(syllable) && syllable.tone === 1) {
|
|
97
|
+
if (yiBu && isYi(syllable, character) && syllable.tone === 1) {
|
|
126
98
|
// A 一 that is not counting keeps its citation tone, so it is left
|
|
127
99
|
// exactly as the dictionary stored it.
|
|
128
100
|
if (isCounting(applied, at, characters)) {
|
|
129
|
-
|
|
101
|
+
// A 一 closing a longer word counts nothing, because what follows it
|
|
102
|
+
// is outside the word: 唯一 is `wéiyī` whatever comes next, and so are
|
|
103
|
+
// 之一, 统一 and 星期一. The 一 of 一个 is a word of its own, which is
|
|
104
|
+
// why it still assimilates across the boundary.
|
|
105
|
+
const counted = endings.has(at) ? undefined : following;
|
|
106
|
+
applied[at] = { ...syllable, tone: yiToneBefore(counted?.tone) };
|
|
130
107
|
}
|
|
131
108
|
continue;
|
|
132
109
|
}
|
|
133
110
|
// 不 flattens to second tone before a fourth, and is otherwise unchanged.
|
|
111
|
+
// Unlike 一 it keeps assimilating at the end of a word, since what it
|
|
112
|
+
// negates is regularly in the next one: 决不会 is `juébú huì`.
|
|
134
113
|
if (yiBu &&
|
|
135
|
-
isBu(syllable) &&
|
|
114
|
+
isBu(syllable, character) &&
|
|
136
115
|
syllable.tone === 4 &&
|
|
137
116
|
following?.tone === 4) {
|
|
138
117
|
applied[at] = { ...syllable, tone: 2 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandhi.js","sourceRoot":"","sources":["../../src/decode/sandhi.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"sandhi.js","sourceRoot":"","sources":["../../src/decode/sandhi.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,WAAW,GAEZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAyBzE;;;;;;GAMG;AACH,SAAS,KAAK,CAAC,OAAmB,EAAE,EAAU;IAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,EAAE,CAAC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,IAAI,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QAC/C,MAAM,SAAS,GAAG,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;QACnC,MAAM,SAAS,GAAG,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QAElC,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAC7D,kEAAkE;YAClE,uCAAuC;YACvC,IAAI,UAAU,CAAC,OAAO,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,CAAC;gBACxC,oEAAoE;gBACpE,qEAAqE;gBACrE,6DAA6D;gBAC7D,gDAAgD;gBAChD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;gBACxD,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;YACnE,CAAC;YACD,SAAS;QACX,CAAC;QACD,yEAAyE;QACzE,qEAAqE;QACrE,4DAA4D;QAC5D,IACE,IAAI;YACJ,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC;YACzB,QAAQ,CAAC,IAAI,KAAK,CAAC;YACnB,SAAS,EAAE,IAAI,KAAK,CAAC,EACrB,CAAC;YACD,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QACzC,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export type { ReadingProjection, ReadingUnit } from "./decode/locking.js";
|
|
|
51
51
|
export { applyEdgeRules, tagOf, wordEndingAt, wordStartingAt, } from "./decode/rules.js";
|
|
52
52
|
export type { EdgeContext, EdgeRule, EdgeVerdict } from "./decode/rules.js";
|
|
53
53
|
export type { PositionalReading, ReadingHint, ReadingHints, WordReading, } from "./decode/hints.js";
|
|
54
|
-
export { ADJECTIVAL_CHANG, ATTESTED_ERHUA, COUNTED_MEASURE, EXPERIENTIAL_GUO, MODAL_DE, PARTICLE_DE, PLAYING_TAN, POTENTIAL_DE, READING_RULES, SEPARATED_COMPOUND, TAXI_DI, TEACHING_JIAO, } from "./decode/reading-rules.js";
|
|
54
|
+
export { ADJECTIVAL_CHANG, ATTESTED_ERHUA, COUNTED_MEASURE, EXPERIENTIAL_GUO, MODAL_DE, PARTICLE_DE, PLAYING_TAN, POTENTIAL_DE, READING_RULES, REDUPLICATED_VERB, RETURNING_HUAN, SEPARATED_COMPOUND, TAXI_DI, TEACHING_JIAO, } from "./decode/reading-rules.js";
|
|
55
55
|
export { readingCost, shortestPath, spacingCost } from "./decode/viterbi.js";
|
|
56
56
|
export type { CostOf } from "./decode/viterbi.js";
|
|
57
57
|
export type { DecodedWord, ScoredWord, WordSeparator } from "./decode/word.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,aAAa,EACb,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,YAAY,GACb,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,UAAU,GACX,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE5E,OAAO,EACL,WAAW,EACX,SAAS,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AAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,MAAM,EACN,QAAQ,EACR,OAAO,EACP,SAAS,EACT,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EACL,UAAU,EACV,eAAe,EACf,YAAY,EACZ,aAAa,EACb,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EACL,aAAa,EACb,cAAc,EACd,aAAa,GACd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC/E,YAAY,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ export { buildScriptTables } from "./dictionary/script-tables.js";
|
|
|
31
31
|
export { allEdges, buildLattice, cutPoints, READING_CHARGE, } from "./decode/lattice.js";
|
|
32
32
|
export { isSettled, projectReadings, settledUnits, unitsOf, } from "./decode/locking.js";
|
|
33
33
|
export { applyEdgeRules, tagOf, wordEndingAt, wordStartingAt, } from "./decode/rules.js";
|
|
34
|
-
export { ADJECTIVAL_CHANG, ATTESTED_ERHUA, COUNTED_MEASURE, EXPERIENTIAL_GUO, MODAL_DE, PARTICLE_DE, PLAYING_TAN, POTENTIAL_DE, READING_RULES, SEPARATED_COMPOUND, TAXI_DI, TEACHING_JIAO, } from "./decode/reading-rules.js";
|
|
34
|
+
export { ADJECTIVAL_CHANG, ATTESTED_ERHUA, COUNTED_MEASURE, EXPERIENTIAL_GUO, MODAL_DE, PARTICLE_DE, PLAYING_TAN, POTENTIAL_DE, READING_RULES, REDUPLICATED_VERB, RETURNING_HUAN, SEPARATED_COMPOUND, TAXI_DI, TEACHING_JIAO, } from "./decode/reading-rules.js";
|
|
35
35
|
export { readingCost, shortestPath, spacingCost } from "./decode/viterbi.js";
|
|
36
36
|
export { cardinalHanzi, LARGEST_CARDINAL } from "./numerals/cardinal.js";
|
|
37
37
|
export { DIGIT_CHARACTERS, numeralSyllable, QUANTITY_CHARACTERS, UNIT_VALUES, yaoSyllable, } from "./numerals/characters.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,aAAa,EACb,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,YAAY,GACb,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,UAAU,GACX,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGtE,OAAO,EACL,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,SAAS,GACV,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,iBAAiB,EACjB,cAAc,GACf,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAA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8.1",
|
|
4
4
|
"description": "Chinese hanzi to pinyin conversion",
|
|
5
5
|
"repository": "https://github.com/KensioSoftware/pinyinjs",
|
|
6
6
|
"homepage": "https://pinyinjs.dev",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"conventional-changelog-conventionalcommits": "9.3.1",
|
|
70
70
|
"fta-cli": "^3.0.0",
|
|
71
71
|
"jiti": "^2.7.0",
|
|
72
|
-
"oxfmt": "^0.
|
|
72
|
+
"oxfmt": "^0.68.0",
|
|
73
73
|
"oxlint": "^1.77.0",
|
|
74
74
|
"oxlint-tsgolint": "^7.0.2001",
|
|
75
75
|
"semantic-release": "25.0.9",
|