henkan 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 (66) hide show
  1. package/CONTRIBUTING.md +25 -0
  2. package/LICENSE.md +21 -0
  3. package/README.md +82 -0
  4. package/SECURITY.md +20 -0
  5. package/dist/index.cjs.js +2257 -0
  6. package/dist/index.cjs.js.map +7 -0
  7. package/dist/index.mjs +2199 -0
  8. package/dist/index.mjs.map +7 -0
  9. package/dist/types/constants.d.ts +8 -0
  10. package/dist/types/constants.d.ts.map +1 -0
  11. package/dist/types/index.d.ts +4 -0
  12. package/dist/types/index.d.ts.map +1 -0
  13. package/dist/types/types.d.ts +680 -0
  14. package/dist/types/types.d.ts.map +1 -0
  15. package/dist/types/utils.d.ts +135 -0
  16. package/dist/types/utils.d.ts.map +1 -0
  17. package/docs/api/README.md +62 -0
  18. package/docs/api/functions/capitalizeString.md +27 -0
  19. package/docs/api/functions/convertJMdict.md +27 -0
  20. package/docs/api/functions/convertKanjiDic.md +27 -0
  21. package/docs/api/functions/convertKradFile.md +39 -0
  22. package/docs/api/functions/convertRadkFile.md +33 -0
  23. package/docs/api/functions/convertTanakaCorpus.md +33 -0
  24. package/docs/api/functions/generateAnkiNote.md +27 -0
  25. package/docs/api/functions/generateAnkiNotesFile.md +27 -0
  26. package/docs/api/functions/getKanji.md +57 -0
  27. package/docs/api/functions/getKanjiExtended.md +69 -0
  28. package/docs/api/functions/getWord.md +63 -0
  29. package/docs/api/functions/isStringArray.md +27 -0
  30. package/docs/api/functions/isValidArray.md +27 -0
  31. package/docs/api/functions/isValidArrayWithFirstElement.md +27 -0
  32. package/docs/api/functions/makeSSML.md +33 -0
  33. package/docs/api/functions/shuffleArray.md +33 -0
  34. package/docs/api/functions/synthesizeSpeech.md +39 -0
  35. package/docs/api/interfaces/DictKanji.md +43 -0
  36. package/docs/api/interfaces/DictKanjiForm.md +51 -0
  37. package/docs/api/interfaces/DictKanjiMisc.md +61 -0
  38. package/docs/api/interfaces/DictKanjiReading.md +31 -0
  39. package/docs/api/interfaces/DictKanjiReadingMeaning.md +33 -0
  40. package/docs/api/interfaces/DictKanjiReadingMeaningGroup.md +33 -0
  41. package/docs/api/interfaces/DictKanjiWithRadicals.md +33 -0
  42. package/docs/api/interfaces/DictMeaning.md +129 -0
  43. package/docs/api/interfaces/DictRadical.md +41 -0
  44. package/docs/api/interfaces/DictReading.md +61 -0
  45. package/docs/api/interfaces/DictWord.md +53 -0
  46. package/docs/api/interfaces/ExamplePart.md +75 -0
  47. package/docs/api/interfaces/Grammar.md +165 -0
  48. package/docs/api/interfaces/GrammarMeaning.md +31 -0
  49. package/docs/api/interfaces/Kana.md +125 -0
  50. package/docs/api/interfaces/Kanji.md +239 -0
  51. package/docs/api/interfaces/KanjiComponent.md +31 -0
  52. package/docs/api/interfaces/KanjiForm.md +33 -0
  53. package/docs/api/interfaces/Phrase.md +47 -0
  54. package/docs/api/interfaces/Radical.md +165 -0
  55. package/docs/api/interfaces/Reading.md +43 -0
  56. package/docs/api/interfaces/ResultEntry.md +75 -0
  57. package/docs/api/interfaces/TanakaExample.md +51 -0
  58. package/docs/api/interfaces/Translation.md +33 -0
  59. package/docs/api/interfaces/UsefulRegExps.md +93 -0
  60. package/docs/api/interfaces/Word.md +149 -0
  61. package/docs/api/type-aliases/Dict.md +13 -0
  62. package/docs/api/type-aliases/DictName.md +13 -0
  63. package/docs/api/type-aliases/EntryType.md +13 -0
  64. package/docs/api/type-aliases/JLPT.md +13 -0
  65. package/docs/api/type-aliases/Result.md +13 -0
  66. package/package.json +87 -0
@@ -0,0 +1,27 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / isValidArray
6
+
7
+ # Function: isValidArray()
8
+
9
+ > **isValidArray**(`arg`): `arg is any[]`
10
+
11
+ Defined in: utils.ts:61
12
+
13
+ Checks if the argument is an array.
14
+
15
+ ## Parameters
16
+
17
+ ### arg
18
+
19
+ `any`
20
+
21
+ The argument
22
+
23
+ ## Returns
24
+
25
+ `arg is any[]`
26
+
27
+ Whether or not [arg](#isvalidarray) is an array
@@ -0,0 +1,27 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / isValidArrayWithFirstElement
6
+
7
+ # Function: isValidArrayWithFirstElement()
8
+
9
+ > **isValidArrayWithFirstElement**(`arg`): `arg is any[]`
10
+
11
+ Defined in: utils.ts:70
12
+
13
+ Checks if the argument is an array and has at least one element.
14
+
15
+ ## Parameters
16
+
17
+ ### arg
18
+
19
+ `any`
20
+
21
+ The argument
22
+
23
+ ## Returns
24
+
25
+ `arg is any[]`
26
+
27
+ Whether or not [arg](#isvalidarraywithfirstelement) is an array and has at least one element
@@ -0,0 +1,33 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / makeSSML
6
+
7
+ # Function: makeSSML()
8
+
9
+ > **makeSSML**(`formText`, `fullReading`): `string`
10
+
11
+ Defined in: utils.ts:1246
12
+
13
+ Builds SSML text for Japanese words
14
+
15
+ ## Parameters
16
+
17
+ ### formText
18
+
19
+ `string`
20
+
21
+ The normal form of the word (usually kanji form)
22
+
23
+ ### fullReading
24
+
25
+ `string`
26
+
27
+ The reading of the word (hiragana or katakana)
28
+
29
+ ## Returns
30
+
31
+ `string`
32
+
33
+ The SSML text
@@ -0,0 +1,33 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / shuffleArray
6
+
7
+ # Function: shuffleArray()
8
+
9
+ > **shuffleArray**\<`T`\>(`arr`): `T`[]
10
+
11
+ Defined in: utils.ts:99
12
+
13
+ Shuffles an array using the `Fisher–Yates shuffle` algorithm
14
+
15
+ ## Type Parameters
16
+
17
+ ### T
18
+
19
+ `T`
20
+
21
+ ## Parameters
22
+
23
+ ### arr
24
+
25
+ `T`[]
26
+
27
+ The array to be shuffled
28
+
29
+ ## Returns
30
+
31
+ `T`[]
32
+
33
+ The shuffled array
@@ -0,0 +1,39 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / synthesizeSpeech
6
+
7
+ # Function: synthesizeSpeech()
8
+
9
+ > **synthesizeSpeech**(`client`, `ssmlText`, `options`): `Promise`\<`null` \| `Buffer`\<`ArrayBuffer`\>\>
10
+
11
+ Defined in: utils.ts:1331
12
+
13
+ Synthesizes text to speech audio using \[Amazon Polly\](https://aws.amazon.com/polly/).
14
+
15
+ ## Parameters
16
+
17
+ ### client
18
+
19
+ `PollyClient`
20
+
21
+ An Amazon Polly Client instance
22
+
23
+ ### ssmlText
24
+
25
+ `string`
26
+
27
+ The text to be spoken, in SSML format
28
+
29
+ ### options
30
+
31
+ `Omit`\<`SynthesizeSpeechCommandInput`, `"Text"` \| `"TextType"`\>
32
+
33
+ Other speech generation settings
34
+
35
+ ## Returns
36
+
37
+ `Promise`\<`null` \| `Buffer`\<`ArrayBuffer`\>\>
38
+
39
+ A promise resolving with an audio stream buffer or with `null` if the generation failed
@@ -0,0 +1,43 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / DictKanji
6
+
7
+ # Interface: DictKanji
8
+
9
+ Defined in: types.ts:227
10
+
11
+ KANJIDIC2 entry (kanji)
12
+
13
+ Equivalent to the `character` KANJIDIC2 element *(excluding some subelements)*
14
+
15
+ ## Properties
16
+
17
+ ### kanji
18
+
19
+ > `readonly` **kanji**: `string`
20
+
21
+ Defined in: types.ts:231
22
+
23
+ The kanji character
24
+
25
+ ***
26
+
27
+ ### misc?
28
+
29
+ > `optional` **misc**: [`DictKanjiMisc`](DictKanjiMisc.md)
30
+
31
+ Defined in: types.ts:235
32
+
33
+ The miscellaneous information about the kanji
34
+
35
+ ***
36
+
37
+ ### readingMeaning
38
+
39
+ > **readingMeaning**: [`DictKanjiReadingMeaning`](DictKanjiReadingMeaning.md)[]
40
+
41
+ Defined in: types.ts:239
42
+
43
+ The "readings-meanings" groups and nanori readings of the kanji
@@ -0,0 +1,51 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / DictKanjiForm
6
+
7
+ # Interface: DictKanjiForm
8
+
9
+ Defined in: types.ts:16
10
+
11
+ Word kanji form information
12
+
13
+ Equivalent to the `k_ele` JMdict element
14
+
15
+ ## Properties
16
+
17
+ ### commonness?
18
+
19
+ > `optional` **commonness**: `string`[]
20
+
21
+ Defined in: types.ts:32
22
+
23
+ Priority codes
24
+
25
+ #### See
26
+
27
+ [https://www.edrdg.org/jmwsgi/edhelp.py?svc=jmdict#kw\_freq](https://www.edrdg.org/jmwsgi/edhelp.py?svc=jmdict#kw_freq)
28
+
29
+ ***
30
+
31
+ ### form
32
+
33
+ > `readonly` **form**: `string`
34
+
35
+ Defined in: types.ts:20
36
+
37
+ The kanji form of the word
38
+
39
+ ***
40
+
41
+ ### notes?
42
+
43
+ > `optional` **notes**: `string`[]
44
+
45
+ Defined in: types.ts:26
46
+
47
+ Other information about the kanji form
48
+
49
+ #### See
50
+
51
+ [https://www.edrdg.org/jmwsgi/edhelp.py?svc=jmdict#kw\_kinf](https://www.edrdg.org/jmwsgi/edhelp.py?svc=jmdict#kw_kinf)
@@ -0,0 +1,61 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / DictKanjiMisc
6
+
7
+ # Interface: DictKanjiMisc
8
+
9
+ Defined in: types.ts:149
10
+
11
+ Miscellaneous information about the kanji
12
+
13
+ Equivalent to the `misc` KANJIDIC2 element *(excluding some subelements)*
14
+
15
+ ## Properties
16
+
17
+ ### frequency?
18
+
19
+ > `optional` **frequency**: `string`
20
+
21
+ Defined in: types.ts:169
22
+
23
+ The frequency-of-use ranking
24
+
25
+ A number from `1` to `2500`
26
+
27
+ ***
28
+
29
+ ### grade?
30
+
31
+ > `optional` **grade**: `string`
32
+
33
+ Defined in: types.ts:163
34
+
35
+ The kanji grade level
36
+
37
+ 1-6 -> \[Kyōiku kanji\](https://en.wikipedia.org/wiki/Ky%C5%8Diku\_kanji)
38
+
39
+ 7-8 -> \[Jōyō kanji\](https://en.wikipedia.org/wiki/J%C5%8Dy%C5%8D\_kanji) (excluding Kyōiku kanji)
40
+
41
+ 9-10 -> \[Jinmeiyō kanji\](https://en.wikipedia.org/wiki/Jinmeiy%C5%8D\_kanji)
42
+
43
+ ***
44
+
45
+ ### jlpt?
46
+
47
+ > `optional` **jlpt**: `string`
48
+
49
+ Defined in: types.ts:173
50
+
51
+ The \[pre-2010 JLPT\](https://en.wikipedia.org/wiki/Japanese-Language\_Proficiency\_Test#Previous\_format\_(1984%E2%80%932009)) level
52
+
53
+ ***
54
+
55
+ ### strokeNumber
56
+
57
+ > `readonly` **strokeNumber**: `string`
58
+
59
+ Defined in: types.ts:153
60
+
61
+ The stroke count of the kanji, including the radical
@@ -0,0 +1,31 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / DictKanjiReading
6
+
7
+ # Interface: DictKanjiReading
8
+
9
+ Defined in: types.ts:179
10
+
11
+ Kanji reading information
12
+
13
+ ## Properties
14
+
15
+ ### reading
16
+
17
+ > `readonly` **reading**: `string`
18
+
19
+ Defined in: types.ts:183
20
+
21
+ The kanji reading (hiragana or katakana)
22
+
23
+ ***
24
+
25
+ ### type
26
+
27
+ > **type**: `"ja_on"` \| `"ja_kun"`
28
+
29
+ Defined in: types.ts:187
30
+
31
+ The type of reading (onyomi or kunyomi)
@@ -0,0 +1,33 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / DictKanjiReadingMeaning
6
+
7
+ # Interface: DictKanjiReadingMeaning
8
+
9
+ Defined in: types.ts:211
10
+
11
+ Kanji "readings-meanings" groups and nanori readings
12
+
13
+ Equivalent to the `reading_meaning` KANJIDIC2 element
14
+
15
+ ## Properties
16
+
17
+ ### groups
18
+
19
+ > **groups**: [`DictKanjiReadingMeaningGroup`](DictKanjiReadingMeaningGroup.md)[]
20
+
21
+ Defined in: types.ts:215
22
+
23
+ The Kanji "readings-meanings" pairs
24
+
25
+ ***
26
+
27
+ ### nanori?
28
+
29
+ > `optional` **nanori**: `string`[]
30
+
31
+ Defined in: types.ts:219
32
+
33
+ The kanji nanori readings
@@ -0,0 +1,33 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / DictKanjiReadingMeaningGroup
6
+
7
+ # Interface: DictKanjiReadingMeaningGroup
8
+
9
+ Defined in: types.ts:195
10
+
11
+ Kanji "readings-meanings" pair
12
+
13
+ Equivalent to the `rmgroup` KANJIDIC2 element
14
+
15
+ ## Properties
16
+
17
+ ### meanings
18
+
19
+ > **meanings**: `string`[]
20
+
21
+ Defined in: types.ts:203
22
+
23
+ The kanji meanings
24
+
25
+ ***
26
+
27
+ ### readings
28
+
29
+ > **readings**: [`DictKanjiReading`](DictKanjiReading.md)[]
30
+
31
+ Defined in: types.ts:199
32
+
33
+ The kanji readings
@@ -0,0 +1,33 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / DictKanjiWithRadicals
6
+
7
+ # Interface: DictKanjiWithRadicals
8
+
9
+ Defined in: types.ts:263
10
+
11
+ KRADFILE2 entry (kanji with its radicals/components)
12
+
13
+ ## Properties
14
+
15
+ ### kanji
16
+
17
+ > `readonly` **kanji**: `string`
18
+
19
+ Defined in: types.ts:267
20
+
21
+ The kanji character
22
+
23
+ ***
24
+
25
+ ### radicals
26
+
27
+ > **radicals**: (`string` \| [`DictKanji`](DictKanji.md))[]
28
+
29
+ Defined in: types.ts:273
30
+
31
+ The radicals/components that make up the kanji
32
+
33
+ Can be [DictKanji](DictKanji.md) objects if the component is a kanji found in KANJIDIC and/or [Kana.kana](Kana.md#kana) if the component is a katakana character that does not use (or have) its (or a) kanji variant.
@@ -0,0 +1,129 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / DictMeaning
6
+
7
+ # Interface: DictMeaning
8
+
9
+ Defined in: types.ts:67
10
+
11
+ Word meaning/sense information
12
+
13
+ Equivalent to the `sense` JMdict element
14
+
15
+ ## Properties
16
+
17
+ ### antonyms?
18
+
19
+ > `optional` **antonyms**: `string`[]
20
+
21
+ Defined in: types.ts:95
22
+
23
+ References to antonyms of the word *(when used with this meaning)*
24
+
25
+ ***
26
+
27
+ ### dialects?
28
+
29
+ > `optional` **dialects**: `string`[]
30
+
31
+ Defined in: types.ts:117
32
+
33
+ Regional dialects the meaning is restricted to
34
+
35
+ #### See
36
+
37
+ [https://www.edrdg.org/jmwsgi/edhelp.py?svc=jmdict#kw\_dial](https://www.edrdg.org/jmwsgi/edhelp.py?svc=jmdict#kw_dial)
38
+
39
+ ***
40
+
41
+ ### fields?
42
+
43
+ > `optional` **fields**: `string`[]
44
+
45
+ Defined in: types.ts:101
46
+
47
+ Field of application of the word *(when used with this meaning)*
48
+
49
+ #### See
50
+
51
+ [https://www.edrdg.org/jmwsgi/edhelp.py?svc=jmdict#kw\_fld](https://www.edrdg.org/jmwsgi/edhelp.py?svc=jmdict#kw_fld)
52
+
53
+ ***
54
+
55
+ ### info?
56
+
57
+ > `optional` **info**: `string`[]
58
+
59
+ Defined in: types.ts:105
60
+
61
+ Additional information about the meaning
62
+
63
+ ***
64
+
65
+ ### kanjiFormRestrictions?
66
+
67
+ > `optional` **kanjiFormRestrictions**: `string`[]
68
+
69
+ Defined in: types.ts:87
70
+
71
+ Kanji forms the meaning is restricted to
72
+
73
+ ***
74
+
75
+ ### misc?
76
+
77
+ > `optional` **misc**: `string`[]
78
+
79
+ Defined in: types.ts:111
80
+
81
+ Other relevant information about the meaning
82
+
83
+ #### See
84
+
85
+ [https://www.edrdg.org/jmwsgi/edhelp.py?svc=jmdict#kw\_misc](https://www.edrdg.org/jmwsgi/edhelp.py?svc=jmdict#kw_misc)
86
+
87
+ ***
88
+
89
+ ### partOfSpeech?
90
+
91
+ > `optional` **partOfSpeech**: `string`[]
92
+
93
+ Defined in: types.ts:73
94
+
95
+ Part of speech information
96
+
97
+ #### See
98
+
99
+ [https://www.edrdg.org/jmwsgi/edhelp.py?svc=jmdict#kw\_pos](https://www.edrdg.org/jmwsgi/edhelp.py?svc=jmdict#kw_pos)
100
+
101
+ ***
102
+
103
+ ### readingRestrictions?
104
+
105
+ > `optional` **readingRestrictions**: `string`[]
106
+
107
+ Defined in: types.ts:91
108
+
109
+ Readings the meaning is restricted to
110
+
111
+ ***
112
+
113
+ ### references?
114
+
115
+ > `optional` **references**: `string`[]
116
+
117
+ Defined in: types.ts:83
118
+
119
+ Cross-references to other similar/related words *(when used with this meaning)*
120
+
121
+ ***
122
+
123
+ ### translations?
124
+
125
+ > `optional` **translations**: (`string` \| \{ `translation`: `string`; `type`: `"lit"` \| `"expl"` \| `"tm"`; \})[]
126
+
127
+ Defined in: types.ts:77
128
+
129
+ Word glosses
@@ -0,0 +1,41 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / DictRadical
6
+
7
+ # Interface: DictRadical
8
+
9
+ Defined in: types.ts:245
10
+
11
+ RADKFILE2 entry (radical)
12
+
13
+ ## Properties
14
+
15
+ ### kanji
16
+
17
+ > **kanji**: [`DictKanji`](DictKanji.md)[]
18
+
19
+ Defined in: types.ts:253
20
+
21
+ The kanji that include the radical
22
+
23
+ ***
24
+
25
+ ### radical
26
+
27
+ > `readonly` **radical**: `string`
28
+
29
+ Defined in: types.ts:249
30
+
31
+ The radical character
32
+
33
+ ***
34
+
35
+ ### strokes
36
+
37
+ > **strokes**: `string`
38
+
39
+ Defined in: types.ts:257
40
+
41
+ The stroke count of the radical
@@ -0,0 +1,61 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / DictReading
6
+
7
+ # Interface: DictReading
8
+
9
+ Defined in: types.ts:40
10
+
11
+ Word reading information
12
+
13
+ Equivalent to the `r_ele` JMdict element
14
+
15
+ ## Properties
16
+
17
+ ### commonness?
18
+
19
+ > `optional` **commonness**: `string`[]
20
+
21
+ Defined in: types.ts:56
22
+
23
+ Priority codes
24
+
25
+ #### See
26
+
27
+ [https://www.edrdg.org/jmwsgi/edhelp.py?svc=jmdict#kw\_freq](https://www.edrdg.org/jmwsgi/edhelp.py?svc=jmdict#kw_freq)
28
+
29
+ ***
30
+
31
+ ### kanjiFormRestrictions?
32
+
33
+ > `optional` **kanjiFormRestrictions**: `string`[]
34
+
35
+ Defined in: types.ts:60
36
+
37
+ Kanji forms the reading is restricted to
38
+
39
+ ***
40
+
41
+ ### notes?
42
+
43
+ > `optional` **notes**: `string`[]
44
+
45
+ Defined in: types.ts:50
46
+
47
+ Other information about the reading
48
+
49
+ #### See
50
+
51
+ [https://www.edrdg.org/jmwsgi/edhelp.py?svc=jmdict#kw\_rinf](https://www.edrdg.org/jmwsgi/edhelp.py?svc=jmdict#kw_rinf)
52
+
53
+ ***
54
+
55
+ ### reading
56
+
57
+ > `readonly` **reading**: `string`
58
+
59
+ Defined in: types.ts:44
60
+
61
+ The reading of the word