@kensio/pinyinjs 1.7.8 → 1.7.10
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/README.md +18 -2
- package/data/core.entries +2259 -2259
- package/data/core.freq +0 -0
- package/data/full.counts +0 -0
- package/data/full.entries +2289 -2289
- package/data/full.freq +0 -0
- package/data/manifest.json +8 -8
- package/data/standard.entries +2257 -2257
- package/data/standard.freq +0 -0
- package/dist/cli/flag-lists.d.ts +2 -1
- package/dist/cli/flag-lists.d.ts.map +1 -1
- package/dist/cli/flag-lists.js.map +1 -1
- package/dist/cli/format-options.d.ts +5 -1
- package/dist/cli/format-options.d.ts.map +1 -1
- package/dist/cli/format-options.js +9 -2
- package/dist/cli/format-options.js.map +1 -1
- package/dist/cli/html-commands.d.ts.map +1 -1
- package/dist/cli/html-commands.js +15 -3
- package/dist/cli/html-commands.js.map +1 -1
- package/dist/cli/systems.d.ts +15 -43
- package/dist/cli/systems.d.ts.map +1 -1
- package/dist/cli/systems.js +9 -12
- package/dist/cli/systems.js.map +1 -1
- package/dist/decode/guo-rule.d.ts +64 -0
- package/dist/decode/guo-rule.d.ts.map +1 -0
- package/dist/decode/guo-rule.js +138 -0
- package/dist/decode/guo-rule.js.map +1 -0
- package/dist/decode/reading-rules.d.ts +1 -0
- package/dist/decode/reading-rules.d.ts.map +1 -1
- package/dist/decode/reading-rules.js +3 -0
- package/dist/decode/reading-rules.js.map +1 -1
- package/dist/dictionary/artifact.js +2 -2
- package/dist/dictionary/artifact.js.map +1 -1
- package/dist/dictionary/frequency-table.d.ts +103 -0
- package/dist/dictionary/frequency-table.d.ts.map +1 -1
- package/dist/dictionary/frequency-table.js +96 -8
- package/dist/dictionary/frequency-table.js.map +1 -1
- package/dist/dictionary/merge-types.d.ts +12 -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 +11 -1
- package/dist/dictionary/merge.js.map +1 -1
- package/dist/dictionary/name-mass.d.ts +42 -0
- package/dist/dictionary/name-mass.d.ts.map +1 -0
- package/dist/dictionary/name-mass.js +66 -0
- package/dist/dictionary/name-mass.js.map +1 -0
- package/dist/dictionary/proper-noun.d.ts +8 -1
- package/dist/dictionary/proper-noun.d.ts.map +1 -1
- package/dist/dictionary/proper-noun.js +13 -3
- package/dist/dictionary/proper-noun.js.map +1 -1
- package/dist/dictionary/script-pairings.d.ts +12 -0
- package/dist/dictionary/script-pairings.d.ts.map +1 -1
- package/dist/dictionary/script-pairings.js +20 -0
- package/dist/dictionary/script-pairings.js.map +1 -1
- package/dist/dictionary/traditional-carry.d.ts +23 -0
- package/dist/dictionary/traditional-carry.d.ts.map +1 -0
- package/dist/dictionary/traditional-carry.js +201 -0
- package/dist/dictionary/traditional-carry.js.map +1 -0
- package/dist/format/annotate.d.ts.map +1 -1
- package/dist/format/annotate.js +3 -3
- package/dist/format/annotate.js.map +1 -1
- package/dist/format/html.d.ts +41 -6
- package/dist/format/html.d.ts.map +1 -1
- package/dist/format/html.js +34 -83
- package/dist/format/html.js.map +1 -1
- package/dist/format/language-tag.d.ts +57 -0
- package/dist/format/language-tag.d.ts.map +1 -0
- package/dist/format/language-tag.js +76 -0
- package/dist/format/language-tag.js.map +1 -0
- package/dist/format/syllable-span.d.ts +10 -0
- package/dist/format/syllable-span.d.ts.map +1 -0
- package/dist/format/syllable-span.js +87 -0
- package/dist/format/syllable-span.js.map +1 -0
- package/dist/format/transcribed.d.ts +36 -0
- package/dist/format/transcribed.d.ts.map +1 -0
- package/dist/format/transcribed.js +38 -0
- package/dist/format/transcribed.js.map +1 -0
- package/dist/format/transcription.d.ts.map +1 -1
- package/dist/format/transcription.js +7 -19
- package/dist/format/transcription.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/transcription/systems.d.ts +82 -0
- package/dist/transcription/systems.d.ts.map +1 -0
- package/dist/transcription/systems.js +64 -0
- package/dist/transcription/systems.js.map +1 -0
- package/package.json +2 -2
- package/dist/cli/system-table.d.ts +0 -12
- package/dist/cli/system-table.d.ts.map +0 -1
- package/dist/cli/system-table.js +0 -48
- package/dist/cli/system-table.js.map +0 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { writeBopomofo, writeBopomofoWord } from "./bopomofo.js";
|
|
2
|
+
import { writeGwoyeu, writeGwoyeuWord } from "./gwoyeu.js";
|
|
3
|
+
import { writeIpa, writeIpaWord } from "./ipa.js";
|
|
4
|
+
import { writeWadeGiles, writeWadeGilesWord } from "./wade-giles.js";
|
|
5
|
+
import { writeYale, writeYaleWord } from "./yale.js";
|
|
6
|
+
export const BOPOMOFO = {
|
|
7
|
+
name: "bopomofo",
|
|
8
|
+
write: (syllable) => writeBopomofo(syllable),
|
|
9
|
+
separator: " ",
|
|
10
|
+
word: (syllables) => writeBopomofoWord(syllables),
|
|
11
|
+
capitals: false,
|
|
12
|
+
script: "Bopo",
|
|
13
|
+
};
|
|
14
|
+
export const WADE_GILES = {
|
|
15
|
+
name: "wade-giles",
|
|
16
|
+
write: (syllable, hasTones) => writeWadeGiles(syllable, hasTones ? {} : { tones: "none" }),
|
|
17
|
+
separator: "-",
|
|
18
|
+
word: (syllables, hasTones) => writeWadeGilesWord(syllables, hasTones ? {} : { tones: "none" }),
|
|
19
|
+
capitals: true,
|
|
20
|
+
script: "Latn",
|
|
21
|
+
variant: "wadegile",
|
|
22
|
+
};
|
|
23
|
+
export const YALE = {
|
|
24
|
+
name: "yale",
|
|
25
|
+
write: (syllable, hasTones) => writeYale(syllable, hasTones ? {} : { tones: "none" }),
|
|
26
|
+
separator: "",
|
|
27
|
+
word: (syllables, hasTones) => writeYaleWord(syllables, hasTones ? {} : { tones: "none" }),
|
|
28
|
+
capitals: true,
|
|
29
|
+
script: "Latn",
|
|
30
|
+
};
|
|
31
|
+
export const GWOYEU = {
|
|
32
|
+
name: "gwoyeu",
|
|
33
|
+
write: (syllable) => writeGwoyeu(syllable),
|
|
34
|
+
separator: "",
|
|
35
|
+
word: (syllables) => writeGwoyeuWord(syllables),
|
|
36
|
+
capitals: true,
|
|
37
|
+
script: "Latn",
|
|
38
|
+
};
|
|
39
|
+
export const IPA = {
|
|
40
|
+
name: "ipa",
|
|
41
|
+
write: (syllable, hasTones) => writeIpa(syllable, hasTones ? {} : { tones: "none" }),
|
|
42
|
+
separator: "",
|
|
43
|
+
word: (syllables, hasTones) => writeIpaWord(syllables, hasTones ? {} : { tones: "none" }),
|
|
44
|
+
capitals: false,
|
|
45
|
+
script: "Latn",
|
|
46
|
+
variant: "fonipa",
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Every system, in the order the `transcribe` table writes its columns.
|
|
50
|
+
*/
|
|
51
|
+
export const TRANSCRIPTION_SYSTEMS = [
|
|
52
|
+
BOPOMOFO,
|
|
53
|
+
WADE_GILES,
|
|
54
|
+
YALE,
|
|
55
|
+
GWOYEU,
|
|
56
|
+
IPA,
|
|
57
|
+
];
|
|
58
|
+
/**
|
|
59
|
+
* The system a name stands for, or undefined for a name that is not one.
|
|
60
|
+
*/
|
|
61
|
+
export function transcriptionSystemNamed(name) {
|
|
62
|
+
return TRANSCRIPTION_SYSTEMS.find((system) => system.name === name);
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=systems.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systems.js","sourceRoot":"","sources":["../../src/transcription/systems.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,QAAQ,EA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AqB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACtE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kensio/pinyinjs",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.10",
|
|
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.64.0",
|
|
73
73
|
"oxlint": "^1.77.0",
|
|
74
74
|
"oxlint-tsgolint": "^7.0.2001",
|
|
75
75
|
"semantic-release": "25.0.9",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The five systems, each taking a write*Word helper apart into the syllable
|
|
3
|
-
* write and the separator it joins on, so every syllable can be painted its
|
|
4
|
-
* own colour. commands.test.ts holds each pair together over the inventory.
|
|
5
|
-
*/
|
|
6
|
-
import type { System } from "./systems.js";
|
|
7
|
-
export declare const BOPOMOFO: System;
|
|
8
|
-
export declare const WADE_GILES: System;
|
|
9
|
-
export declare const YALE: System;
|
|
10
|
-
export declare const GWOYEU: System;
|
|
11
|
-
export declare const IPA: System;
|
|
12
|
-
//# sourceMappingURL=system-table.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"system-table.d.ts","sourceRoot":"","sources":["../../src/cli/system-table.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAiB3C,eAAO,MAAM,QAAQ,EAAE,MAMtB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,MAOxB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,MAOlB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,MAMpB,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,MAOjB,CAAC"}
|
package/dist/cli/system-table.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The romanisation systems, as a table the CLI can walk.
|
|
3
|
-
*
|
|
4
|
-
* Each entry takes apart a `write*Word` helper into the syllable write and the
|
|
5
|
-
* separator it joins on, so that every syllable can be painted its own colour.
|
|
6
|
-
* `commands.test.ts` holds the pair together over the whole inventory.
|
|
7
|
-
*/
|
|
8
|
-
import { writeBopomofo, writeBopomofoWord } from "../transcription/bopomofo.js";
|
|
9
|
-
import { writeGwoyeu, writeGwoyeuWord } from "../transcription/gwoyeu.js";
|
|
10
|
-
import { writeIpa, writeIpaWord } from "../transcription/ipa.js";
|
|
11
|
-
import { writeWadeGiles, writeWadeGilesWord, } from "../transcription/wade-giles.js";
|
|
12
|
-
import { writeYale, writeYaleWord } from "../transcription/yale.js";
|
|
13
|
-
export const BOPOMOFO = {
|
|
14
|
-
name: "bopomofo",
|
|
15
|
-
write: writeBopomofo,
|
|
16
|
-
separator: " ",
|
|
17
|
-
word: (syllables) => writeBopomofoWord(syllables),
|
|
18
|
-
capitals: false,
|
|
19
|
-
};
|
|
20
|
-
export const WADE_GILES = {
|
|
21
|
-
name: "wade-giles",
|
|
22
|
-
write: writeWadeGiles,
|
|
23
|
-
separator: "-",
|
|
24
|
-
word: (syllables, hasTones) => writeWadeGilesWord(syllables, hasTones ? {} : { tones: "none" }),
|
|
25
|
-
capitals: true,
|
|
26
|
-
};
|
|
27
|
-
export const YALE = {
|
|
28
|
-
name: "yale",
|
|
29
|
-
write: writeYale,
|
|
30
|
-
separator: "",
|
|
31
|
-
word: (syllables, hasTones) => writeYaleWord(syllables, hasTones ? {} : { tones: "none" }),
|
|
32
|
-
capitals: true,
|
|
33
|
-
};
|
|
34
|
-
export const GWOYEU = {
|
|
35
|
-
name: "gwoyeu",
|
|
36
|
-
write: writeGwoyeu,
|
|
37
|
-
separator: "",
|
|
38
|
-
word: (syllables) => writeGwoyeuWord(syllables),
|
|
39
|
-
capitals: true,
|
|
40
|
-
};
|
|
41
|
-
export const IPA = {
|
|
42
|
-
name: "ipa",
|
|
43
|
-
write: writeIpa,
|
|
44
|
-
separator: "",
|
|
45
|
-
word: (syllables, hasTones) => writeIpaWord(syllables, hasTones ? {} : { tones: "none" }),
|
|
46
|
-
capitals: false,
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=system-table.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"system-table.js","sourceRoot":"","sources":["../../src/cli/system-table.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACL,cAAc,EACd,kBAAkB,GACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,CAAC,MAAM,QAAQ,GAAW;IAC9B,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,GAAG;IACd,IAAI,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC;IACjD,QAAQ,EAAE,KAAK;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAW;IAChC,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,cAAc;IACrB,SAAS,EAAE,GAAG;IACd,IAAI,EAAE,CAA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