lipilekhika 0.0.0-alpha.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.
- package/LICENCE +21 -0
- package/dist/cjs/Assamese-XEQTyfct.cjs +1 -0
- package/dist/cjs/Bengali-D2Avg7y5.cjs +1 -0
- package/dist/cjs/Brahmi-BSNlnbZQ.cjs +1 -0
- package/dist/cjs/Devanagari-DlLe4bTz.cjs +1 -0
- package/dist/cjs/Granth-C1KI6URU.cjs +1 -0
- package/dist/cjs/Gujarati-o5mkuq5w.cjs +1 -0
- package/dist/cjs/Gurumukhi-BVnoHLMh.cjs +1 -0
- package/dist/cjs/Kannada-TJne1nHl.cjs +1 -0
- package/dist/cjs/Malayalam-rzH0lQeR.cjs +1 -0
- package/dist/cjs/Modi-oCX1F3MA.cjs +1 -0
- package/dist/cjs/Normal-DH5amFON.cjs +1 -0
- package/dist/cjs/Odia-D2mkc5e6.cjs +1 -0
- package/dist/cjs/Purna-Devanagari-BFA6HSLu.cjs +1 -0
- package/dist/cjs/Romanized-RxM_tJH1.cjs +1 -0
- package/dist/cjs/Sharada-0nPRRBhM.cjs +1 -0
- package/dist/cjs/Siddham-BcDB8JF_.cjs +1 -0
- package/dist/cjs/Sinhala-CAfV5XMs.cjs +1 -0
- package/dist/cjs/Tamil-Extended-0c8V-Gq6.cjs +1 -0
- package/dist/cjs/Tamil-mKB0b7m7.cjs +1 -0
- package/dist/cjs/Telugu-BBI5W8bV.cjs +1 -0
- package/dist/cjs/index.cjs +2 -0
- package/dist/esm/Assamese-z_O8rgM7.js +25 -0
- package/dist/esm/Bengali-B5NxcuQl.js +25 -0
- package/dist/esm/Brahmi-DQEt4ab5.js +23 -0
- package/dist/esm/Devanagari-COds0Ly9.js +25 -0
- package/dist/esm/Granth-6M0sNLMm.js +25 -0
- package/dist/esm/Gujarati-BswRafQu.js +25 -0
- package/dist/esm/Gurumukhi-DMfC5qfV.js +25 -0
- package/dist/esm/Kannada-CaQZLXU6.js +25 -0
- package/dist/esm/Malayalam-DVQUtpNx.js +23 -0
- package/dist/esm/Modi-D67yHXV8.js +23 -0
- package/dist/esm/Normal-BGSYJw1G.js +21 -0
- package/dist/esm/Odia-BbozUhq8.js +25 -0
- package/dist/esm/Purna-Devanagari-g-Ng6VXT.js +25 -0
- package/dist/esm/Romanized-Ddk1XmGD.js +21 -0
- package/dist/esm/Sharada-B5cJPdZz.js +25 -0
- package/dist/esm/Siddham-CE-8I1r9.js +25 -0
- package/dist/esm/Sinhala-xevf-UkS.js +23 -0
- package/dist/esm/Tamil-Extended-CTuc-NhA.js +23 -0
- package/dist/esm/Tamil-qhHh3zIM.js +23 -0
- package/dist/esm/Telugu-BBUqNpuS.js +23 -0
- package/dist/esm/index.mjs +618 -0
- package/dist/index.d.ts +615 -0
- package/dist/lipilekhika.umd.js +2 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/package.json +45 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
declare type acronym_type = (typeof ACRONYMS)[number];
|
|
2
|
+
|
|
3
|
+
declare const ACRONYMS: readonly ["dev", "te", "tel", "tam", "tam-ex", "ben", "be", "ka", "kan", "gu", "guj", "mal", "or", "od", "oriya", "si", "sinh", "sin", "en", "rom", "gur", "as", "sa", "san", "hin", "hi", "mar", "ne", "nep", "pun"];
|
|
4
|
+
|
|
5
|
+
export declare const ALL_LANG_SCRIPT_LIST: script_and_lang_list_type[];
|
|
6
|
+
|
|
7
|
+
declare type CommonListTypeAttributes = {
|
|
8
|
+
text: string;
|
|
9
|
+
/** In the post processing step the keys for which it is not mapped shall be left empty.
|
|
10
|
+
* It can map to multiple krama keys
|
|
11
|
+
* Each key should have at least one key krama. Scan for this too in the compilation step.
|
|
12
|
+
*/
|
|
13
|
+
text_krama: KramaKeysExtendedType[];
|
|
14
|
+
/** This contains duplicates of the key, for eg:- some nuqta symbols and mAtrAs.
|
|
15
|
+
* In the processing/compiling step it should be verified as a key of this list, display and throw the error
|
|
16
|
+
*/
|
|
17
|
+
duplicates?: string[];
|
|
18
|
+
/** In case if no entry is found for the key in krama even after de-duplication resolution
|
|
19
|
+
* then fallback array will be used. Like for malayalam .100 it can be .1+.0+.0
|
|
20
|
+
* If the fallback array is not provided, then the key_krama should be empty and will also be ignored
|
|
21
|
+
*/
|
|
22
|
+
fallback?: KramaKeysExtendedType[];
|
|
23
|
+
/** Prevent Auto Matching
|
|
24
|
+
* Useful for Cases where we dont want to use the text referenced in the key to be used for transliteration from that script to another script
|
|
25
|
+
* Like when changing from Tamil to Devanagari , kirupA it should be kirupA and not kRpA.
|
|
26
|
+
* So we can prevent the list item "text": iru, krama R) from being used to reduce itself from that form during transliteration
|
|
27
|
+
*/
|
|
28
|
+
prevent_auto_matching?: boolean;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
declare type CommonScriptData = {
|
|
32
|
+
/** Stores the key of the current script along with the reference to the index in `list` for info about the key
|
|
33
|
+
* `string` is the actual key, number(nullable) is the index of the key in the compiled `list`
|
|
34
|
+
*/
|
|
35
|
+
krama_text_arr: [krama_key: string, list_arr_ref: number | null][];
|
|
36
|
+
/** To be used for binary search on the `krama_key_map` */
|
|
37
|
+
krama_text_arr_index: number[];
|
|
38
|
+
/** `string` used for search. Usable for Duplication Remova, Fallback Behaviour
|
|
39
|
+
* and for `other` scripts type. Like Normal
|
|
40
|
+
* This will be a sorted array, so binary search can be directly used in it */
|
|
41
|
+
text_to_krama_map: [
|
|
42
|
+
text: string,
|
|
43
|
+
{
|
|
44
|
+
next?: string[] | null;
|
|
45
|
+
/** Multiple krama index references are useful to some intermediate states. For eg:- Normal A -> A, AU -> A, U and AUM -> AUM
|
|
46
|
+
* This will be useful only when there are more than two transition states. As double transition state outputs dont need multiple krama references.
|
|
47
|
+
* For eg -> The Bengali kz (actually k + nukta) will be a two step mapping, k -> k (next :nukta,... ) and k+nukta->kz krama reference in the main transliteration array
|
|
48
|
+
* There is also an option to prevent this auto behaviour. Like for tamil we dont iru in tamil to map to R in krama key so we manually disable it
|
|
49
|
+
* This can also be used to define the fallback combination. The array allows a multiple krama keys to be combined together to form a fallback
|
|
50
|
+
* Like .100 = .1+.0+.0
|
|
51
|
+
*/
|
|
52
|
+
krama?: number[] | null;
|
|
53
|
+
/** This will be useful to get info related to the fallback if they happen to be a svara or a vyanjana
|
|
54
|
+
* eg. The Malayalam .n,.N, etc
|
|
55
|
+
*/
|
|
56
|
+
fallback_list_ref?: number | null;
|
|
57
|
+
}
|
|
58
|
+
][];
|
|
59
|
+
list: {
|
|
60
|
+
/** Indexes of the the corresponding entries in `krama_key_map` corresponding to the `key_krama` */
|
|
61
|
+
krama_ref: number[];
|
|
62
|
+
type: NonNullable<NonNullable<InputOtherScriptType['list']>[number]['type']>;
|
|
63
|
+
}[];
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
declare type CustomOptionList = keyof typeof _default;
|
|
67
|
+
|
|
68
|
+
declare type CustomOptionType = {
|
|
69
|
+
[key in CustomOptionList]?: boolean;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
declare const _default: {
|
|
73
|
+
"all_to_normal:replace_pancham_varga_varna_with_n": {
|
|
74
|
+
"from_script_type": "all",
|
|
75
|
+
"to_script_name": [
|
|
76
|
+
"Normal"
|
|
77
|
+
],
|
|
78
|
+
"check_in": "output",
|
|
79
|
+
"rules": [
|
|
80
|
+
{
|
|
81
|
+
"type": "replace_prev_krama_keys",
|
|
82
|
+
"check_in": "output",
|
|
83
|
+
"prev": [
|
|
84
|
+
60
|
|
85
|
+
],
|
|
86
|
+
"following": [
|
|
87
|
+
52,
|
|
88
|
+
53,
|
|
89
|
+
54,
|
|
90
|
+
55,
|
|
91
|
+
56,
|
|
92
|
+
57,
|
|
93
|
+
58,
|
|
94
|
+
59
|
|
95
|
+
],
|
|
96
|
+
"replace_with": [
|
|
97
|
+
72
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"type": "replace_prev_krama_keys",
|
|
102
|
+
"check_in": "output",
|
|
103
|
+
"prev": [
|
|
104
|
+
67
|
|
105
|
+
],
|
|
106
|
+
"following": [
|
|
107
|
+
61,
|
|
108
|
+
62,
|
|
109
|
+
63,
|
|
110
|
+
64,
|
|
111
|
+
65,
|
|
112
|
+
66
|
|
113
|
+
],
|
|
114
|
+
"replace_with": [
|
|
115
|
+
72
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
"brahmic_to_brahmic:replace_pancham_varga_varna_with_anuvsvAra": {
|
|
121
|
+
"from_script_type": "brahmic",
|
|
122
|
+
"to_script_type": "brahmic",
|
|
123
|
+
"check_in": "input",
|
|
124
|
+
"rules": [
|
|
125
|
+
{
|
|
126
|
+
"type": "replace_prev_krama_keys",
|
|
127
|
+
"check_in": "input",
|
|
128
|
+
"prev": [
|
|
129
|
+
60,
|
|
130
|
+
49
|
|
131
|
+
],
|
|
132
|
+
"following": [
|
|
133
|
+
52,
|
|
134
|
+
53,
|
|
135
|
+
54,
|
|
136
|
+
55,
|
|
137
|
+
56,
|
|
138
|
+
57,
|
|
139
|
+
58,
|
|
140
|
+
59
|
|
141
|
+
],
|
|
142
|
+
"replace_with": [
|
|
143
|
+
45
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"type": "replace_prev_krama_keys",
|
|
148
|
+
"check_in": "input",
|
|
149
|
+
"prev": [
|
|
150
|
+
67,
|
|
151
|
+
49
|
|
152
|
+
],
|
|
153
|
+
"following": [
|
|
154
|
+
61,
|
|
155
|
+
62,
|
|
156
|
+
63,
|
|
157
|
+
64,
|
|
158
|
+
65,
|
|
159
|
+
66
|
|
160
|
+
],
|
|
161
|
+
"replace_with": [
|
|
162
|
+
45
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"type": "replace_prev_krama_keys",
|
|
167
|
+
"check_in": "input",
|
|
168
|
+
"prev": [
|
|
169
|
+
81,
|
|
170
|
+
49
|
|
171
|
+
],
|
|
172
|
+
"following": [
|
|
173
|
+
74,
|
|
174
|
+
75,
|
|
175
|
+
76,
|
|
176
|
+
77,
|
|
177
|
+
78,
|
|
178
|
+
79,
|
|
179
|
+
80
|
|
180
|
+
],
|
|
181
|
+
"replace_with": [
|
|
182
|
+
45
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"type": "replace_prev_krama_keys",
|
|
187
|
+
"check_in": "input",
|
|
188
|
+
"prev": [
|
|
189
|
+
72,
|
|
190
|
+
49
|
|
191
|
+
],
|
|
192
|
+
"following": [
|
|
193
|
+
68,
|
|
194
|
+
69,
|
|
195
|
+
70,
|
|
196
|
+
71
|
|
197
|
+
],
|
|
198
|
+
"replace_with": [
|
|
199
|
+
45
|
|
200
|
+
]
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"type": "replace_prev_krama_keys",
|
|
204
|
+
"check_in": "input",
|
|
205
|
+
"prev": [
|
|
206
|
+
88,
|
|
207
|
+
49
|
|
208
|
+
],
|
|
209
|
+
"following": [
|
|
210
|
+
82,
|
|
211
|
+
83,
|
|
212
|
+
85,
|
|
213
|
+
86,
|
|
214
|
+
87
|
|
215
|
+
],
|
|
216
|
+
"replace_with": [
|
|
217
|
+
45
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
"all_to_sinhala:use_conjuct_enabling_halant": {
|
|
223
|
+
"from_script_type": "all",
|
|
224
|
+
"to_script_name": [
|
|
225
|
+
"Sinhala"
|
|
226
|
+
],
|
|
227
|
+
"check_in": "output",
|
|
228
|
+
"rules": [
|
|
229
|
+
{
|
|
230
|
+
"type": "direct_replace",
|
|
231
|
+
"check_in": "output",
|
|
232
|
+
"to_replace": [
|
|
233
|
+
[
|
|
234
|
+
49
|
|
235
|
+
]
|
|
236
|
+
],
|
|
237
|
+
"replace_with": [
|
|
238
|
+
49,
|
|
239
|
+
117
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
"all_to_normal:remove_virAma_and_double_virAma": {
|
|
245
|
+
"from_script_type": "all",
|
|
246
|
+
"to_script_name": [
|
|
247
|
+
"Normal",
|
|
248
|
+
"Romanized"
|
|
249
|
+
],
|
|
250
|
+
"check_in": "output",
|
|
251
|
+
"rules": [
|
|
252
|
+
{
|
|
253
|
+
"type": "direct_replace",
|
|
254
|
+
"check_in": "output",
|
|
255
|
+
"to_replace": [
|
|
256
|
+
[
|
|
257
|
+
116
|
|
258
|
+
],
|
|
259
|
+
[
|
|
260
|
+
115
|
|
261
|
+
]
|
|
262
|
+
],
|
|
263
|
+
"replace_with": [
|
|
264
|
+
-1
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
]
|
|
268
|
+
},
|
|
269
|
+
"all_to_normal:replace_avagraha_with_a": {
|
|
270
|
+
"from_script_type": "all",
|
|
271
|
+
"to_script_name": [
|
|
272
|
+
"Normal",
|
|
273
|
+
"Romanized"
|
|
274
|
+
],
|
|
275
|
+
"check_in": "output",
|
|
276
|
+
"rules": [
|
|
277
|
+
{
|
|
278
|
+
"type": "direct_replace",
|
|
279
|
+
"check_in": "output",
|
|
280
|
+
"to_replace": [
|
|
281
|
+
[
|
|
282
|
+
48
|
|
283
|
+
]
|
|
284
|
+
],
|
|
285
|
+
"replace_with": [
|
|
286
|
+
1
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
]
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* This returns the list of all supported custom options for
|
|
295
|
+
* transliterations for the provided script pair
|
|
296
|
+
* @param from_script_name - The script/language to transliterate from
|
|
297
|
+
* @param to_script_name - The script/language to transliterate to
|
|
298
|
+
* @returns The list of all supported custom options for the provided script pair
|
|
299
|
+
*/
|
|
300
|
+
export declare function getAllOptions(from_script_name: ScriptLangType, to_script_name: ScriptLangType): Promise<("all_to_normal:replace_pancham_varga_varna_with_n" | "brahmic_to_brahmic:replace_pancham_varga_varna_with_anuvsvAra" | "all_to_sinhala:use_conjuct_enabling_halant" | "all_to_normal:remove_virAma_and_double_virAma" | "all_to_normal:replace_avagraha_with_a")[]>;
|
|
301
|
+
|
|
302
|
+
declare type InputBrahmicScriptType = {
|
|
303
|
+
script_name: script_list_type;
|
|
304
|
+
script_id: number;
|
|
305
|
+
script_type: 'brahmic';
|
|
306
|
+
/**
|
|
307
|
+
* An attribute for some ancient scripts which use 4 byte utf-8 representation.
|
|
308
|
+
* Instead of the usual 3 byte for most modern indian scripts.
|
|
309
|
+
* Examples(non-bmp scripts): Brahmi, Grantha, Siddham, Sharada, Modi, etc.
|
|
310
|
+
*
|
|
311
|
+
* BMP (Basic Multilingual Plane)
|
|
312
|
+
*/
|
|
313
|
+
non_bmp_script?: boolean;
|
|
314
|
+
/**
|
|
315
|
+
* A sorted range array. Used to check if the incomming character has to be processed or can be ignored.
|
|
316
|
+
* Main Ranges will be specified manually (Like for a Brahmic Script). And Ranges for Additional charcters used shall be added manually
|
|
317
|
+
*
|
|
318
|
+
* This will help us more strictly specify what to process and what not to.
|
|
319
|
+
* In future this will be a mandatory field and ?
|
|
320
|
+
*/
|
|
321
|
+
ranges?: [[number, number][]];
|
|
322
|
+
halant: string;
|
|
323
|
+
nuqta?: string;
|
|
324
|
+
/**
|
|
325
|
+
* Schwa deletion indicator for the script(or rather language in most cases).
|
|
326
|
+
* This will be used for live typing and not for conversion.
|
|
327
|
+
* It can be overriden later on provided as a argument in the typing tool
|
|
328
|
+
*/
|
|
329
|
+
schwa_property: boolean;
|
|
330
|
+
/**
|
|
331
|
+
* This has a lower precedence than the auto generated/compiled krama key map from the `list` items. So it will be overwritten by them.
|
|
332
|
+
* Moreover the keys here will not be checked to exist in `list`. This allows direct keymaps and can be useful for scripts like Normal, Romanized
|
|
333
|
+
* Intermediate steps will be auto generated. Eg. for Normal ख : kh will add both k (next h) and kh in the
|
|
334
|
+
*/
|
|
335
|
+
manual_krama_text_map?: {
|
|
336
|
+
[key in KramaKeysExtendedType]?: string;
|
|
337
|
+
};
|
|
338
|
+
/** One important need of this list is to just contain information about the keys.
|
|
339
|
+
* The keys for which it does not contain information can be considered as type `anya`.
|
|
340
|
+
* So not all keys need to be present in this list.
|
|
341
|
+
*/
|
|
342
|
+
list: (CommonListTypeAttributes & ({
|
|
343
|
+
type: 'svara';
|
|
344
|
+
mAtrA: string;
|
|
345
|
+
mAtrA_text_krama: KramaKeysExtendedType[];
|
|
346
|
+
mAtrA_duplicates?: string[];
|
|
347
|
+
mAtrA_fallback?: KramaKeysExtendedType[];
|
|
348
|
+
} | {
|
|
349
|
+
type: 'vyanjana' | 'anya';
|
|
350
|
+
}))[];
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
declare type InputOtherScriptType = {
|
|
354
|
+
script_name: script_list_type;
|
|
355
|
+
script_id: number;
|
|
356
|
+
script_type: 'other';
|
|
357
|
+
/** Schwa deletion character, usually `a` */
|
|
358
|
+
schwa_character: string;
|
|
359
|
+
manual_krama_text_map: {
|
|
360
|
+
[key in KramaKeysExtendedType]?: string;
|
|
361
|
+
};
|
|
362
|
+
/** This might not be needed here usually as most of the work would be done using the `manual_krama_text_map` */
|
|
363
|
+
list?: (CommonListTypeAttributes & {
|
|
364
|
+
/** `type` is kind of redundant here as other scripts don't have a concept of svara and vyanjana */
|
|
365
|
+
type?: 'anya';
|
|
366
|
+
})[];
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
declare const KramaKeysArray: (keyof typeof KramaKeysMap)[];
|
|
370
|
+
|
|
371
|
+
/** This type will be used as a convinient method to dscribe the krama key which we want to map to
|
|
372
|
+
* This shall be ultimately converted to KramaKeysType
|
|
373
|
+
*/
|
|
374
|
+
declare type KramaKeysExtendedType = KramaKeysType | KramaKeysLabelType;
|
|
375
|
+
|
|
376
|
+
declare type KramaKeysLabelType = (typeof KramaKeysMap)[KramaKeysType];
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* These Krama keys are written in an order where the keys which comes first shall take precedence if in the krama_text_map two have the same key
|
|
380
|
+
* then the one that comes first shall be chosen
|
|
381
|
+
* For eg. kau (from Bengali)
|
|
382
|
+
* the "au" can land both on au and auU because of tne nature of the binary search algorithm
|
|
383
|
+
* so to componsate that we chose the first one in case of multiple possible mappings
|
|
384
|
+
*
|
|
385
|
+
* So Be careful with similar mAtrAs, different forms of the same vyanajana (like with nuqta and other forms)
|
|
386
|
+
*/
|
|
387
|
+
declare const KramaKeysMap: {
|
|
388
|
+
readonly ॐ: "AUM";
|
|
389
|
+
readonly अ: "a-svara";
|
|
390
|
+
readonly '': "a-mAtrA";
|
|
391
|
+
readonly ॳ: "a1-svara";
|
|
392
|
+
readonly '\u093A': "a1-mAtrA";
|
|
393
|
+
readonly आ: "A-svara";
|
|
394
|
+
readonly '\u093E': "A-mAtrA";
|
|
395
|
+
readonly ॴ: "A1-svara";
|
|
396
|
+
readonly '\u093B': "A1-mAtrA";
|
|
397
|
+
readonly इ: "i-svara";
|
|
398
|
+
readonly '\u093F': "i-mAtrA";
|
|
399
|
+
readonly ई: "I-svara";
|
|
400
|
+
readonly '\u0940': "I-mAtrA";
|
|
401
|
+
readonly उ: "u-svara";
|
|
402
|
+
readonly '\u0941': "u-mAtrA";
|
|
403
|
+
readonly ॶ: "u1-svara";
|
|
404
|
+
readonly '\u0956': "u1-mAtrA";
|
|
405
|
+
readonly ऊ: "U-svara";
|
|
406
|
+
readonly '\u0942': "U-mAtrA";
|
|
407
|
+
readonly ॷ: "U1-svara";
|
|
408
|
+
readonly '\u0957': "U1-mAtrA";
|
|
409
|
+
readonly ए: "E-svara";
|
|
410
|
+
readonly '\u0947': "E-mAtrA";
|
|
411
|
+
readonly ऎ: "e-svara";
|
|
412
|
+
readonly '\u0946': "e-mAtrA";
|
|
413
|
+
readonly ऐ: "ai-svara";
|
|
414
|
+
readonly '\u0948': "ai-mAtrA";
|
|
415
|
+
readonly ऍ: "aiI-svara";
|
|
416
|
+
readonly '\u0945': "aiI-mAtrA";
|
|
417
|
+
readonly ओ: "O-svara";
|
|
418
|
+
readonly '\u094B': "O-mAtrA";
|
|
419
|
+
readonly ऒ: "o-svara";
|
|
420
|
+
readonly '\u094A': "o-mAtrA";
|
|
421
|
+
readonly औ: "au-svara";
|
|
422
|
+
readonly '\u094C': "au-mAtrA";
|
|
423
|
+
readonly ऑ: "auU-svara";
|
|
424
|
+
readonly '\u0949': "auU-mAtrA";
|
|
425
|
+
readonly ऋ: "R-svara";
|
|
426
|
+
readonly '\u0943': "R-mAtrA";
|
|
427
|
+
readonly ॠ: "RR-svara";
|
|
428
|
+
readonly '\u0944': "RR-mAtrA";
|
|
429
|
+
readonly ऌ: "LR-svara";
|
|
430
|
+
readonly '\u0962': "LR-mAtrA";
|
|
431
|
+
readonly ॡ: "LRR-svara";
|
|
432
|
+
readonly '\u0963': "LRR-mAtrA";
|
|
433
|
+
readonly '\u0902': "anusvAra";
|
|
434
|
+
readonly '\u0901': "anunAnAsika";
|
|
435
|
+
readonly '\u0903': "visarga";
|
|
436
|
+
readonly ऽ: "avagraha";
|
|
437
|
+
readonly '\u094D': "halant";
|
|
438
|
+
readonly '\u093C': "nuqta";
|
|
439
|
+
readonly '\u0970': "saMkShepachihna";
|
|
440
|
+
readonly क: "k";
|
|
441
|
+
readonly क़: "kz";
|
|
442
|
+
readonly ख: "kh";
|
|
443
|
+
readonly ख़: "khz";
|
|
444
|
+
readonly ग: "g";
|
|
445
|
+
readonly ग़: "gz";
|
|
446
|
+
readonly ॻ: "g1";
|
|
447
|
+
readonly घ: "gh";
|
|
448
|
+
readonly ङ: "G";
|
|
449
|
+
readonly च: "C";
|
|
450
|
+
readonly छ: "Ch";
|
|
451
|
+
readonly ज: "j";
|
|
452
|
+
readonly ज़: "jz";
|
|
453
|
+
readonly ॼ: "j1";
|
|
454
|
+
readonly झ: "jh";
|
|
455
|
+
readonly ञ: "J";
|
|
456
|
+
readonly त: "t";
|
|
457
|
+
readonly थ: "th";
|
|
458
|
+
readonly द: "d";
|
|
459
|
+
readonly ध: "dh";
|
|
460
|
+
readonly न: "n";
|
|
461
|
+
readonly ऩ: "nz";
|
|
462
|
+
readonly ट: "T";
|
|
463
|
+
readonly ठ: "Th";
|
|
464
|
+
readonly ड: "D";
|
|
465
|
+
readonly ड़: "Dz";
|
|
466
|
+
readonly ॾ: "D1";
|
|
467
|
+
readonly ढ: "Dh";
|
|
468
|
+
readonly ढ़: "Dhz";
|
|
469
|
+
readonly ण: "N";
|
|
470
|
+
readonly प: "p";
|
|
471
|
+
readonly फ: "ph";
|
|
472
|
+
readonly फ़: "phz";
|
|
473
|
+
readonly ब: "b";
|
|
474
|
+
readonly ॿ: "b1";
|
|
475
|
+
readonly भ: "bh";
|
|
476
|
+
readonly म: "m";
|
|
477
|
+
readonly य: "y";
|
|
478
|
+
readonly य़: "yz";
|
|
479
|
+
readonly व: "v";
|
|
480
|
+
readonly र: "r";
|
|
481
|
+
readonly ऱ: "rz";
|
|
482
|
+
readonly ल: "l";
|
|
483
|
+
readonly ळ: "L";
|
|
484
|
+
readonly ऴ: "Lz";
|
|
485
|
+
readonly ह: "h";
|
|
486
|
+
readonly स: "s";
|
|
487
|
+
readonly श: "sh";
|
|
488
|
+
readonly ष: "Sh";
|
|
489
|
+
readonly '\u0952': "anudAttA";
|
|
490
|
+
readonly '\u0951': "udAtta-1";
|
|
491
|
+
readonly '\u1CDA': "udAtta-2";
|
|
492
|
+
readonly '\u1CDB': "udAtta-3";
|
|
493
|
+
readonly '\u0966': "0";
|
|
494
|
+
readonly '\u0967': "1";
|
|
495
|
+
readonly '\u0968': "2";
|
|
496
|
+
readonly '\u0969': "3";
|
|
497
|
+
readonly '\u096A': "4";
|
|
498
|
+
readonly '\u096B': "5";
|
|
499
|
+
readonly '\u096C': "6";
|
|
500
|
+
readonly '\u096D': "7";
|
|
501
|
+
readonly '\u096E': "8";
|
|
502
|
+
readonly '\u096F': "9";
|
|
503
|
+
readonly '\u0964': "virama";
|
|
504
|
+
readonly '\u0965': "double_virama";
|
|
505
|
+
readonly '\u200D': "zero_width_joiner";
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Krama(क्रम) is the array in which most of the keys used in scripts are present
|
|
510
|
+
* It is an array which contains and describes common elements of different scripts allowing fast and efficient lookup
|
|
511
|
+
* and transliteration of different scripts
|
|
512
|
+
*/
|
|
513
|
+
declare type KramaKeysType = (typeof KramaKeysArray)[number];
|
|
514
|
+
|
|
515
|
+
export declare const LANG_LIST: lang_list_type[];
|
|
516
|
+
|
|
517
|
+
declare const lang_list: {
|
|
518
|
+
English: number;
|
|
519
|
+
Sanskrit: number;
|
|
520
|
+
Hindi: number;
|
|
521
|
+
Telugu: number;
|
|
522
|
+
Tamil: number;
|
|
523
|
+
Bengali: number;
|
|
524
|
+
Kannada: number;
|
|
525
|
+
Gujarati: number;
|
|
526
|
+
Malayalam: number;
|
|
527
|
+
Odia: number;
|
|
528
|
+
Sinhala: number;
|
|
529
|
+
Marathi: number;
|
|
530
|
+
Nepali: number;
|
|
531
|
+
Punjabi: number;
|
|
532
|
+
Assamese: number;
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
declare type lang_list_type = keyof typeof lang_list;
|
|
536
|
+
|
|
537
|
+
/** Type of the language list */
|
|
538
|
+
export declare type LangListType = lang_list_type;
|
|
539
|
+
|
|
540
|
+
declare type OutputBrahmicScriptData = Pick<InputBrahmicScriptType, 'script_name' | 'script_id' | 'halant' | 'nuqta' | 'schwa_property' | 'script_type'> & Omit<CommonScriptData, 'list'> & {
|
|
541
|
+
list: (Pick<CommonScriptData['list'][number], 'krama_ref'> & ({
|
|
542
|
+
type: Exclude<InputBrahmicScriptType['list'][number]['type'] | 'mAtrA', 'svara'>;
|
|
543
|
+
} | {
|
|
544
|
+
type: 'svara';
|
|
545
|
+
mAtrA_krama_ref?: number[] | null;
|
|
546
|
+
}))[];
|
|
547
|
+
};
|
|
548
|
+
|
|
549
|
+
declare type OutputOtherScriptData = Pick<InputOtherScriptType, 'script_name' | 'script_id' | 'script_type' | 'schwa_character'> & CommonScriptData;
|
|
550
|
+
|
|
551
|
+
declare type OutputScriptData = OutputBrahmicScriptData | OutputOtherScriptData;
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Preloads the script data. Useful for browsers as avoids the fetch latency
|
|
555
|
+
* @param name - The name of the script/language to preload
|
|
556
|
+
* @returns The script data
|
|
557
|
+
* @public
|
|
558
|
+
*/
|
|
559
|
+
export declare const preloadScriptData: (name: script_input_name_type) => Promise<OutputScriptData>;
|
|
560
|
+
|
|
561
|
+
declare type script_and_lang_list_type = script_list_type | lang_list_type;
|
|
562
|
+
|
|
563
|
+
declare type script_input_name_type = acronym_type | script_and_lang_list_type;
|
|
564
|
+
|
|
565
|
+
export declare const SCRIPT_LIST: script_list_type[];
|
|
566
|
+
|
|
567
|
+
declare const script_list: {
|
|
568
|
+
Devanagari: number;
|
|
569
|
+
Telugu: number;
|
|
570
|
+
Tamil: number;
|
|
571
|
+
"Tamil-Extended": number;
|
|
572
|
+
Bengali: number;
|
|
573
|
+
Kannada: number;
|
|
574
|
+
Gujarati: number;
|
|
575
|
+
Malayalam: number;
|
|
576
|
+
Odia: number;
|
|
577
|
+
Sinhala: number;
|
|
578
|
+
Normal: number;
|
|
579
|
+
Romanized: number;
|
|
580
|
+
Gurumukhi: number;
|
|
581
|
+
Assamese: number;
|
|
582
|
+
"Purna-Devanagari": number;
|
|
583
|
+
Brahmi: number;
|
|
584
|
+
Granth: number;
|
|
585
|
+
Modi: number;
|
|
586
|
+
Sharada: number;
|
|
587
|
+
Siddham: number;
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
declare type script_list_type = keyof typeof script_list;
|
|
591
|
+
|
|
592
|
+
/** Type of the script and language list */
|
|
593
|
+
export declare type ScriptAndLangListType = script_and_lang_list_type;
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Supported script/language identifier types
|
|
597
|
+
*/
|
|
598
|
+
export declare type ScriptLangType = script_input_name_type;
|
|
599
|
+
|
|
600
|
+
/** Type of the script list */
|
|
601
|
+
export declare type ScriptListType = script_list_type;
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Transliterates `text` from `from` to `to`.
|
|
605
|
+
* @param text - The text to transliterate
|
|
606
|
+
* @param from - The script/language to transliterate from
|
|
607
|
+
* @param to - The script/language to transliterate to
|
|
608
|
+
* @param options - The custom options to use for the transliteration
|
|
609
|
+
* @returns The transliterated text
|
|
610
|
+
*/
|
|
611
|
+
export declare function transliterate(text: string, from: ScriptLangType, to: ScriptLangType, options?: CustomOptionType): Promise<string>;
|
|
612
|
+
|
|
613
|
+
export declare type TransliterationOptions = CustomOptionType;
|
|
614
|
+
|
|
615
|
+
export { }
|