1// WARNING: this file was generated by ../scripts/gen-arabic-table.py
2
3use super::arabic::JoiningType::{self, GroupAlaph as A, GroupDalathRish as DR, D, L, R, T, U, X};
4
5#[rustfmt::skip]
6pub const JOINING_TABLE: &[JoiningType] = &[
7
8 /* Arabic */
9
10 /* 0600 */ U,U,U,U,U,U,X,X,U,X,X,U,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
11 /* 0620 */ D,U,R,R,R,R,D,R,D,R,D,D,D,D,D,R,R,R,R,D,D,D,D,D,D,D,D,D,D,D,D,D,
12 /* 0640 */ D,D,D,D,D,D,D,D,R,D,D,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
13 /* 0660 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,D,D,X,R,R,R,U,R,R,R,D,D,D,D,D,D,D,D,
14 /* 0680 */ D,D,D,D,D,D,D,D,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,D,D,D,D,D,D,
15 /* 06A0 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
16 /* 06C0 */ R,D,D,R,R,R,R,R,R,R,R,R,D,R,D,R,D,D,R,R,X,R,X,X,X,X,X,X,X,U,X,X,
17 /* 06E0 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,R,R,X,X,X,X,X,X,X,X,X,X,D,D,D,X,X,D,
18
19 /* Syriac */
20
21 /* 0700 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,T,A,X,D,D,D,DR,DR,R,R,R,D,D,D,D,R,D,
22 /* 0720 */ D,D,D,D,D,D,D,D,R,D,DR,D,R,D,D,DR,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
23 /* 0740 */ X,X,X,X,X,X,X,X,X,X,X,X,X,R,D,D,
24
25 /* Arabic Supplement */
26
27 /* 0740 */ D,D,D,D,D,D,D,D,D,R,R,R,D,D,D,D,
28 /* 0760 */ D,D,D,D,D,D,D,D,D,D,D,R,R,D,D,D,D,R,D,R,R,D,D,D,R,R,D,D,D,D,D,D,
29
30 /* FILLER */
31
32 /* 0780 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
33 /* 07A0 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
34
35 /* NKo */
36
37 /* 07C0 */ X,X,X,X,X,X,X,X,X,X,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
38 /* 07E0 */ D,D,D,D,D,D,D,D,D,D,D,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,D,X,X,X,X,X,
39
40 /* FILLER */
41
42 /* 0800 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
43 /* 0820 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
44
45 /* Mandaic */
46
47 /* 0840 */ R,D,D,D,D,D,R,R,D,R,D,D,D,D,D,D,D,D,D,D,R,D,R,R,R,X,X,X,X,X,X,X,
48
49 /* Syriac Supplement */
50
51 /* 0860 */ D,U,D,D,D,D,U,R,D,R,R,X,X,X,X,X,
52
53 /* Arabic Extended-B */
54
55 /* 0860 */ R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,
56 /* 0880 */ R,R,R,D,D,D,D,U,U,D,D,D,D,D,R,X,U,U,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
57
58 /* Arabic Extended-A */
59
60 /* 08A0 */ D,D,D,D,D,D,D,D,D,D,R,R,R,U,R,D,D,R,R,D,D,D,D,D,D,R,D,D,D,D,D,D,
61 /* 08C0 */ D,D,D,D,D,D,D,D,D,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
62 /* 08E0 */ X,X,U,
63
64 /* Mongolian */
65
66 /* 1800 */ U,D,X,X,D,X,X,X,U,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
67 /* 1820 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
68 /* 1840 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
69 /* 1860 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,X,X,X,X,X,X,X,
70 /* 1880 */ U,U,U,U,U,T,T,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
71 /* 18A0 */ D,D,D,D,D,D,D,D,D,X,D,
72
73 /* General Punctuation */
74
75 /* 2000 */ U,D,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
76 /* 2020 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,U,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
77 /* 2040 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
78 /* 2060 */ X,X,X,X,X,X,U,U,U,U,
79
80 /* Phags-pa */
81
82 /* A840 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
83 /* A860 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,L,U,
84
85 /* Manichaean */
86
87 /* 10AC0 */ D,D,D,D,D,R,U,R,U,R,R,U,U,L,R,R,R,R,R,D,D,D,D,L,D,D,D,D,D,R,D,D,
88 /* 10AE0 */ D,R,U,U,R,X,X,X,X,X,X,D,D,D,D,R,
89
90 /* Psalter Pahlavi */
91
92 /* 10B80 */ D,R,D,R,R,R,D,D,D,R,D,D,R,D,R,R,D,R,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
93 /* 10BA0 */ X,X,X,X,X,X,X,X,X,R,R,R,R,D,D,U,
94
95 /* Hanifi Rohingya */
96
97 /* 10D00 */ L,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
98 /* 10D20 */ D,D,R,D,
99
100 /* Sogdian */
101
102 /* 10F20 */ D,D,D,R,D,D,D,D,D,D,D,D,D,D,D,D,
103 /* 10F40 */ D,D,D,D,D,U,X,X,X,X,X,X,X,X,X,X,X,D,D,D,R,X,X,X,X,X,X,X,X,X,X,X,
104 /* 10F60 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
105
106 /* Old Uyghur */
107
108 /* 10F60 */ D,D,D,D,R,R,D,D,D,D,D,D,D,D,D,D,
109 /* 10F80 */ D,D,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
110 /* 10FA0 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
111
112 /* Chorasmian */
113
114 /* 10FA0 */ D,U,D,D,R,R,R,U,D,R,R,D,D,R,D,D,
115 /* 10FC0 */ U,D,R,R,D,U,U,U,U,R,D,L,
116
117 /* Kaithi */
118
119 /* 110A0 */ U,X,X,
120 /* 110C0 */ X,X,X,X,X,X,X,X,X,X,X,X,X,U,
121
122 /* Adlam */
123
124 /* 1E900 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
125 /* 1E920 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
126 /* 1E940 */ D,D,D,D,X,X,X,X,X,X,X,T,
127];
128
129const JOINING_OFFSET_0X0600: usize = 0;
130const JOINING_OFFSET_0X1806: usize = 739;
131const JOINING_OFFSET_0X200C: usize = 904;
132const JOINING_OFFSET_0XA840: usize = 998;
133const JOINING_OFFSET_0X10AC0: usize = 1050;
134const JOINING_OFFSET_0X10B80: usize = 1098;
135const JOINING_OFFSET_0X10D00: usize = 1146;
136const JOINING_OFFSET_0X10F30: usize = 1182;
137const JOINING_OFFSET_0X110BD: usize = 1338;
138const JOINING_OFFSET_0X1E900: usize = 1355;
139
140pub fn joining_type(u: char) -> JoiningType {
141 let u = u as u32;
142 match u >> 12 {
143 0x0 => {
144 if (0x0600..=0x08E2).contains(&u) {
145 return JOINING_TABLE[u as usize - 0x0600 + JOINING_OFFSET_0X0600];
146 }
147 }
148 0x1 => {
149 if (0x1806..=0x18AA).contains(&u) {
150 return JOINING_TABLE[u as usize - 0x1806 + JOINING_OFFSET_0X1806];
151 }
152 }
153 0x2 => {
154 if (0x200C..=0x2069).contains(&u) {
155 return JOINING_TABLE[u as usize - 0x200C + JOINING_OFFSET_0X200C];
156 }
157 }
158 0xA => {
159 if (0xA840..=0xA873).contains(&u) {
160 return JOINING_TABLE[u as usize - 0xA840 + JOINING_OFFSET_0XA840];
161 }
162 }
163 0x10 => {
164 if (0x10AC0..=0x10AEF).contains(&u) {
165 return JOINING_TABLE[u as usize - 0x10AC0 + JOINING_OFFSET_0X10AC0];
166 }
167 if (0x10B80..=0x10BAF).contains(&u) {
168 return JOINING_TABLE[u as usize - 0x10B80 + JOINING_OFFSET_0X10B80];
169 }
170 if (0x10D00..=0x10D23).contains(&u) {
171 return JOINING_TABLE[u as usize - 0x10D00 + JOINING_OFFSET_0X10D00];
172 }
173 if (0x10F30..=0x10FCB).contains(&u) {
174 return JOINING_TABLE[u as usize - 0x10F30 + JOINING_OFFSET_0X10F30];
175 }
176 }
177 0x11 => {
178 if (0x110BD..=0x110CD).contains(&u) {
179 return JOINING_TABLE[u as usize - 0x110BD + JOINING_OFFSET_0X110BD];
180 }
181 }
182 0x1E => {
183 if (0x1E900..=0x1E94B).contains(&u) {
184 return JOINING_TABLE[u as usize - 0x1E900 + JOINING_OFFSET_0X1E900];
185 }
186 }
187 _ => {}
188 }
189
190 X
191}
192