@kensio/pinyinjs 1.1.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 +48 -4
- package/data/core.entries +89 -89
- package/data/full.entries +257 -257
- package/data/manifest.json +6 -6
- package/data/standard.entries +102 -102
- package/dist/cli/commands.d.ts +8 -0
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +6 -1
- package/dist/cli/commands.js.map +1 -1
- package/dist/decode/convert.d.ts.map +1 -1
- package/dist/decode/convert.js +31 -12
- package/dist/decode/convert.js.map +1 -1
- package/dist/dictionary/assertions.d.ts.map +1 -1
- package/dist/dictionary/assertions.js +20 -0
- package/dist/dictionary/assertions.js.map +1 -1
- package/dist/dictionary/locale.d.ts +55 -0
- package/dist/dictionary/locale.d.ts.map +1 -0
- package/dist/dictionary/locale.js +323 -0
- package/dist/dictionary/locale.js.map +1 -0
- package/dist/dictionary/merge.d.ts +3 -1
- package/dist/dictionary/merge.d.ts.map +1 -1
- package/dist/dictionary/merge.js +54 -10
- package/dist/dictionary/merge.js.map +1 -1
- package/dist/format/transcription.d.ts +22 -1
- package/dist/format/transcription.d.ts.map +1 -1
- package/dist/format/transcription.js +6 -2
- package/dist/format/transcription.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/numerals/text.d.ts +5 -4
- package/dist/numerals/text.d.ts.map +1 -1
- package/dist/numerals/text.js +26 -1
- package/dist/numerals/text.js.map +1 -1
- package/dist/orthography/capitals.d.ts.map +1 -1
- package/dist/orthography/capitals.js +25 -8
- package/dist/orthography/capitals.js.map +1 -1
- package/package.json +1 -1
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.
|
|
@@ -50,6 +59,41 @@ which a dictionary rebuild can change, and the artifact format under `data/`.
|
|
|
50
59
|
transcription systems_, which is where its ground truth comes from; the two
|
|
51
60
|
pages differ at the medials, -ang, the empty rhyme and the diphthongs. No
|
|
52
61
|
output changed — the claim did.
|
|
62
|
+
- **`--system ipa` capitalised the IPA.** 我去银行。他姓王。 came out as
|
|
63
|
+
`Uo˨˩˦ ... Tʰa˥ ɕiŋ˥˩ Uaŋ˧˥`, with the sentence capital and the proper noun
|
|
64
|
+
carried over from the pinyin as though a transcription spelled words. IPA
|
|
65
|
+
letters are symbols rather than an alphabet — `[T]` is not `[t]` in a larger
|
|
66
|
+
size but a symbol the IPA does not have — so the capitals are now dropped for
|
|
67
|
+
IPA and bopomofo and kept for the three romanisations. `toTranscription`
|
|
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.
|
|
53
97
|
|
|
54
98
|
### Changed
|
|
55
99
|
|
|
@@ -123,14 +167,14 @@ decoder internals and the build pipeline.
|
|
|
123
167
|
|
|
124
168
|
### Accuracy at 1.0.0
|
|
125
169
|
|
|
126
|
-
Over the
|
|
170
|
+
Over the 110-case gold corpus, which is committed to the repository — not to
|
|
127
171
|
the published package — and scored by `pnpm accuracy`:
|
|
128
172
|
|
|
129
173
|
| | lattice | greedy baseline |
|
|
130
174
|
| ---------------- | --------: | --------------: |
|
|
131
|
-
| exact match | **97.
|
|
132
|
-
| reading accuracy | 99.7% | 98.
|
|
133
|
-
| spacing (F1) | **99.7%** |
|
|
175
|
+
| exact match | **97.3%** | 90.9% |
|
|
176
|
+
| reading accuracy | 99.7% | 98.7% |
|
|
177
|
+
| spacing (F1) | **99.7%** | 96.3% |
|
|
134
178
|
|
|
135
179
|
Every figure in that table is asserted against the scorer by
|
|
136
180
|
`src/changelog.test.ts`, because a number nothing executes goes stale — which is
|