chinese-characters-decomposition 0.0.0

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.
Files changed (5) hide show
  1. package/README.md +81 -0
  2. package/ccd.json +254030 -0
  3. package/index.d.ts +51 -0
  4. package/index.js +1 -0
  5. package/package.json +64 -0
package/index.d.ts ADDED
@@ -0,0 +1,51 @@
1
+ /**
2
+ * A single entry in the Chinese Characters Decomposition (CCD) dataset.
3
+ *
4
+ * Source columns (in order): Component, Strokes, CompositionType,
5
+ * LeftComponent, LeftStrokes, RightComponent, RightStrokes, Signature,
6
+ * Notes, Section.
7
+ */
8
+ export interface CcdEntry {
9
+ /** The character being decomposed. */
10
+ component: string;
11
+ /** Total stroke count of the character. */
12
+ strokes: number;
13
+ /**
14
+ * Composition type indicator. A single character describing the
15
+ * structural relationship between the two components, or `"*"` when
16
+ * the character is atomic (i.e. has no further decomposition).
17
+ *
18
+ * Common values include `一` (single), `吕` (top/bottom), `回`
19
+ * (enclosure), `吅` (left/right), `咒` (over two), etc.
20
+ */
21
+ compositionType: string;
22
+ /** First (left/top/outer) sub-component, or `null` when atomic. */
23
+ leftComponent: string | null;
24
+ /** Stroke count of the first sub-component. */
25
+ leftStrokes: number;
26
+ /** Second (right/bottom/inner) sub-component, or `null` when atomic. */
27
+ rightComponent: string | null;
28
+ /** Stroke count of the second sub-component. */
29
+ rightStrokes: number;
30
+ /** Cangjie-style signature/code for the character. May be empty. */
31
+ signature: string;
32
+ /**
33
+ * Free-form notes from the source table — short uncertainty/quality
34
+ * marker pairs separated by `/` (for example `/`, `?/`, `/?`,
35
+ * `?/?`) plus the special sentinel `/#REF!`.
36
+ */
37
+ notes: string;
38
+ /** Radical/section the character is filed under, or `null` if unknown. */
39
+ section: string | null;
40
+ }
41
+
42
+ /** The full CCD dataset as an array of {@link CcdEntry} records. */
43
+ export type CcdDataset = CcdEntry[];
44
+
45
+ /**
46
+ * The full Chinese Characters Decomposition (CCD) dataset, parsed from
47
+ * `data/ccd.tsv` into a typed JSON array.
48
+ */
49
+ export declare const ccd: CcdDataset;
50
+
51
+ export default ccd;
package/index.js ADDED
@@ -0,0 +1 @@
1
+ export { default } from "./ccd.json" with { type: "json" };
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "chinese-characters-decomposition",
3
+ "version": "0.0.0",
4
+ "description": "Typed JSON dataset of Chinese character decompositions (CCD), with a parser for the source TSV.",
5
+ "keywords": [
6
+ "ccd",
7
+ "characters",
8
+ "chinese",
9
+ "cjk",
10
+ "dataset",
11
+ "decomposition",
12
+ "hanzi",
13
+ "kanji",
14
+ "radicals"
15
+ ],
16
+ "homepage": "https://github.com/leonsilicon/chinese-characters-decomposition#readme",
17
+ "bugs": {
18
+ "url": "https://github.com/leonsilicon/chinese-characters-decomposition/issues"
19
+ },
20
+ "license": "MIT",
21
+ "author": "Leon Silicon <leon@leonsilicon.com>",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/leonsilicon/chinese-characters-decomposition.git"
25
+ },
26
+ "files": [
27
+ "index.js",
28
+ "index.d.ts",
29
+ "ccd.json"
30
+ ],
31
+ "type": "module",
32
+ "main": "./index.js",
33
+ "types": "./index.d.ts",
34
+ "exports": {
35
+ ".": {
36
+ "types": "./index.d.ts",
37
+ "default": "./index.js"
38
+ },
39
+ "./ccd.json": "./ccd.json",
40
+ "./package.json": "./package.json"
41
+ },
42
+ "publishConfig": {
43
+ "access": "public"
44
+ },
45
+ "scripts": {
46
+ "build": "bun run scripts/parse.ts",
47
+ "test": "vp test",
48
+ "check": "vp check",
49
+ "prepublishOnly": "bun run scripts/parse.ts",
50
+ "prepare": "vp config"
51
+ },
52
+ "devDependencies": {
53
+ "@types/node": "^25.6.2",
54
+ "@typescript/native-preview": "7.0.0-dev.20260509.2",
55
+ "bumpp": "^11.1.0",
56
+ "typescript": "^6.0.3",
57
+ "vite-plus": "^0.1.20"
58
+ },
59
+ "overrides": {
60
+ "vite": "npm:@voidzero-dev/vite-plus-core@latest",
61
+ "vitest": "npm:@voidzero-dev/vite-plus-test@latest"
62
+ },
63
+ "packageManager": "bun@1.3.14"
64
+ }