@kensio/pinyinjs 1.2.0 → 1.2.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/CHANGELOG.md CHANGED
@@ -29,6 +29,15 @@ which a dictionary rebuild can change, and the artifact format under `data/`.
29
29
 
30
30
  ### Fixed
31
31
 
32
+ - **A decimal lost the grouping of its counted part.** 一共75.5元 was
33
+ `yígòng qī shí wǔ diǎn wǔ yuán`, with the 75 in loose syllables, and is now
34
+ `yígòng qīshíwǔ diǎn wǔ yuán` — the same word 一共75元 already got. Only what
35
+ follows the 点 is read a digit at a time, and that part is unchanged: 3.14 is
36
+ still `sān diǎn yī sì`, and sandhi still stops at the point.
37
+ - **A decimal point was read as a full stop.** 一共75.5元 came back as
38
+ `Yígòng …`, capitalised as though the text were a sentence, and a conversion
39
+ keeping its digits capitalised again after the point: 我有75.5个。was
40
+ `Wǒ yǒu75.5Gè.` A stop between two digits now ends no sentence.
32
41
  - **Bopomofo wrote the tone mark after the 儿化 ㄦ.** 哪儿 nǎr was `ㄋㄚㄦˇ` and
33
42
  is now `ㄋㄚˇㄦ`: the mark belongs to the nucleus and the suffix is not part of
34
43
  what it marks. A mark written after the ㄦ is still read.
@@ -57,6 +66,34 @@ which a dictionary rebuild can change, and the artifact format under `data/`.
57
66
  size but a symbol the IPA does not have — so the capitals are now dropped for
58
67
  IPA and bopomofo and kept for the three romanisations. `toTranscription`
59
68
  takes `{ capitals: false }` for callers writing their own.
69
+ - **A compound lost the zh-TW reading its own parts carry.** 垃圾分類 read
70
+ `lājīfēnlèi` under `zh-TW`, because CC-CEDICT marks `Taiwan pr.` on 垃圾 and
71
+ 垃圾桶 and on no other compound, and the decoder prefers the longer word — so
72
+ the entry that had the delta was never consulted. 101 compounds now compose
73
+ one from their constituents, 垃圾 accounting for 14 of them and 比肩, 玳瑁,
74
+ 从容, 骨头, 蜗牛 and 说服 for most of the rest. Three guards keep it honest:
75
+ the constituent has to survive segmentation (運行狀況 contains 行狀 but reads
76
+ 運行 + 狀況), it has to be read in the compound exactly as its own entry reads
77
+ it, and it has to be a whole word — never a bare character, since 會's `huǐ`
78
+ would rewrite 三合會 as `sānhéhuǐ` and 3,743 entries would compose that way
79
+ against the 101 that whole words compose.
80
+ - **A character's zh-TW delta was often a choice between its 普通话 senses.**
81
+ 从容地 read `cōngróng dì` and 他都知道 read `tā dū zhīdào` under `zh-TW`,
82
+ because 地 was stored with a Taiwan reading of `dì` and 都 with `dū`. Neither
83
+ is a locale shift: CC-CEDICT lists 地[de5] and 地[di4] as separate entries, so
84
+ `dì` is what 地 reads in 普通话 when it means the ground, and the adverbial
85
+ particle is `de` in Taipei too. A delta the word already has as a 普通话 sense
86
+ is now refused — 71 characters and 3 words lose one, 都, 着, 应, 差, 称, 斗,
87
+ 舍, 薄 and 万 among them — while 和 `hàn`, 期 `qí`, 垃 `lè` and 髮 `fǎ` stay,
88
+ no 普通话 sense reading any of those that way. A `Taiwan pr.` note is also
89
+ only read off a sense matching the reading the entry settled on, which drops
90
+ 16 more: the note on 著's chess-move sense, which reads `zhāo`, had been
91
+ giving the aspect particle 着 a 國語 reading of `zhuó`.
92
+ - **A locale delta overwrote a reading it was not measured against.** The delta
93
+ describes the entry's own 普通话 reading, so a polyphone the decode read some
94
+ other way — 得 forced to the modal `děi` rather than the particle `de` its
95
+ entry stores — now keeps what the decode worked out instead of being rewritten
96
+ from the entry.
60
97
 
61
98
  ### Changed
62
99
 
@@ -130,14 +167,14 @@ decoder internals and the build pipeline.
130
167
 
131
168
  ### Accuracy at 1.0.0
132
169
 
133
- Over the 105-case gold corpus, which is committed to the repository — not to
170
+ Over the 110-case gold corpus, which is committed to the repository — not to
134
171
  the published package — and scored by `pnpm accuracy`:
135
172
 
136
173
  | | lattice | greedy baseline |
137
174
  | ---------------- | --------: | --------------: |
138
- | exact match | **97.1%** | 92.4% |
139
- | reading accuracy | 99.7% | 98.6% |
140
- | spacing (F1) | **99.7%** | 97.0% |
175
+ | exact match | **97.3%** | 90.9% |
176
+ | reading accuracy | 99.7% | 98.7% |
177
+ | spacing (F1) | **99.7%** | 96.3% |
141
178
 
142
179
  Every figure in that table is asserted against the scorer by
143
180
  `src/changelog.test.ts`, because a number nothing executes goes stale — which is