@marmooo/kanji 0.1.1 → 0.1.3
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 +9 -3
- package/esm/jinmei.d.ts +0 -1
- package/esm/jis-code.d.ts +0 -1
- package/esm/jkat.d.ts +0 -1
- package/esm/joyo-radical-strokes.d.ts +0 -1
- package/esm/joyo-radical.d.ts +0 -1
- package/esm/joyo-strokes.d.ts +0 -1
- package/esm/kanji.d.ts +0 -1
- package/esm/mod.d.ts +0 -1
- package/esm/test.d.ts +0 -1
- package/esm/unicode-chart.d.ts +1 -1
- package/esm/unicode-chart.js +24 -22
- package/esm/unicode-radical-strokes.d.ts +0 -1
- package/esm/unicode-radical.d.ts +0 -1
- package/esm/unicode-radical.js +198 -198
- package/esm/unicode-strokes.d.ts +1 -2
- package/esm/unicode-strokes.js +38 -38
- package/esm/unicode.d.ts +1 -1
- package/esm/unicode.js +15 -13
- package/package.json +3 -4
- package/script/jinmei.d.ts +0 -1
- package/script/jis-code.d.ts +0 -1
- package/script/jkat.d.ts +0 -1
- package/script/joyo-radical-strokes.d.ts +0 -1
- package/script/joyo-radical.d.ts +0 -1
- package/script/joyo-strokes.d.ts +0 -1
- package/script/kanji.d.ts +0 -1
- package/script/mod.d.ts +0 -1
- package/script/test.d.ts +0 -1
- package/script/unicode-chart.d.ts +1 -1
- package/script/unicode-chart.js +25 -23
- package/script/unicode-radical-strokes.d.ts +0 -1
- package/script/unicode-radical.d.ts +0 -1
- package/script/unicode-radical.js +198 -198
- package/script/unicode-strokes.d.ts +1 -2
- package/script/unicode-strokes.js +38 -38
- package/script/unicode.d.ts +1 -1
- package/script/unicode.js +16 -14
- package/esm/_dnt.test_shims.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/almost_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/array_includes.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/assert.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/assertion_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/exists.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/fail.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/false.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/greater.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/greater_or_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/is_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/less.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/less_or_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/not_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/not_instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/not_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/not_strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/object_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/rejects.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/string_includes.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/throws.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/unimplemented.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/unreachable.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.6/build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.6/diff.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.6/diff_str.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.6/format.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.6/styles.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.6/types.d.ts.map +0 -1
- package/esm/jinmei.d.ts.map +0 -1
- package/esm/jis-code.d.ts.map +0 -1
- package/esm/jkat.d.ts.map +0 -1
- package/esm/joyo-radical-strokes.d.ts.map +0 -1
- package/esm/joyo-radical.d.ts.map +0 -1
- package/esm/joyo-strokes.d.ts.map +0 -1
- package/esm/kanji.d.ts.map +0 -1
- package/esm/mod.d.ts.map +0 -1
- package/esm/test.d.ts.map +0 -1
- package/esm/unicode-chart.d.ts.map +0 -1
- package/esm/unicode-radical-strokes.d.ts.map +0 -1
- package/esm/unicode-radical.d.ts.map +0 -1
- package/esm/unicode-strokes.d.ts.map +0 -1
- package/esm/unicode.d.ts.map +0 -1
- package/script/_dnt.test_shims.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/almost_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/array_includes.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/assert.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/assertion_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/exists.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/fail.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/false.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/greater.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/greater_or_equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/is_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/less.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/less_or_equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/not_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/not_instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/not_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/not_strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/object_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/rejects.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/string_includes.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/throws.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/unimplemented.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/unreachable.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.6/build_message.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.6/diff.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.6/diff_str.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.6/format.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.6/styles.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.6/types.d.ts.map +0 -1
- package/script/jinmei.d.ts.map +0 -1
- package/script/jis-code.d.ts.map +0 -1
- package/script/jkat.d.ts.map +0 -1
- package/script/joyo-radical-strokes.d.ts.map +0 -1
- package/script/joyo-radical.d.ts.map +0 -1
- package/script/joyo-strokes.d.ts.map +0 -1
- package/script/kanji.d.ts.map +0 -1
- package/script/mod.d.ts.map +0 -1
- package/script/test.d.ts.map +0 -1
- package/script/unicode-chart.d.ts.map +0 -1
- package/script/unicode-radical-strokes.d.ts.map +0 -1
- package/script/unicode-radical.d.ts.map +0 -1
- package/script/unicode-strokes.d.ts.map +0 -1
- package/script/unicode.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -5,12 +5,18 @@ Get various grade information about kanji.
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
7
|
```
|
|
8
|
-
import { Kanji, JKAT } from "@marmooo/kanji";
|
|
8
|
+
import { Kanji, JKAT, UnicodeRadical, UnicodeStrokes } from "@marmooo/kanji";
|
|
9
9
|
|
|
10
10
|
const jkat = new Kanji(JKAT); // 教育指導要領 / 日本漢字能力検定
|
|
11
11
|
jkat.getGrade("学校"); // --> 0
|
|
12
12
|
jkat.getGrade("漢"); // --> 2
|
|
13
13
|
jkat.getGrade("おたま"); // --> -1
|
|
14
|
+
|
|
15
|
+
const radical = new Kanji(UnicodeRadical);
|
|
16
|
+
const strokes = new Kanji(UnicodeStrokes);
|
|
17
|
+
jkat.dict["漢"]; // --> [2]
|
|
18
|
+
radical.dict["䁀"]; // --> [71, 108]
|
|
19
|
+
strokes.dict["䁀"]; // --> [12]
|
|
14
20
|
```
|
|
15
21
|
|
|
16
22
|
### Supported list
|
|
@@ -21,8 +27,8 @@ jkat.getGrade("おたま"); // --> -1
|
|
|
21
27
|
- `JoyoRadical`: 常用漢字の康熙字典 214 部首コード
|
|
22
28
|
- `JoyoRadicalStrokes`: 常用漢字の康熙字典 214 部首の画数データ
|
|
23
29
|
- `JoyoStrokes`: 常用漢字の画数データ
|
|
24
|
-
- `Unicode`: CJK 統合漢字 (URO〜Ext.
|
|
25
|
-
- `UnicodeChart`: CJK 統合漢字 (URO〜Ext.
|
|
30
|
+
- `Unicode`: Unicode 17.0 CJK 統合漢字 (URO〜Ext.J)
|
|
31
|
+
- `UnicodeChart`: Unicode 17.0 CJK 統合漢字 (URO〜Ext.J)
|
|
26
32
|
- `UnicodeRadical`: Unihan_IRGSources.txt に基づく康熙字典 214 部首コード
|
|
27
33
|
- `UnicodeRadicalStrokes`: Unihan_IRGSources.txt に基づく康熙字典 214
|
|
28
34
|
部首の画数データ
|
package/esm/jinmei.d.ts
CHANGED
package/esm/jis-code.d.ts
CHANGED
package/esm/jkat.d.ts
CHANGED
package/esm/joyo-radical.d.ts
CHANGED
package/esm/joyo-strokes.d.ts
CHANGED
package/esm/kanji.d.ts
CHANGED
package/esm/mod.d.ts
CHANGED
|
@@ -10,4 +10,3 @@ export { UnicodeChart } from "./unicode-chart.js";
|
|
|
10
10
|
export { UnicodeRadical } from "./unicode-radical.js";
|
|
11
11
|
export { UnicodeRadicalStrokes } from "./unicode-radical-strokes.js";
|
|
12
12
|
export { UnicodeStrokes } from "./unicode-strokes.js";
|
|
13
|
-
//# sourceMappingURL=mod.d.ts.map
|
package/esm/test.d.ts
CHANGED
package/esm/unicode-chart.d.ts
CHANGED
package/esm/unicode-chart.js
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
function range(start, end) {
|
|
2
2
|
const list = Array(end - start);
|
|
3
|
-
for (let i = 0; i
|
|
3
|
+
for (let i = 0; i <= end - start; i++) {
|
|
4
4
|
list[i] = String.fromCodePoint(start + i);
|
|
5
5
|
}
|
|
6
6
|
return list;
|
|
7
7
|
}
|
|
8
|
-
export const URO1 = range(Number(0x4E00), Number(0x62FF)
|
|
9
|
-
export const URO2 = range(Number(0x6300), Number(0x77FF)
|
|
10
|
-
export const URO3 = range(Number(0x7800), Number(0x8CFF)
|
|
11
|
-
export const URO4 = range(Number(0x8D00), Number(0x9FFF)
|
|
12
|
-
export const CI = range(Number(0xF900), Number(0xFAD9)
|
|
13
|
-
export const CIS = range(Number(0x2F800), Number(0x2FA1D)
|
|
14
|
-
export const ExtA = range(Number(0x3400), Number(0x4DBF)
|
|
15
|
-
export const ExtB1 = range(Number(0x20000), Number(0x215FF)
|
|
16
|
-
export const ExtB2 = range(Number(0x21600), Number(0x230FF)
|
|
17
|
-
export const ExtB3 = range(Number(0x23100), Number(0x245FF)
|
|
18
|
-
export const ExtB4 = range(Number(0x24600), Number(0x260FF)
|
|
19
|
-
export const ExtB5 = range(Number(0x26100), Number(0x275FF)
|
|
20
|
-
export const ExtB6 = range(Number(0x27600), Number(0x290FF)
|
|
21
|
-
export const ExtB7 = range(Number(0x29100), Number(0x2A6DF)
|
|
22
|
-
export const ExtC = range(Number(0x2A700), Number(
|
|
23
|
-
export const ExtD = range(Number(0x2B740), Number(0x2B81D)
|
|
24
|
-
export const ExtE = range(Number(0x2B820), Number(
|
|
25
|
-
export const ExtF = range(Number(0x2CEB0), Number(0x2EBE0)
|
|
26
|
-
export const ExtG = range(Number(0x30000), Number(0x3134A)
|
|
27
|
-
export const ExtH = range(Number(0x31350), Number(0x323AF)
|
|
28
|
-
export const ExtI = range(Number(0x2EBF0), Number(0x2EE5D)
|
|
8
|
+
export const URO1 = range(Number(0x4E00), Number(0x62FF));
|
|
9
|
+
export const URO2 = range(Number(0x6300), Number(0x77FF));
|
|
10
|
+
export const URO3 = range(Number(0x7800), Number(0x8CFF));
|
|
11
|
+
export const URO4 = range(Number(0x8D00), Number(0x9FFF));
|
|
12
|
+
export const CI = range(Number(0xF900), Number(0xFAD9));
|
|
13
|
+
export const CIS = range(Number(0x2F800), Number(0x2FA1D));
|
|
14
|
+
export const ExtA = range(Number(0x3400), Number(0x4DBF));
|
|
15
|
+
export const ExtB1 = range(Number(0x20000), Number(0x215FF));
|
|
16
|
+
export const ExtB2 = range(Number(0x21600), Number(0x230FF));
|
|
17
|
+
export const ExtB3 = range(Number(0x23100), Number(0x245FF));
|
|
18
|
+
export const ExtB4 = range(Number(0x24600), Number(0x260FF));
|
|
19
|
+
export const ExtB5 = range(Number(0x26100), Number(0x275FF));
|
|
20
|
+
export const ExtB6 = range(Number(0x27600), Number(0x290FF));
|
|
21
|
+
export const ExtB7 = range(Number(0x29100), Number(0x2A6DF));
|
|
22
|
+
export const ExtC = range(Number(0x2A700), Number(0x2B73F));
|
|
23
|
+
export const ExtD = range(Number(0x2B740), Number(0x2B81D));
|
|
24
|
+
export const ExtE = range(Number(0x2B820), Number(0x2CEAD));
|
|
25
|
+
export const ExtF = range(Number(0x2CEB0), Number(0x2EBE0));
|
|
26
|
+
export const ExtG = range(Number(0x30000), Number(0x3134A));
|
|
27
|
+
export const ExtH = range(Number(0x31350), Number(0x323AF));
|
|
28
|
+
export const ExtI = range(Number(0x2EBF0), Number(0x2EE5D));
|
|
29
|
+
export const ExtJ = range(Number(0x323B0), Number(0x33479));
|
|
29
30
|
export const UnicodeChart = [
|
|
30
31
|
URO1,
|
|
31
32
|
URO2,
|
|
@@ -48,4 +49,5 @@ export const UnicodeChart = [
|
|
|
48
49
|
ExtG,
|
|
49
50
|
ExtH,
|
|
50
51
|
ExtI,
|
|
52
|
+
ExtJ,
|
|
51
53
|
];
|
package/esm/unicode-radical.d.ts
CHANGED