@polyglot-bundles/ar-lang 1.1.1

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.
@@ -0,0 +1,43 @@
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 {};
@@ -0,0 +1,74 @@
1
+ function c(a) {
2
+ return a.charType === "vowel";
3
+ }
4
+ function e(a) {
5
+ return a.charType === "consonant";
6
+ }
7
+ const i = [
8
+ // Short vowels (Harakat)
9
+ { char: "َ", id: "fatha", charType: "vowel", ipa: "a", name: "Fatha", length: "short" },
10
+ { char: "ِ", id: "kasra", charType: "vowel", ipa: "i", name: "Kasra", length: "short" },
11
+ { char: "ُ", id: "damma", charType: "vowel", ipa: "u", name: "Damma", length: "short" },
12
+ // Long vowels (with alif, ya, waw)
13
+ { char: "ا", id: "alif", charType: "vowel", ipa: "aː", name: "Alif", length: "long" },
14
+ { char: "ي", id: "ya", charType: "vowel", ipa: "iː", name: "Ya", length: "long" },
15
+ { char: "و", id: "waw", charType: "vowel", ipa: "uː", name: "Waw", length: "long" },
16
+ // Dual vowels
17
+ { char: "ً", id: "fathatan", charType: "vowel", ipa: "an", name: "Fathatan", length: "short" },
18
+ { char: "ٍ", id: "kasratan", charType: "vowel", ipa: "in", name: "Kasratan", length: "short" },
19
+ { char: "ٌ", id: "dammatan", charType: "vowel", ipa: "un", name: "Dammatan", length: "short" },
20
+ // Tanwin
21
+ { char: "ْ", id: "sukun", charType: "vowel", ipa: "", name: "Sukun", length: "short" }
22
+ ], n = [
23
+ // Labial consonants
24
+ { char: "ب", id: "ba", charType: "consonant", ipa: "b", name: "Ba", voicing: "voiced", articulation: "stop", place: "labial" },
25
+ { char: "ف", id: "fa", charType: "consonant", ipa: "f", name: "Fa", voicing: "voiceless", articulation: "fricative", place: "labial" },
26
+ { char: "م", id: "me", charType: "consonant", ipa: "m", name: "Me", voicing: "nasal", articulation: "nasal", place: "labial" },
27
+ { char: "و", id: "waw_consonant", charType: "consonant", ipa: "w", name: "Waw (consonant)", voicing: "voiced", articulation: "approximant", place: "labial" },
28
+ // Dental consonants
29
+ { char: "ت", id: "ta", charType: "consonant", ipa: "t", name: "Ta", voicing: "voiceless", articulation: "stop", place: "dental" },
30
+ { char: "ث", id: "tha", charType: "consonant", ipa: "θ", name: "Tha", voicing: "voiceless", articulation: "fricative", place: "dental" },
31
+ { char: "د", id: "dal", charType: "consonant", ipa: "d", name: "Dal", voicing: "voiced", articulation: "stop", place: "dental" },
32
+ { char: "ذ", id: "dhal", charType: "consonant", ipa: "ð", name: "Dhal", voicing: "voiced", articulation: "fricative", place: "dental" },
33
+ { char: "ر", id: "ra", charType: "consonant", ipa: "r", name: "Ra", voicing: "trill", articulation: "trill", place: "alveolar" },
34
+ { char: "ز", id: "za", charType: "consonant", ipa: "z", name: "Za", voicing: "voiced", articulation: "fricative", place: "alveolar" },
35
+ { char: "س", id: "sin", charType: "consonant", ipa: "s", name: "Sin", voicing: "voiceless", articulation: "fricative", place: "alveolar" },
36
+ { char: "ش", id: "shin", charType: "consonant", ipa: "ʃ", name: "Shin", voicing: "voiceless", articulation: "fricative", place: "palatal" },
37
+ { char: "ن", id: "nun", charType: "consonant", ipa: "n", name: "Nun", voicing: "nasal", articulation: "nasal", place: "alveolar" },
38
+ { char: "ل", id: "lam", charType: "consonant", ipa: "l", name: "Lam", voicing: "lateral", articulation: "lateral", place: "alveolar" },
39
+ // Palatal consonants
40
+ { char: "ي", id: "ya_consonant", charType: "consonant", ipa: "j", name: "Ya (consonant)", voicing: "voiced", articulation: "approximant", place: "palatal" },
41
+ // Emphatic consonants
42
+ { char: "ص", id: "sad", charType: "consonant", ipa: "sˤ", name: "Sad", voicing: "voiceless", articulation: "fricative", place: "emphatic" },
43
+ { char: "ض", id: "dad", charType: "consonant", ipa: "dˤ", name: "Dad", voicing: "voiced", articulation: "stop", place: "emphatic" },
44
+ { char: "ط", id: "ta", charType: "consonant", ipa: "tˤ", name: "Ta", voicing: "voiceless", articulation: "stop", place: "emphatic" },
45
+ { char: "ظ", id: "zha", charType: "consonant", ipa: "ðˤ", name: "Zha", voicing: "voiced", articulation: "fricative", place: "emphatic" },
46
+ // Velar consonants
47
+ { char: "ق", id: "qaf", charType: "consonant", ipa: "q", name: "Qaf", voicing: "voiceless", articulation: "stop", place: "velar" },
48
+ { char: "ك", id: "kaf", charType: "consonant", ipa: "k", name: "Kaf", voicing: "voiceless", articulation: "stop", place: "velar" },
49
+ { char: "غ", id: "ghain", charType: "consonant", ipa: "ɣ", name: "Ghain", voicing: "voiced", articulation: "fricative", place: "velar" },
50
+ // Uvular consonants
51
+ { char: "خ", id: "kha", charType: "consonant", ipa: "x", name: "Kha", voicing: "voiceless", articulation: "fricative", place: "velar" },
52
+ { char: "ه", id: "ha", charType: "consonant", ipa: "h", name: "Ha", voicing: "voiceless", articulation: "fricative", place: "glottal" },
53
+ // Glottal consonants
54
+ { char: "ء", id: "hamza", charType: "consonant", ipa: "ʔ", name: "Hamza", voicing: "voiceless", articulation: "stop", place: "glottal" },
55
+ { char: "ء", id: "hamza_on_alif", charType: "consonant", ipa: "ʔ", name: "Hamza (on alif)", voicing: "voiceless", articulation: "stop", place: "glottal" },
56
+ // Other consonants
57
+ { char: "ح", id: "ha", charType: "consonant", ipa: "ħ", name: "Ha (pharyngeal)", voicing: "voiceless", articulation: "fricative", place: "pharyngeal" },
58
+ { char: "ع", id: "ain", charType: "consonant", ipa: "ʕ", name: "Ain (pharyngeal)", voicing: "voiced", articulation: "fricative", place: "pharyngeal" },
59
+ { char: "ة", id: "ta_marbuta", charType: "consonant", ipa: "t", name: "Ta Marbuta", voicing: "voiceless", articulation: "stop", place: "dental" },
60
+ { char: "أ", id: "alif_hamza", charType: "consonant", ipa: "ʔa", name: "Alif Hamza", voicing: "voiceless", articulation: "stop", place: "glottal" },
61
+ { char: "إ", id: "alif_hamza_below", charType: "consonant", ipa: "ʔi", name: "Alif Hamza Below", voicing: "voiceless", articulation: "stop", place: "glottal" },
62
+ { char: "ؤ", id: "waw_hamza", charType: "consonant", ipa: "ʔu", name: "Waw Hamza", voicing: "voiceless", articulation: "stop", place: "glottal" },
63
+ { char: "ى", id: "alif_madda", charType: "consonant", ipa: "aː", name: "Alif Madda", voicing: "voiced", articulation: "approximant", place: "glottal" }
64
+ ], o = [
65
+ ...i,
66
+ ...n
67
+ ];
68
+ export {
69
+ o as arabicAllCharacters,
70
+ n as arabicConsonants,
71
+ i as arabicVowels,
72
+ e as isConsonant,
73
+ c as isVowel
74
+ };
@@ -0,0 +1 @@
1
+ export { arabicVowels, arabicConsonants, arabicAllCharacters, type ArabicVowelsInfo, type ArabicConsonantsInfo, type ArabicCharacter, isVowel, isConsonant, } from './characters.js';
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ import { arabicAllCharacters as r, arabicConsonants as s, arabicVowels as n, isConsonant as i, isVowel as c } from "./characters.js";
2
+ export {
3
+ r as arabicAllCharacters,
4
+ s as arabicConsonants,
5
+ n as arabicVowels,
6
+ i as isConsonant,
7
+ c as isVowel
8
+ };
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@polyglot-bundles/ar-lang",
3
+ "version": "1.1.1",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "vite build",
9
+ "clean": "rm -rf dist"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "types": "./dist/index.d.ts"
15
+ }
16
+ },
17
+ "files": ["dist"],
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "dependencies": {
22
+ "@polyglot-bundles/content-shared": "workspace:*"
23
+ },
24
+ "devDependencies": {
25
+ "@polyglot-bundles/lang-tooling": "workspace:*",
26
+ "vite": "catalog:",
27
+ "vite-plugin-dts": "catalog:"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "https://github.com/fustilio/polyglot-bundles",
32
+ "directory": "packages/ar/lang"
33
+ }
34
+ }