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,53 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / DictWord
6
+
7
+ # Interface: DictWord
8
+
9
+ Defined in: types.ts:125
10
+
11
+ JMdict entry (word)
12
+
13
+ Equivalent to the `entry` JMdict element
14
+
15
+ ## Properties
16
+
17
+ ### id
18
+
19
+ > `readonly` **id**: `string`
20
+
21
+ Defined in: types.ts:129
22
+
23
+ The entry sequence number
24
+
25
+ ***
26
+
27
+ ### kanjiForms?
28
+
29
+ > `optional` **kanjiForms**: [`DictKanjiForm`](DictKanjiForm.md)[]
30
+
31
+ Defined in: types.ts:133
32
+
33
+ The word's kanji forms
34
+
35
+ ***
36
+
37
+ ### meanings
38
+
39
+ > **meanings**: [`DictMeaning`](DictMeaning.md)[]
40
+
41
+ Defined in: types.ts:141
42
+
43
+ The word's meanings/senses
44
+
45
+ ***
46
+
47
+ ### readings
48
+
49
+ > **readings**: [`DictReading`](DictReading.md)[]
50
+
51
+ Defined in: types.ts:137
52
+
53
+ The word's readings
@@ -0,0 +1,75 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / ExamplePart
6
+
7
+ # Interface: ExamplePart
8
+
9
+ Defined in: types.ts:279
10
+
11
+ A word/part from the `B` section of a Tanaka Corpus `examples.utf` entry
12
+
13
+ ## Properties
14
+
15
+ ### baseForm
16
+
17
+ > **baseForm**: `string`
18
+
19
+ Defined in: types.ts:283
20
+
21
+ The common form in which the word is found in JMdict
22
+
23
+ ***
24
+
25
+ ### edited?
26
+
27
+ > `optional` **edited**: `true`
28
+
29
+ Defined in: types.ts:307
30
+
31
+ Whether or not the word is part of an entry that has been edited and adapted
32
+
33
+ [https://www.edrdg.org/wiki/Tanaka\_Corpus.html#Subset](https://www.edrdg.org/wiki/Tanaka_Corpus.html#Subset)
34
+
35
+ [https://www.edrdg.org/wiki/Tanaka\_Corpus.html#Initial\_Modifications\_to\_the\_Corpus](https://www.edrdg.org/wiki/Tanaka_Corpus.html#Initial_Modifications_to_the_Corpus)
36
+
37
+ ***
38
+
39
+ ### glossNumber?
40
+
41
+ > `optional` **glossNumber**: `number`
42
+
43
+ Defined in: types.ts:291
44
+
45
+ The JMdict sense number corresponding to the word’s usage in the phrase
46
+
47
+ ***
48
+
49
+ ### inflectedForm?
50
+
51
+ > `optional` **inflectedForm**: `string`
52
+
53
+ Defined in: types.ts:295
54
+
55
+ The actual form in which the word is used in the phrase
56
+
57
+ ***
58
+
59
+ ### reading?
60
+
61
+ > `optional` **reading**: `string`
62
+
63
+ Defined in: types.ts:287
64
+
65
+ The reading (in kana) of the word
66
+
67
+ ***
68
+
69
+ ### referenceID?
70
+
71
+ > `optional` **referenceID**: `string`
72
+
73
+ Defined in: types.ts:299
74
+
75
+ A sequence number that references a JMdict entry associated with the word
@@ -0,0 +1,165 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / Grammar
6
+
7
+ # Interface: Grammar
8
+
9
+ Defined in: types.ts:634
10
+
11
+ Grammar point information
12
+
13
+ ## Extends
14
+
15
+ - [`ResultEntry`](ResultEntry.md)\<`"grammar"`\>
16
+
17
+ ## Properties
18
+
19
+ ### audio?
20
+
21
+ > `optional` **audio**: `string`
22
+
23
+ Defined in: types.ts:666
24
+
25
+ The filename of an audio file for the grammar point
26
+
27
+ ***
28
+
29
+ ### deckPath?
30
+
31
+ > `optional` **deckPath**: `string`
32
+
33
+ Defined in: types.ts:366
34
+
35
+ The full path of the Anki deck
36
+
37
+ #### Inherited from
38
+
39
+ [`ResultEntry`](ResultEntry.md).[`deckPath`](ResultEntry.md#deckpath)
40
+
41
+ ***
42
+
43
+ ### id?
44
+
45
+ > `readonly` `optional` **id**: `string`
46
+
47
+ Defined in: types.ts:358
48
+
49
+ ID used for the Anki note ID
50
+
51
+ #### Inherited from
52
+
53
+ [`ResultEntry`](ResultEntry.md).[`id`](ResultEntry.md#id)
54
+
55
+ ***
56
+
57
+ ### jlpt?
58
+
59
+ > `optional` **jlpt**: [`JLPT`](../type-aliases/JLPT.md)
60
+
61
+ Defined in: types.ts:658
62
+
63
+ The \[post-2010 JLPT\](https://en.wikipedia.org/wiki/Japanese-Language\_Proficiency\_Test#Test\_format) level
64
+
65
+ ***
66
+
67
+ ### meaning
68
+
69
+ > **meaning**: [`GrammarMeaning`](GrammarMeaning.md)
70
+
71
+ Defined in: types.ts:642
72
+
73
+ The English meaning/translation of the grammar point
74
+
75
+ ***
76
+
77
+ ### noteID?
78
+
79
+ > `readonly` `optional` **noteID**: `` `grammar_${string}` ``
80
+
81
+ Defined in: types.ts:354
82
+
83
+ ID used for the resulting Anki note
84
+
85
+ #### Inherited from
86
+
87
+ [`ResultEntry`](ResultEntry.md).[`noteID`](ResultEntry.md#noteid)
88
+
89
+ ***
90
+
91
+ ### noteTypeName?
92
+
93
+ > `optional` **noteTypeName**: `string`
94
+
95
+ Defined in: types.ts:362
96
+
97
+ Anki note type name
98
+
99
+ #### Inherited from
100
+
101
+ [`ResultEntry`](ResultEntry.md).[`noteTypeName`](ResultEntry.md#notetypename)
102
+
103
+ ***
104
+
105
+ ### phrases?
106
+
107
+ > `optional` **phrases**: [`Phrase`](Phrase.md)[]
108
+
109
+ Defined in: types.ts:654
110
+
111
+ Example phrase using the grammar point
112
+
113
+ ***
114
+
115
+ ### point
116
+
117
+ > `readonly` **point**: `string`
118
+
119
+ Defined in: types.ts:638
120
+
121
+ The most common form in which the grammar point written in
122
+
123
+ ***
124
+
125
+ ### readings?
126
+
127
+ > `optional` **readings**: [`Reading`](Reading.md)[]
128
+
129
+ Defined in: types.ts:646
130
+
131
+ The readings of the grammar point
132
+
133
+ ***
134
+
135
+ ### source?
136
+
137
+ > `optional` **source**: `string`
138
+
139
+ Defined in: types.ts:662
140
+
141
+ The source from which data for this grammar point has been extracted
142
+
143
+ ***
144
+
145
+ ### tags?
146
+
147
+ > `optional` **tags**: `string`[]
148
+
149
+ Defined in: types.ts:370
150
+
151
+ Tags generated based on the entry's information
152
+
153
+ #### Inherited from
154
+
155
+ [`ResultEntry`](ResultEntry.md).[`tags`](ResultEntry.md#tags)
156
+
157
+ ***
158
+
159
+ ### usages?
160
+
161
+ > `optional` **usages**: `string`[]
162
+
163
+ Defined in: types.ts:650
164
+
165
+ Ways in which the grammar point is used in Japanese
@@ -0,0 +1,31 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / GrammarMeaning
6
+
7
+ # Interface: GrammarMeaning
8
+
9
+ Defined in: types.ts:620
10
+
11
+ Grammar point meaning
12
+
13
+ ## Properties
14
+
15
+ ### example?
16
+
17
+ > `optional` **example**: `string`
18
+
19
+ Defined in: types.ts:628
20
+
21
+ An example phrase using the grammar point
22
+
23
+ ***
24
+
25
+ ### meaning
26
+
27
+ > **meaning**: `string`
28
+
29
+ Defined in: types.ts:624
30
+
31
+ The meaning of the grammar point
@@ -0,0 +1,125 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / Kana
6
+
7
+ # Interface: Kana
8
+
9
+ Defined in: types.ts:598
10
+
11
+ Kana information
12
+
13
+ ## Extends
14
+
15
+ - [`ResultEntry`](ResultEntry.md)\<`"kana"`\>
16
+
17
+ ## Properties
18
+
19
+ ### audio?
20
+
21
+ > `optional` **audio**: `string`
22
+
23
+ Defined in: types.ts:610
24
+
25
+ The filename of an audio file for the kana reading
26
+
27
+ ***
28
+
29
+ ### deckPath?
30
+
31
+ > `optional` **deckPath**: `string`
32
+
33
+ Defined in: types.ts:366
34
+
35
+ The full path of the Anki deck
36
+
37
+ #### Inherited from
38
+
39
+ [`ResultEntry`](ResultEntry.md).[`deckPath`](ResultEntry.md#deckpath)
40
+
41
+ ***
42
+
43
+ ### id?
44
+
45
+ > `readonly` `optional` **id**: `string`
46
+
47
+ Defined in: types.ts:358
48
+
49
+ ID used for the Anki note ID
50
+
51
+ #### Inherited from
52
+
53
+ [`ResultEntry`](ResultEntry.md).[`id`](ResultEntry.md#id)
54
+
55
+ ***
56
+
57
+ ### kana
58
+
59
+ > `readonly` **kana**: `string`
60
+
61
+ Defined in: types.ts:602
62
+
63
+ The kana character
64
+
65
+ ***
66
+
67
+ ### noteID?
68
+
69
+ > `readonly` `optional` **noteID**: `` `kana_${string}` ``
70
+
71
+ Defined in: types.ts:354
72
+
73
+ ID used for the resulting Anki note
74
+
75
+ #### Inherited from
76
+
77
+ [`ResultEntry`](ResultEntry.md).[`noteID`](ResultEntry.md#noteid)
78
+
79
+ ***
80
+
81
+ ### noteTypeName?
82
+
83
+ > `optional` **noteTypeName**: `string`
84
+
85
+ Defined in: types.ts:362
86
+
87
+ Anki note type name
88
+
89
+ #### Inherited from
90
+
91
+ [`ResultEntry`](ResultEntry.md).[`noteTypeName`](ResultEntry.md#notetypename)
92
+
93
+ ***
94
+
95
+ ### reading
96
+
97
+ > **reading**: `string`
98
+
99
+ Defined in: types.ts:606
100
+
101
+ The romaji reading of the kana
102
+
103
+ ***
104
+
105
+ ### svg?
106
+
107
+ > `optional` **svg**: `string`
108
+
109
+ Defined in: types.ts:614
110
+
111
+ The kana SVG filename
112
+
113
+ ***
114
+
115
+ ### tags?
116
+
117
+ > `optional` **tags**: `string`[]
118
+
119
+ Defined in: types.ts:370
120
+
121
+ Tags generated based on the entry's information
122
+
123
+ #### Inherited from
124
+
125
+ [`ResultEntry`](ResultEntry.md).[`tags`](ResultEntry.md#tags)
@@ -0,0 +1,239 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / Kanji
6
+
7
+ # Interface: Kanji
8
+
9
+ Defined in: types.ts:444
10
+
11
+ Kanji information
12
+
13
+ Converted from [DictKanji](DictKanji.md) and extra info added
14
+
15
+ ## Extends
16
+
17
+ - [`ResultEntry`](ResultEntry.md)\<`"kanji"`\>
18
+
19
+ ## Properties
20
+
21
+ ### components?
22
+
23
+ > `optional` **components**: [`KanjiComponent`](KanjiComponent.md)[]
24
+
25
+ Defined in: types.ts:476
26
+
27
+ The kanji radicals/components
28
+
29
+ ***
30
+
31
+ ### deckPath?
32
+
33
+ > `optional` **deckPath**: `string`
34
+
35
+ Defined in: types.ts:366
36
+
37
+ The full path of the Anki deck
38
+
39
+ #### Inherited from
40
+
41
+ [`ResultEntry`](ResultEntry.md).[`deckPath`](ResultEntry.md#deckpath)
42
+
43
+ ***
44
+
45
+ ### frequency?
46
+
47
+ > `optional` **frequency**: `string`
48
+
49
+ Defined in: types.ts:492
50
+
51
+ #### See
52
+
53
+ [DictKanjiMisc.frequency](DictKanjiMisc.md#frequency)
54
+
55
+ ***
56
+
57
+ ### fromJpdb?
58
+
59
+ > `optional` **fromJpdb**: `true`
60
+
61
+ Defined in: types.ts:500
62
+
63
+ Whether or not this kanji object contains information **only** from `jpdb.io`
64
+
65
+ ***
66
+
67
+ ### grade?
68
+
69
+ > `optional` **grade**: `string`
70
+
71
+ Defined in: types.ts:488
72
+
73
+ #### See
74
+
75
+ [DictKanjiMisc.grade](DictKanjiMisc.md#grade)
76
+
77
+ ***
78
+
79
+ ### id?
80
+
81
+ > `readonly` `optional` **id**: `string`
82
+
83
+ Defined in: types.ts:358
84
+
85
+ ID used for the Anki note ID
86
+
87
+ #### Inherited from
88
+
89
+ [`ResultEntry`](ResultEntry.md).[`id`](ResultEntry.md#id)
90
+
91
+ ***
92
+
93
+ ### kanji
94
+
95
+ > `readonly` **kanji**: `string`
96
+
97
+ Defined in: types.ts:448
98
+
99
+ #### See
100
+
101
+ [DictKanji.kanji](DictKanji.md#kanji)
102
+
103
+ ***
104
+
105
+ ### kunyomi?
106
+
107
+ > `optional` **kunyomi**: `string`[]
108
+
109
+ Defined in: types.ts:464
110
+
111
+ The kanji kunyomi readings
112
+
113
+ ***
114
+
115
+ ### meanings?
116
+
117
+ > `optional` **meanings**: `string`[]
118
+
119
+ Defined in: types.ts:456
120
+
121
+ #### See
122
+
123
+ [DictKanjiReadingMeaningGroup.meanings](DictKanjiReadingMeaningGroup.md#meanings)
124
+
125
+ ***
126
+
127
+ ### mnemonic?
128
+
129
+ > `optional` **mnemonic**: `string`
130
+
131
+ Defined in: types.ts:480
132
+
133
+ The kanji mnemonic
134
+
135
+ ***
136
+
137
+ ### nanori?
138
+
139
+ > `optional` **nanori**: `string`[]
140
+
141
+ Defined in: types.ts:468
142
+
143
+ #### See
144
+
145
+ [DictKanjiReadingMeaning.nanori](DictKanjiReadingMeaning.md#nanori)
146
+
147
+ ***
148
+
149
+ ### noteID?
150
+
151
+ > `readonly` `optional` **noteID**: `` `kanji_${string}` ``
152
+
153
+ Defined in: types.ts:354
154
+
155
+ ID used for the resulting Anki note
156
+
157
+ #### Inherited from
158
+
159
+ [`ResultEntry`](ResultEntry.md).[`noteID`](ResultEntry.md#noteid)
160
+
161
+ ***
162
+
163
+ ### noteTypeName?
164
+
165
+ > `optional` **noteTypeName**: `string`
166
+
167
+ Defined in: types.ts:362
168
+
169
+ Anki note type name
170
+
171
+ #### Inherited from
172
+
173
+ [`ResultEntry`](ResultEntry.md).[`noteTypeName`](ResultEntry.md#notetypename)
174
+
175
+ ***
176
+
177
+ ### onyomi?
178
+
179
+ > `optional` **onyomi**: `string`[]
180
+
181
+ Defined in: types.ts:460
182
+
183
+ The kanji onyomi readings
184
+
185
+ ***
186
+
187
+ ### source?
188
+
189
+ > `optional` **source**: `string`
190
+
191
+ Defined in: types.ts:496
192
+
193
+ The source (besides KANJIDIC) from which data for this kanji has been extracted
194
+
195
+ ***
196
+
197
+ ### strokes?
198
+
199
+ > `optional` **strokes**: `string`
200
+
201
+ Defined in: types.ts:452
202
+
203
+ #### See
204
+
205
+ [DictKanjiMisc.strokeNumber](DictKanjiMisc.md#strokenumber)
206
+
207
+ ***
208
+
209
+ ### svg?
210
+
211
+ > `optional` **svg**: `string`
212
+
213
+ Defined in: types.ts:472
214
+
215
+ The kanji SVG filename
216
+
217
+ ***
218
+
219
+ ### tags?
220
+
221
+ > `optional` **tags**: `string`[]
222
+
223
+ Defined in: types.ts:370
224
+
225
+ Tags generated based on the entry's information
226
+
227
+ #### Inherited from
228
+
229
+ [`ResultEntry`](ResultEntry.md).[`tags`](ResultEntry.md#tags)
230
+
231
+ ***
232
+
233
+ ### words?
234
+
235
+ > `optional` **words**: [`Word`](Word.md)[]
236
+
237
+ Defined in: types.ts:484
238
+
239
+ Words that use the kanji
@@ -0,0 +1,31 @@
1
+ [**henkan**](../README.md)
2
+
3
+ ***
4
+
5
+ [henkan](../README.md) / KanjiComponent
6
+
7
+ # Interface: KanjiComponent
8
+
9
+ Defined in: types.ts:428
10
+
11
+ Kanji component information
12
+
13
+ ## Properties
14
+
15
+ ### component
16
+
17
+ > `readonly` **component**: `string`
18
+
19
+ Defined in: types.ts:432
20
+
21
+ The component character
22
+
23
+ ***
24
+
25
+ ### meaning?
26
+
27
+ > `optional` **meaning**: `string`
28
+
29
+ Defined in: types.ts:436
30
+
31
+ The meaning of the component