@polyglot-bundles/ar-lang 0.3.0 → 0.4.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/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # @polyglot-bundles/ar-lang
2
+
3
+ ## Installation
4
+
5
+ ```sh
6
+ npm install @polyglot-bundles/ar-lang
7
+ ```
8
+
9
+ ## Usage
10
+
11
+ ```ts
12
+ import * as characters from "@polyglot-bundles/ar-lang/characters";
13
+ ```
14
+
15
+ ## Available exports
16
+
17
+ | Export | Contents |
18
+ |--------|---------|
19
+ | `.` | Re-exports everything |
20
+ | `./characters` | Character inventory (arrays / keyed objects with `char` field) |
21
+
22
+ ## Data
23
+
24
+ ~34 consonants, 11 vowels
25
+
26
+ ## License
27
+
28
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polyglot-bundles/ar-lang",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -8,6 +8,10 @@
8
8
  ".": {
9
9
  "import": "./dist/index.js",
10
10
  "types": "./dist/index.d.ts"
11
+ },
12
+ "./characters": {
13
+ "types": "./dist/characters.d.ts",
14
+ "import": "./dist/characters.js"
11
15
  }
12
16
  },
13
17
  "files": [
@@ -18,8 +22,9 @@
18
22
  },
19
23
  "devDependencies": {
20
24
  "vite-plugin-dts": "^4.5.4",
25
+ "vitest": "^4.1.4",
21
26
  "@polyglot-bundles/lang-tooling": "0.0.0",
22
- "@polyglot-bundles/content-shared": "0.5.4"
27
+ "@polyglot-bundles/content-shared": "0.6.0"
23
28
  },
24
29
  "repository": {
25
30
  "type": "git",
@@ -27,6 +32,8 @@
27
32
  "directory": "packages/ar/lang"
28
33
  },
29
34
  "scripts": {
30
- "build": "vite build"
35
+ "build": "vite build",
36
+ "test": "vitest run",
37
+ "typecheck": "tsc --noEmit"
31
38
  }
32
39
  }
@@ -1,44 +0,0 @@
1
- /**
2
- * Arabic Character Types
3
- *
4
- * Type definitions for Arabic characters (Arabic script).
5
- * Arabic has 28 letters: 3 vowels (diacritics), 25 consonants.
6
- */
7
- /**
8
- * Base character info
9
- */
10
- type ArabicCharacterBaseInfo = {
11
- char: string;
12
- id: string;
13
- display?: string;
14
- audio?: string;
15
- notes?: string;
16
- };
17
- /**
18
- * Arabic Vowels (Harakat)
19
- */
20
- export type ArabicVowelsInfo = {
21
- charType: "vowel";
22
- ipa: string;
23
- name: string;
24
- length?: "short" | "long";
25
- } & ArabicCharacterBaseInfo;
26
- /**
27
- * Arabic Consonants
28
- */
29
- export type ArabicConsonantsInfo = {
30
- charType: "consonant";
31
- ipa: string;
32
- name: string;
33
- articulation: "stop" | "fricative" | "nasal" | "approximant" | "lateral" | "trill" | "affricate";
34
- voicing: "voiced" | "voiceless" | "nasal" | "lateral" | "approximant" | "trill" | "fricative" | "affricate";
35
- place: "velar" | "palatal" | "pharyngeal" | "emphatic" | "dental" | "labial" | "glottal" | "uvular" | "alveolar";
36
- } & ArabicCharacterBaseInfo;
37
- export type ArabicCharacter = ArabicVowelsInfo | ArabicConsonantsInfo;
38
- export declare function isVowel(character: ArabicCharacter): character is ArabicVowelsInfo;
39
- export declare function isConsonant(character: ArabicCharacter): character is ArabicConsonantsInfo;
40
- export declare const arabicVowels: ArabicVowelsInfo[];
41
- export declare const arabicConsonants: ArabicConsonantsInfo[];
42
- export declare const arabicAllCharacters: (ArabicVowelsInfo | ArabicConsonantsInfo)[];
43
- export {};
44
- //# sourceMappingURL=characters.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"characters.d.ts","sourceRoot":"","sources":["../src/characters.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,KAAK,uBAAuB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;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"vowel";
4
- }
5
- function t(e) {
6
- return e.charType === "consonant";
7
- }
8
- var n = [
9
- {
10
- char: "َ",
11
- id: "fatha",
12
- charType: "vowel",
13
- ipa: "a",
14
- name: "Fatha",
15
- length: "short"
16
- },
17
- {
18
- char: "ِ",
19
- id: "kasra",
20
- charType: "vowel",
21
- ipa: "i",
22
- name: "Kasra",
23
- length: "short"
24
- },
25
- {
26
- char: "ُ",
27
- id: "damma",
28
- charType: "vowel",
29
- ipa: "u",
30
- name: "Damma",
31
- length: "short"
32
- },
33
- {
34
- char: "ا",
35
- id: "alif",
36
- charType: "vowel",
37
- ipa: "aː",
38
- name: "Alif",
39
- length: "long"
40
- },
41
- {
42
- char: "ي",
43
- id: "ya",
44
- charType: "vowel",
45
- ipa: "iː",
46
- name: "Ya",
47
- length: "long"
48
- },
49
- {
50
- char: "و",
51
- id: "waw",
52
- charType: "vowel",
53
- ipa: "uː",
54
- name: "Waw",
55
- length: "long"
56
- },
57
- {
58
- char: "ً",
59
- id: "fathatan",
60
- charType: "vowel",
61
- ipa: "an",
62
- name: "Fathatan",
63
- length: "short"
64
- },
65
- {
66
- char: "ٍ",
67
- id: "kasratan",
68
- charType: "vowel",
69
- ipa: "in",
70
- name: "Kasratan",
71
- length: "short"
72
- },
73
- {
74
- char: "ٌ",
75
- id: "dammatan",
76
- charType: "vowel",
77
- ipa: "un",
78
- name: "Dammatan",
79
- length: "short"
80
- },
81
- {
82
- char: "ْ",
83
- id: "sukun",
84
- charType: "vowel",
85
- ipa: "",
86
- name: "Sukun",
87
- length: "short"
88
- }
89
- ], r = [
90
- {
91
- char: "ب",
92
- id: "ba",
93
- charType: "consonant",
94
- ipa: "b",
95
- name: "Ba",
96
- voicing: "voiced",
97
- articulation: "stop",
98
- place: "labial"
99
- },
100
- {
101
- char: "ف",
102
- id: "fa",
103
- charType: "consonant",
104
- ipa: "f",
105
- name: "Fa",
106
- voicing: "voiceless",
107
- articulation: "fricative",
108
- place: "labial"
109
- },
110
- {
111
- char: "م",
112
- id: "me",
113
- charType: "consonant",
114
- ipa: "m",
115
- name: "Me",
116
- voicing: "nasal",
117
- articulation: "nasal",
118
- place: "labial"
119
- },
120
- {
121
- char: "و",
122
- id: "waw_consonant",
123
- charType: "consonant",
124
- ipa: "w",
125
- name: "Waw (consonant)",
126
- voicing: "voiced",
127
- articulation: "approximant",
128
- place: "labial"
129
- },
130
- {
131
- char: "ت",
132
- id: "ta",
133
- charType: "consonant",
134
- ipa: "t",
135
- name: "Ta",
136
- voicing: "voiceless",
137
- articulation: "stop",
138
- place: "dental"
139
- },
140
- {
141
- char: "ث",
142
- id: "tha",
143
- charType: "consonant",
144
- ipa: "θ",
145
- name: "Tha",
146
- voicing: "voiceless",
147
- articulation: "fricative",
148
- place: "dental"
149
- },
150
- {
151
- char: "د",
152
- id: "dal",
153
- charType: "consonant",
154
- ipa: "d",
155
- name: "Dal",
156
- voicing: "voiced",
157
- articulation: "stop",
158
- place: "dental"
159
- },
160
- {
161
- char: "ذ",
162
- id: "dhal",
163
- charType: "consonant",
164
- ipa: "ð",
165
- name: "Dhal",
166
- voicing: "voiced",
167
- articulation: "fricative",
168
- place: "dental"
169
- },
170
- {
171
- char: "ر",
172
- id: "ra",
173
- charType: "consonant",
174
- ipa: "r",
175
- name: "Ra",
176
- voicing: "trill",
177
- articulation: "trill",
178
- place: "alveolar"
179
- },
180
- {
181
- char: "ز",
182
- id: "za",
183
- charType: "consonant",
184
- ipa: "z",
185
- name: "Za",
186
- voicing: "voiced",
187
- articulation: "fricative",
188
- place: "alveolar"
189
- },
190
- {
191
- char: "س",
192
- id: "sin",
193
- charType: "consonant",
194
- ipa: "s",
195
- name: "Sin",
196
- voicing: "voiceless",
197
- articulation: "fricative",
198
- place: "alveolar"
199
- },
200
- {
201
- char: "ش",
202
- id: "shin",
203
- charType: "consonant",
204
- ipa: "ʃ",
205
- name: "Shin",
206
- voicing: "voiceless",
207
- articulation: "fricative",
208
- place: "palatal"
209
- },
210
- {
211
- char: "ن",
212
- id: "nun",
213
- charType: "consonant",
214
- ipa: "n",
215
- name: "Nun",
216
- voicing: "nasal",
217
- articulation: "nasal",
218
- place: "alveolar"
219
- },
220
- {
221
- char: "ل",
222
- id: "lam",
223
- charType: "consonant",
224
- ipa: "l",
225
- name: "Lam",
226
- voicing: "lateral",
227
- articulation: "lateral",
228
- place: "alveolar"
229
- },
230
- {
231
- char: "ي",
232
- id: "ya_consonant",
233
- charType: "consonant",
234
- ipa: "j",
235
- name: "Ya (consonant)",
236
- voicing: "voiced",
237
- articulation: "approximant",
238
- place: "palatal"
239
- },
240
- {
241
- char: "ص",
242
- id: "sad",
243
- charType: "consonant",
244
- ipa: "sˤ",
245
- name: "Sad",
246
- voicing: "voiceless",
247
- articulation: "fricative",
248
- place: "emphatic"
249
- },
250
- {
251
- char: "ض",
252
- id: "dad",
253
- charType: "consonant",
254
- ipa: "dˤ",
255
- name: "Dad",
256
- voicing: "voiced",
257
- articulation: "stop",
258
- place: "emphatic"
259
- },
260
- {
261
- char: "ط",
262
- id: "ta",
263
- charType: "consonant",
264
- ipa: "tˤ",
265
- name: "Ta",
266
- voicing: "voiceless",
267
- articulation: "stop",
268
- place: "emphatic"
269
- },
270
- {
271
- char: "ظ",
272
- id: "zha",
273
- charType: "consonant",
274
- ipa: "ðˤ",
275
- name: "Zha",
276
- voicing: "voiced",
277
- articulation: "fricative",
278
- place: "emphatic"
279
- },
280
- {
281
- char: "ق",
282
- id: "qaf",
283
- charType: "consonant",
284
- ipa: "q",
285
- name: "Qaf",
286
- voicing: "voiceless",
287
- articulation: "stop",
288
- place: "velar"
289
- },
290
- {
291
- char: "ك",
292
- id: "kaf",
293
- charType: "consonant",
294
- ipa: "k",
295
- name: "Kaf",
296
- voicing: "voiceless",
297
- articulation: "stop",
298
- place: "velar"
299
- },
300
- {
301
- char: "غ",
302
- id: "ghain",
303
- charType: "consonant",
304
- ipa: "ɣ",
305
- name: "Ghain",
306
- voicing: "voiced",
307
- articulation: "fricative",
308
- place: "velar"
309
- },
310
- {
311
- char: "خ",
312
- id: "kha",
313
- charType: "consonant",
314
- ipa: "x",
315
- name: "Kha",
316
- voicing: "voiceless",
317
- articulation: "fricative",
318
- place: "velar"
319
- },
320
- {
321
- char: "ه",
322
- id: "ha",
323
- charType: "consonant",
324
- ipa: "h",
325
- name: "Ha",
326
- voicing: "voiceless",
327
- articulation: "fricative",
328
- place: "glottal"
329
- },
330
- {
331
- char: "ء",
332
- id: "hamza",
333
- charType: "consonant",
334
- ipa: "ʔ",
335
- name: "Hamza",
336
- voicing: "voiceless",
337
- articulation: "stop",
338
- place: "glottal"
339
- },
340
- {
341
- char: "ء",
342
- id: "hamza_on_alif",
343
- charType: "consonant",
344
- ipa: "ʔ",
345
- name: "Hamza (on alif)",
346
- voicing: "voiceless",
347
- articulation: "stop",
348
- place: "glottal"
349
- },
350
- {
351
- char: "ح",
352
- id: "ha",
353
- charType: "consonant",
354
- ipa: "ħ",
355
- name: "Ha (pharyngeal)",
356
- voicing: "voiceless",
357
- articulation: "fricative",
358
- place: "pharyngeal"
359
- },
360
- {
361
- char: "ع",
362
- id: "ain",
363
- charType: "consonant",
364
- ipa: "ʕ",
365
- name: "Ain (pharyngeal)",
366
- voicing: "voiced",
367
- articulation: "fricative",
368
- place: "pharyngeal"
369
- },
370
- {
371
- char: "ة",
372
- id: "ta_marbuta",
373
- charType: "consonant",
374
- ipa: "t",
375
- name: "Ta Marbuta",
376
- voicing: "voiceless",
377
- articulation: "stop",
378
- place: "dental"
379
- },
380
- {
381
- char: "أ",
382
- id: "alif_hamza",
383
- charType: "consonant",
384
- ipa: "ʔa",
385
- name: "Alif Hamza",
386
- voicing: "voiceless",
387
- articulation: "stop",
388
- place: "glottal"
389
- },
390
- {
391
- char: "إ",
392
- id: "alif_hamza_below",
393
- charType: "consonant",
394
- ipa: "ʔi",
395
- name: "Alif Hamza Below",
396
- voicing: "voiceless",
397
- articulation: "stop",
398
- place: "glottal"
399
- },
400
- {
401
- char: "ؤ",
402
- id: "waw_hamza",
403
- charType: "consonant",
404
- ipa: "ʔu",
405
- name: "Waw Hamza",
406
- voicing: "voiceless",
407
- articulation: "stop",
408
- place: "glottal"
409
- },
410
- {
411
- char: "ى",
412
- id: "alif_madda",
413
- charType: "consonant",
414
- ipa: "aː",
415
- name: "Alif Madda",
416
- voicing: "voiced",
417
- articulation: "approximant",
418
- place: "glottal"
419
- }
420
- ], i = [...n, ...r];
421
- //#endregion
422
- export { i as arabicAllCharacters, r as arabicConsonants, n as arabicVowels, t as isConsonant, e as isVowel };
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { arabicVowels, arabicConsonants, arabicAllCharacters, type ArabicVowelsInfo, type ArabicConsonantsInfo, type ArabicCharacter, isVowel, isConsonant, } from './characters.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,OAAO,EACP,WAAW,GACZ,MAAM,iBAAiB,CAAC"}
package/dist/index.js DELETED
@@ -1,2 +0,0 @@
1
- import { arabicAllCharacters as e, arabicConsonants as t, arabicVowels as n, isConsonant as r, isVowel as i } from "./characters.js";
2
- export { e as arabicAllCharacters, t as arabicConsonants, n as arabicVowels, r as isConsonant, i as isVowel };