1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
/// A number of constants to give a name to all characters in this block.
mod constants {
    /// \u{750}: 'ݐ'
    pub const ARABIC_LETTER_BEH_WITH_THREE_DOTS_HORIZONTALLY_BELOW: char = 'ݐ';
    /// \u{751}: 'ݑ'
    pub const ARABIC_LETTER_BEH_WITH_DOT_BELOW_AND_THREE_DOTS_ABOVE: char = 'ݑ';
    /// \u{752}: 'ݒ'
    pub const ARABIC_LETTER_BEH_WITH_THREE_DOTS_POINTING_UPWARDS_BELOW: char = 'ݒ';
    /// \u{753}: 'ݓ'
    pub const ARABIC_LETTER_BEH_WITH_THREE_DOTS_POINTING_UPWARDS_BELOW_AND_TWO_DOTS_ABOVE: char = 'ݓ';
    /// \u{754}: 'ݔ'
    pub const ARABIC_LETTER_BEH_WITH_TWO_DOTS_BELOW_AND_DOT_ABOVE: char = 'ݔ';
    /// \u{755}: 'ݕ'
    pub const ARABIC_LETTER_BEH_WITH_INVERTED_SMALL_V_BELOW: char = 'ݕ';
    /// \u{756}: 'ݖ'
    pub const ARABIC_LETTER_BEH_WITH_SMALL_V: char = 'ݖ';
    /// \u{757}: 'ݗ'
    pub const ARABIC_LETTER_HAH_WITH_TWO_DOTS_ABOVE: char = 'ݗ';
    /// \u{758}: 'ݘ'
    pub const ARABIC_LETTER_HAH_WITH_THREE_DOTS_POINTING_UPWARDS_BELOW: char = 'ݘ';
    /// \u{759}: 'ݙ'
    pub const ARABIC_LETTER_DAL_WITH_TWO_DOTS_VERTICALLY_BELOW_AND_SMALL_TAH: char = 'ݙ';
    /// \u{75a}: 'ݚ'
    pub const ARABIC_LETTER_DAL_WITH_INVERTED_SMALL_V_BELOW: char = 'ݚ';
    /// \u{75b}: 'ݛ'
    pub const ARABIC_LETTER_REH_WITH_STROKE: char = 'ݛ';
    /// \u{75c}: 'ݜ'
    pub const ARABIC_LETTER_SEEN_WITH_FOUR_DOTS_ABOVE: char = 'ݜ';
    /// \u{75d}: 'ݝ'
    pub const ARABIC_LETTER_AIN_WITH_TWO_DOTS_ABOVE: char = 'ݝ';
    /// \u{75e}: 'ݞ'
    pub const ARABIC_LETTER_AIN_WITH_THREE_DOTS_POINTING_DOWNWARDS_ABOVE: char = 'ݞ';
    /// \u{75f}: 'ݟ'
    pub const ARABIC_LETTER_AIN_WITH_TWO_DOTS_VERTICALLY_ABOVE: char = 'ݟ';
    /// \u{760}: 'ݠ'
    pub const ARABIC_LETTER_FEH_WITH_TWO_DOTS_BELOW: char = 'ݠ';
    /// \u{761}: 'ݡ'
    pub const ARABIC_LETTER_FEH_WITH_THREE_DOTS_POINTING_UPWARDS_BELOW: char = 'ݡ';
    /// \u{762}: 'ݢ'
    pub const ARABIC_LETTER_KEHEH_WITH_DOT_ABOVE: char = 'ݢ';
    /// \u{763}: 'ݣ'
    pub const ARABIC_LETTER_KEHEH_WITH_THREE_DOTS_ABOVE: char = 'ݣ';
    /// \u{764}: 'ݤ'
    pub const ARABIC_LETTER_KEHEH_WITH_THREE_DOTS_POINTING_UPWARDS_BELOW: char = 'ݤ';
    /// \u{765}: 'ݥ'
    pub const ARABIC_LETTER_MEEM_WITH_DOT_ABOVE: char = 'ݥ';
    /// \u{766}: 'ݦ'
    pub const ARABIC_LETTER_MEEM_WITH_DOT_BELOW: char = 'ݦ';
    /// \u{767}: 'ݧ'
    pub const ARABIC_LETTER_NOON_WITH_TWO_DOTS_BELOW: char = 'ݧ';
    /// \u{768}: 'ݨ'
    pub const ARABIC_LETTER_NOON_WITH_SMALL_TAH: char = 'ݨ';
    /// \u{769}: 'ݩ'
    pub const ARABIC_LETTER_NOON_WITH_SMALL_V: char = 'ݩ';
    /// \u{76a}: 'ݪ'
    pub const ARABIC_LETTER_LAM_WITH_BAR: char = 'ݪ';
    /// \u{76b}: 'ݫ'
    pub const ARABIC_LETTER_REH_WITH_TWO_DOTS_VERTICALLY_ABOVE: char = 'ݫ';
    /// \u{76c}: 'ݬ'
    pub const ARABIC_LETTER_REH_WITH_HAMZA_ABOVE: char = 'ݬ';
    /// \u{76d}: 'ݭ'
    pub const ARABIC_LETTER_SEEN_WITH_TWO_DOTS_VERTICALLY_ABOVE: char = 'ݭ';
    /// \u{76e}: 'ݮ'
    pub const ARABIC_LETTER_HAH_WITH_SMALL_ARABIC_LETTER_TAH_BELOW: char = 'ݮ';
    /// \u{76f}: 'ݯ'
    pub const ARABIC_LETTER_HAH_WITH_SMALL_ARABIC_LETTER_TAH_AND_TWO_DOTS: char = 'ݯ';
    /// \u{770}: 'ݰ'
    pub const ARABIC_LETTER_SEEN_WITH_SMALL_ARABIC_LETTER_TAH_AND_TWO_DOTS: char = 'ݰ';
    /// \u{771}: 'ݱ'
    pub const ARABIC_LETTER_REH_WITH_SMALL_ARABIC_LETTER_TAH_AND_TWO_DOTS: char = 'ݱ';
    /// \u{772}: 'ݲ'
    pub const ARABIC_LETTER_HAH_WITH_SMALL_ARABIC_LETTER_TAH_ABOVE: char = 'ݲ';
    /// \u{773}: 'ݳ'
    pub const ARABIC_LETTER_ALEF_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_TWO_ABOVE: char = 'ݳ';
    /// \u{774}: 'ݴ'
    pub const ARABIC_LETTER_ALEF_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_THREE_ABOVE: char = 'ݴ';
    /// \u{775}: 'ݵ'
    pub const ARABIC_LETTER_FARSI_YEH_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_TWO_ABOVE: char = 'ݵ';
    /// \u{776}: 'ݶ'
    pub const ARABIC_LETTER_FARSI_YEH_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_THREE_ABOVE: char = 'ݶ';
    /// \u{777}: 'ݷ'
    pub const ARABIC_LETTER_FARSI_YEH_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_FOUR_BELOW: char = 'ݷ';
    /// \u{778}: 'ݸ'
    pub const ARABIC_LETTER_WAW_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_TWO_ABOVE: char = 'ݸ';
    /// \u{779}: 'ݹ'
    pub const ARABIC_LETTER_WAW_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_THREE_ABOVE: char = 'ݹ';
    /// \u{77a}: 'ݺ'
    pub const ARABIC_LETTER_YEH_BARREE_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_TWO_ABOVE: char = 'ݺ';
    /// \u{77b}: 'ݻ'
    pub const ARABIC_LETTER_YEH_BARREE_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_THREE_ABOVE: char = 'ݻ';
    /// \u{77c}: 'ݼ'
    pub const ARABIC_LETTER_HAH_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_FOUR_BELOW: char = 'ݼ';
    /// \u{77d}: 'ݽ'
    pub const ARABIC_LETTER_SEEN_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_FOUR_ABOVE: char = 'ݽ';
    /// \u{77e}: 'ݾ'
    pub const ARABIC_LETTER_SEEN_WITH_INVERTED_V: char = 'ݾ';
}

/// An enum to represent all characters in the ArabicSupplement block.
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)]
pub enum ArabicSupplement {
    /// \u{750}: 'ݐ'
    ArabicLetterBehWithThreeDotsHorizontallyBelow,
    /// \u{751}: 'ݑ'
    ArabicLetterBehWithDotBelowAndThreeDotsAbove,
    /// \u{752}: 'ݒ'
    ArabicLetterBehWithThreeDotsPointingUpwardsBelow,
    /// \u{753}: 'ݓ'
    ArabicLetterBehWithThreeDotsPointingUpwardsBelowAndTwoDotsAbove,
    /// \u{754}: 'ݔ'
    ArabicLetterBehWithTwoDotsBelowAndDotAbove,
    /// \u{755}: 'ݕ'
    ArabicLetterBehWithInvertedSmallVBelow,
    /// \u{756}: 'ݖ'
    ArabicLetterBehWithSmallV,
    /// \u{757}: 'ݗ'
    ArabicLetterHahWithTwoDotsAbove,
    /// \u{758}: 'ݘ'
    ArabicLetterHahWithThreeDotsPointingUpwardsBelow,
    /// \u{759}: 'ݙ'
    ArabicLetterDalWithTwoDotsVerticallyBelowAndSmallTah,
    /// \u{75a}: 'ݚ'
    ArabicLetterDalWithInvertedSmallVBelow,
    /// \u{75b}: 'ݛ'
    ArabicLetterRehWithStroke,
    /// \u{75c}: 'ݜ'
    ArabicLetterSeenWithFourDotsAbove,
    /// \u{75d}: 'ݝ'
    ArabicLetterAinWithTwoDotsAbove,
    /// \u{75e}: 'ݞ'
    ArabicLetterAinWithThreeDotsPointingDownwardsAbove,
    /// \u{75f}: 'ݟ'
    ArabicLetterAinWithTwoDotsVerticallyAbove,
    /// \u{760}: 'ݠ'
    ArabicLetterFehWithTwoDotsBelow,
    /// \u{761}: 'ݡ'
    ArabicLetterFehWithThreeDotsPointingUpwardsBelow,
    /// \u{762}: 'ݢ'
    ArabicLetterKehehWithDotAbove,
    /// \u{763}: 'ݣ'
    ArabicLetterKehehWithThreeDotsAbove,
    /// \u{764}: 'ݤ'
    ArabicLetterKehehWithThreeDotsPointingUpwardsBelow,
    /// \u{765}: 'ݥ'
    ArabicLetterMeemWithDotAbove,
    /// \u{766}: 'ݦ'
    ArabicLetterMeemWithDotBelow,
    /// \u{767}: 'ݧ'
    ArabicLetterNoonWithTwoDotsBelow,
    /// \u{768}: 'ݨ'
    ArabicLetterNoonWithSmallTah,
    /// \u{769}: 'ݩ'
    ArabicLetterNoonWithSmallV,
    /// \u{76a}: 'ݪ'
    ArabicLetterLamWithBar,
    /// \u{76b}: 'ݫ'
    ArabicLetterRehWithTwoDotsVerticallyAbove,
    /// \u{76c}: 'ݬ'
    ArabicLetterRehWithHamzaAbove,
    /// \u{76d}: 'ݭ'
    ArabicLetterSeenWithTwoDotsVerticallyAbove,
    /// \u{76e}: 'ݮ'
    ArabicLetterHahWithSmallArabicLetterTahBelow,
    /// \u{76f}: 'ݯ'
    ArabicLetterHahWithSmallArabicLetterTahAndTwoDots,
    /// \u{770}: 'ݰ'
    ArabicLetterSeenWithSmallArabicLetterTahAndTwoDots,
    /// \u{771}: 'ݱ'
    ArabicLetterRehWithSmallArabicLetterTahAndTwoDots,
    /// \u{772}: 'ݲ'
    ArabicLetterHahWithSmallArabicLetterTahAbove,
    /// \u{773}: 'ݳ'
    ArabicLetterAlefWithExtendedArabicDashIndicDigitTwoAbove,
    /// \u{774}: 'ݴ'
    ArabicLetterAlefWithExtendedArabicDashIndicDigitThreeAbove,
    /// \u{775}: 'ݵ'
    ArabicLetterFarsiYehWithExtendedArabicDashIndicDigitTwoAbove,
    /// \u{776}: 'ݶ'
    ArabicLetterFarsiYehWithExtendedArabicDashIndicDigitThreeAbove,
    /// \u{777}: 'ݷ'
    ArabicLetterFarsiYehWithExtendedArabicDashIndicDigitFourBelow,
    /// \u{778}: 'ݸ'
    ArabicLetterWawWithExtendedArabicDashIndicDigitTwoAbove,
    /// \u{779}: 'ݹ'
    ArabicLetterWawWithExtendedArabicDashIndicDigitThreeAbove,
    /// \u{77a}: 'ݺ'
    ArabicLetterYehBarreeWithExtendedArabicDashIndicDigitTwoAbove,
    /// \u{77b}: 'ݻ'
    ArabicLetterYehBarreeWithExtendedArabicDashIndicDigitThreeAbove,
    /// \u{77c}: 'ݼ'
    ArabicLetterHahWithExtendedArabicDashIndicDigitFourBelow,
    /// \u{77d}: 'ݽ'
    ArabicLetterSeenWithExtendedArabicDashIndicDigitFourAbove,
    /// \u{77e}: 'ݾ'
    ArabicLetterSeenWithInvertedV,
}

impl Into<char> for ArabicSupplement {
    fn into(self) -> char {
        use constants::*;
        match self {
            ArabicSupplement::ArabicLetterBehWithThreeDotsHorizontallyBelow => ARABIC_LETTER_BEH_WITH_THREE_DOTS_HORIZONTALLY_BELOW,
            ArabicSupplement::ArabicLetterBehWithDotBelowAndThreeDotsAbove => ARABIC_LETTER_BEH_WITH_DOT_BELOW_AND_THREE_DOTS_ABOVE,
            ArabicSupplement::ArabicLetterBehWithThreeDotsPointingUpwardsBelow => ARABIC_LETTER_BEH_WITH_THREE_DOTS_POINTING_UPWARDS_BELOW,
            ArabicSupplement::ArabicLetterBehWithThreeDotsPointingUpwardsBelowAndTwoDotsAbove => ARABIC_LETTER_BEH_WITH_THREE_DOTS_POINTING_UPWARDS_BELOW_AND_TWO_DOTS_ABOVE,
            ArabicSupplement::ArabicLetterBehWithTwoDotsBelowAndDotAbove => ARABIC_LETTER_BEH_WITH_TWO_DOTS_BELOW_AND_DOT_ABOVE,
            ArabicSupplement::ArabicLetterBehWithInvertedSmallVBelow => ARABIC_LETTER_BEH_WITH_INVERTED_SMALL_V_BELOW,
            ArabicSupplement::ArabicLetterBehWithSmallV => ARABIC_LETTER_BEH_WITH_SMALL_V,
            ArabicSupplement::ArabicLetterHahWithTwoDotsAbove => ARABIC_LETTER_HAH_WITH_TWO_DOTS_ABOVE,
            ArabicSupplement::ArabicLetterHahWithThreeDotsPointingUpwardsBelow => ARABIC_LETTER_HAH_WITH_THREE_DOTS_POINTING_UPWARDS_BELOW,
            ArabicSupplement::ArabicLetterDalWithTwoDotsVerticallyBelowAndSmallTah => ARABIC_LETTER_DAL_WITH_TWO_DOTS_VERTICALLY_BELOW_AND_SMALL_TAH,
            ArabicSupplement::ArabicLetterDalWithInvertedSmallVBelow => ARABIC_LETTER_DAL_WITH_INVERTED_SMALL_V_BELOW,
            ArabicSupplement::ArabicLetterRehWithStroke => ARABIC_LETTER_REH_WITH_STROKE,
            ArabicSupplement::ArabicLetterSeenWithFourDotsAbove => ARABIC_LETTER_SEEN_WITH_FOUR_DOTS_ABOVE,
            ArabicSupplement::ArabicLetterAinWithTwoDotsAbove => ARABIC_LETTER_AIN_WITH_TWO_DOTS_ABOVE,
            ArabicSupplement::ArabicLetterAinWithThreeDotsPointingDownwardsAbove => ARABIC_LETTER_AIN_WITH_THREE_DOTS_POINTING_DOWNWARDS_ABOVE,
            ArabicSupplement::ArabicLetterAinWithTwoDotsVerticallyAbove => ARABIC_LETTER_AIN_WITH_TWO_DOTS_VERTICALLY_ABOVE,
            ArabicSupplement::ArabicLetterFehWithTwoDotsBelow => ARABIC_LETTER_FEH_WITH_TWO_DOTS_BELOW,
            ArabicSupplement::ArabicLetterFehWithThreeDotsPointingUpwardsBelow => ARABIC_LETTER_FEH_WITH_THREE_DOTS_POINTING_UPWARDS_BELOW,
            ArabicSupplement::ArabicLetterKehehWithDotAbove => ARABIC_LETTER_KEHEH_WITH_DOT_ABOVE,
            ArabicSupplement::ArabicLetterKehehWithThreeDotsAbove => ARABIC_LETTER_KEHEH_WITH_THREE_DOTS_ABOVE,
            ArabicSupplement::ArabicLetterKehehWithThreeDotsPointingUpwardsBelow => ARABIC_LETTER_KEHEH_WITH_THREE_DOTS_POINTING_UPWARDS_BELOW,
            ArabicSupplement::ArabicLetterMeemWithDotAbove => ARABIC_LETTER_MEEM_WITH_DOT_ABOVE,
            ArabicSupplement::ArabicLetterMeemWithDotBelow => ARABIC_LETTER_MEEM_WITH_DOT_BELOW,
            ArabicSupplement::ArabicLetterNoonWithTwoDotsBelow => ARABIC_LETTER_NOON_WITH_TWO_DOTS_BELOW,
            ArabicSupplement::ArabicLetterNoonWithSmallTah => ARABIC_LETTER_NOON_WITH_SMALL_TAH,
            ArabicSupplement::ArabicLetterNoonWithSmallV => ARABIC_LETTER_NOON_WITH_SMALL_V,
            ArabicSupplement::ArabicLetterLamWithBar => ARABIC_LETTER_LAM_WITH_BAR,
            ArabicSupplement::ArabicLetterRehWithTwoDotsVerticallyAbove => ARABIC_LETTER_REH_WITH_TWO_DOTS_VERTICALLY_ABOVE,
            ArabicSupplement::ArabicLetterRehWithHamzaAbove => ARABIC_LETTER_REH_WITH_HAMZA_ABOVE,
            ArabicSupplement::ArabicLetterSeenWithTwoDotsVerticallyAbove => ARABIC_LETTER_SEEN_WITH_TWO_DOTS_VERTICALLY_ABOVE,
            ArabicSupplement::ArabicLetterHahWithSmallArabicLetterTahBelow => ARABIC_LETTER_HAH_WITH_SMALL_ARABIC_LETTER_TAH_BELOW,
            ArabicSupplement::ArabicLetterHahWithSmallArabicLetterTahAndTwoDots => ARABIC_LETTER_HAH_WITH_SMALL_ARABIC_LETTER_TAH_AND_TWO_DOTS,
            ArabicSupplement::ArabicLetterSeenWithSmallArabicLetterTahAndTwoDots => ARABIC_LETTER_SEEN_WITH_SMALL_ARABIC_LETTER_TAH_AND_TWO_DOTS,
            ArabicSupplement::ArabicLetterRehWithSmallArabicLetterTahAndTwoDots => ARABIC_LETTER_REH_WITH_SMALL_ARABIC_LETTER_TAH_AND_TWO_DOTS,
            ArabicSupplement::ArabicLetterHahWithSmallArabicLetterTahAbove => ARABIC_LETTER_HAH_WITH_SMALL_ARABIC_LETTER_TAH_ABOVE,
            ArabicSupplement::ArabicLetterAlefWithExtendedArabicDashIndicDigitTwoAbove => ARABIC_LETTER_ALEF_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_TWO_ABOVE,
            ArabicSupplement::ArabicLetterAlefWithExtendedArabicDashIndicDigitThreeAbove => ARABIC_LETTER_ALEF_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_THREE_ABOVE,
            ArabicSupplement::ArabicLetterFarsiYehWithExtendedArabicDashIndicDigitTwoAbove => ARABIC_LETTER_FARSI_YEH_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_TWO_ABOVE,
            ArabicSupplement::ArabicLetterFarsiYehWithExtendedArabicDashIndicDigitThreeAbove => ARABIC_LETTER_FARSI_YEH_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_THREE_ABOVE,
            ArabicSupplement::ArabicLetterFarsiYehWithExtendedArabicDashIndicDigitFourBelow => ARABIC_LETTER_FARSI_YEH_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_FOUR_BELOW,
            ArabicSupplement::ArabicLetterWawWithExtendedArabicDashIndicDigitTwoAbove => ARABIC_LETTER_WAW_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_TWO_ABOVE,
            ArabicSupplement::ArabicLetterWawWithExtendedArabicDashIndicDigitThreeAbove => ARABIC_LETTER_WAW_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_THREE_ABOVE,
            ArabicSupplement::ArabicLetterYehBarreeWithExtendedArabicDashIndicDigitTwoAbove => ARABIC_LETTER_YEH_BARREE_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_TWO_ABOVE,
            ArabicSupplement::ArabicLetterYehBarreeWithExtendedArabicDashIndicDigitThreeAbove => ARABIC_LETTER_YEH_BARREE_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_THREE_ABOVE,
            ArabicSupplement::ArabicLetterHahWithExtendedArabicDashIndicDigitFourBelow => ARABIC_LETTER_HAH_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_FOUR_BELOW,
            ArabicSupplement::ArabicLetterSeenWithExtendedArabicDashIndicDigitFourAbove => ARABIC_LETTER_SEEN_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_FOUR_ABOVE,
            ArabicSupplement::ArabicLetterSeenWithInvertedV => ARABIC_LETTER_SEEN_WITH_INVERTED_V,
        }
    }
}

impl std::convert::TryFrom<char> for ArabicSupplement {
    type Error = ();
    fn try_from(c: char) -> Result<Self, Self::Error> {
        use constants::*;
        match c {
            ARABIC_LETTER_BEH_WITH_THREE_DOTS_HORIZONTALLY_BELOW => Ok(ArabicSupplement::ArabicLetterBehWithThreeDotsHorizontallyBelow),
            ARABIC_LETTER_BEH_WITH_DOT_BELOW_AND_THREE_DOTS_ABOVE => Ok(ArabicSupplement::ArabicLetterBehWithDotBelowAndThreeDotsAbove),
            ARABIC_LETTER_BEH_WITH_THREE_DOTS_POINTING_UPWARDS_BELOW => Ok(ArabicSupplement::ArabicLetterBehWithThreeDotsPointingUpwardsBelow),
            ARABIC_LETTER_BEH_WITH_THREE_DOTS_POINTING_UPWARDS_BELOW_AND_TWO_DOTS_ABOVE => Ok(ArabicSupplement::ArabicLetterBehWithThreeDotsPointingUpwardsBelowAndTwoDotsAbove),
            ARABIC_LETTER_BEH_WITH_TWO_DOTS_BELOW_AND_DOT_ABOVE => Ok(ArabicSupplement::ArabicLetterBehWithTwoDotsBelowAndDotAbove),
            ARABIC_LETTER_BEH_WITH_INVERTED_SMALL_V_BELOW => Ok(ArabicSupplement::ArabicLetterBehWithInvertedSmallVBelow),
            ARABIC_LETTER_BEH_WITH_SMALL_V => Ok(ArabicSupplement::ArabicLetterBehWithSmallV),
            ARABIC_LETTER_HAH_WITH_TWO_DOTS_ABOVE => Ok(ArabicSupplement::ArabicLetterHahWithTwoDotsAbove),
            ARABIC_LETTER_HAH_WITH_THREE_DOTS_POINTING_UPWARDS_BELOW => Ok(ArabicSupplement::ArabicLetterHahWithThreeDotsPointingUpwardsBelow),
            ARABIC_LETTER_DAL_WITH_TWO_DOTS_VERTICALLY_BELOW_AND_SMALL_TAH => Ok(ArabicSupplement::ArabicLetterDalWithTwoDotsVerticallyBelowAndSmallTah),
            ARABIC_LETTER_DAL_WITH_INVERTED_SMALL_V_BELOW => Ok(ArabicSupplement::ArabicLetterDalWithInvertedSmallVBelow),
            ARABIC_LETTER_REH_WITH_STROKE => Ok(ArabicSupplement::ArabicLetterRehWithStroke),
            ARABIC_LETTER_SEEN_WITH_FOUR_DOTS_ABOVE => Ok(ArabicSupplement::ArabicLetterSeenWithFourDotsAbove),
            ARABIC_LETTER_AIN_WITH_TWO_DOTS_ABOVE => Ok(ArabicSupplement::ArabicLetterAinWithTwoDotsAbove),
            ARABIC_LETTER_AIN_WITH_THREE_DOTS_POINTING_DOWNWARDS_ABOVE => Ok(ArabicSupplement::ArabicLetterAinWithThreeDotsPointingDownwardsAbove),
            ARABIC_LETTER_AIN_WITH_TWO_DOTS_VERTICALLY_ABOVE => Ok(ArabicSupplement::ArabicLetterAinWithTwoDotsVerticallyAbove),
            ARABIC_LETTER_FEH_WITH_TWO_DOTS_BELOW => Ok(ArabicSupplement::ArabicLetterFehWithTwoDotsBelow),
            ARABIC_LETTER_FEH_WITH_THREE_DOTS_POINTING_UPWARDS_BELOW => Ok(ArabicSupplement::ArabicLetterFehWithThreeDotsPointingUpwardsBelow),
            ARABIC_LETTER_KEHEH_WITH_DOT_ABOVE => Ok(ArabicSupplement::ArabicLetterKehehWithDotAbove),
            ARABIC_LETTER_KEHEH_WITH_THREE_DOTS_ABOVE => Ok(ArabicSupplement::ArabicLetterKehehWithThreeDotsAbove),
            ARABIC_LETTER_KEHEH_WITH_THREE_DOTS_POINTING_UPWARDS_BELOW => Ok(ArabicSupplement::ArabicLetterKehehWithThreeDotsPointingUpwardsBelow),
            ARABIC_LETTER_MEEM_WITH_DOT_ABOVE => Ok(ArabicSupplement::ArabicLetterMeemWithDotAbove),
            ARABIC_LETTER_MEEM_WITH_DOT_BELOW => Ok(ArabicSupplement::ArabicLetterMeemWithDotBelow),
            ARABIC_LETTER_NOON_WITH_TWO_DOTS_BELOW => Ok(ArabicSupplement::ArabicLetterNoonWithTwoDotsBelow),
            ARABIC_LETTER_NOON_WITH_SMALL_TAH => Ok(ArabicSupplement::ArabicLetterNoonWithSmallTah),
            ARABIC_LETTER_NOON_WITH_SMALL_V => Ok(ArabicSupplement::ArabicLetterNoonWithSmallV),
            ARABIC_LETTER_LAM_WITH_BAR => Ok(ArabicSupplement::ArabicLetterLamWithBar),
            ARABIC_LETTER_REH_WITH_TWO_DOTS_VERTICALLY_ABOVE => Ok(ArabicSupplement::ArabicLetterRehWithTwoDotsVerticallyAbove),
            ARABIC_LETTER_REH_WITH_HAMZA_ABOVE => Ok(ArabicSupplement::ArabicLetterRehWithHamzaAbove),
            ARABIC_LETTER_SEEN_WITH_TWO_DOTS_VERTICALLY_ABOVE => Ok(ArabicSupplement::ArabicLetterSeenWithTwoDotsVerticallyAbove),
            ARABIC_LETTER_HAH_WITH_SMALL_ARABIC_LETTER_TAH_BELOW => Ok(ArabicSupplement::ArabicLetterHahWithSmallArabicLetterTahBelow),
            ARABIC_LETTER_HAH_WITH_SMALL_ARABIC_LETTER_TAH_AND_TWO_DOTS => Ok(ArabicSupplement::ArabicLetterHahWithSmallArabicLetterTahAndTwoDots),
            ARABIC_LETTER_SEEN_WITH_SMALL_ARABIC_LETTER_TAH_AND_TWO_DOTS => Ok(ArabicSupplement::ArabicLetterSeenWithSmallArabicLetterTahAndTwoDots),
            ARABIC_LETTER_REH_WITH_SMALL_ARABIC_LETTER_TAH_AND_TWO_DOTS => Ok(ArabicSupplement::ArabicLetterRehWithSmallArabicLetterTahAndTwoDots),
            ARABIC_LETTER_HAH_WITH_SMALL_ARABIC_LETTER_TAH_ABOVE => Ok(ArabicSupplement::ArabicLetterHahWithSmallArabicLetterTahAbove),
            ARABIC_LETTER_ALEF_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_TWO_ABOVE => Ok(ArabicSupplement::ArabicLetterAlefWithExtendedArabicDashIndicDigitTwoAbove),
            ARABIC_LETTER_ALEF_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_THREE_ABOVE => Ok(ArabicSupplement::ArabicLetterAlefWithExtendedArabicDashIndicDigitThreeAbove),
            ARABIC_LETTER_FARSI_YEH_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_TWO_ABOVE => Ok(ArabicSupplement::ArabicLetterFarsiYehWithExtendedArabicDashIndicDigitTwoAbove),
            ARABIC_LETTER_FARSI_YEH_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_THREE_ABOVE => Ok(ArabicSupplement::ArabicLetterFarsiYehWithExtendedArabicDashIndicDigitThreeAbove),
            ARABIC_LETTER_FARSI_YEH_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_FOUR_BELOW => Ok(ArabicSupplement::ArabicLetterFarsiYehWithExtendedArabicDashIndicDigitFourBelow),
            ARABIC_LETTER_WAW_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_TWO_ABOVE => Ok(ArabicSupplement::ArabicLetterWawWithExtendedArabicDashIndicDigitTwoAbove),
            ARABIC_LETTER_WAW_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_THREE_ABOVE => Ok(ArabicSupplement::ArabicLetterWawWithExtendedArabicDashIndicDigitThreeAbove),
            ARABIC_LETTER_YEH_BARREE_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_TWO_ABOVE => Ok(ArabicSupplement::ArabicLetterYehBarreeWithExtendedArabicDashIndicDigitTwoAbove),
            ARABIC_LETTER_YEH_BARREE_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_THREE_ABOVE => Ok(ArabicSupplement::ArabicLetterYehBarreeWithExtendedArabicDashIndicDigitThreeAbove),
            ARABIC_LETTER_HAH_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_FOUR_BELOW => Ok(ArabicSupplement::ArabicLetterHahWithExtendedArabicDashIndicDigitFourBelow),
            ARABIC_LETTER_SEEN_WITH_EXTENDED_ARABIC_DASH_INDIC_DIGIT_FOUR_ABOVE => Ok(ArabicSupplement::ArabicLetterSeenWithExtendedArabicDashIndicDigitFourAbove),
            ARABIC_LETTER_SEEN_WITH_INVERTED_V => Ok(ArabicSupplement::ArabicLetterSeenWithInvertedV),
            _ => Err(()),
        }
    }
}

impl Into<u32> for ArabicSupplement {
    fn into(self) -> u32 {
        let c: char = self.into();
        let hex = c
            .escape_unicode()
            .to_string()
            .replace("\\u{", "")
            .replace("}", "");
        u32::from_str_radix(&hex, 16).unwrap()
    }
}

impl std::convert::TryFrom<u32> for ArabicSupplement {
    type Error = ();
    fn try_from(u: u32) -> Result<Self, Self::Error> {
        if let Ok(c) = char::try_from(u) {
            Self::try_from(c)
        } else {
            Err(())
        }
    }
}

impl Iterator for ArabicSupplement {
    type Item = Self;
    fn next(&mut self) -> Option<Self> {
        let index: u32 = (*self).into();
        use std::convert::TryFrom;
        Self::try_from(index + 1).ok()
    }
}

impl ArabicSupplement {
    /// The character with the lowest index in this unicode block
    pub fn new() -> Self {
        ArabicSupplement::ArabicLetterBehWithThreeDotsHorizontallyBelow
    }

    /// The character's name, all lowercase and space-separated
    pub fn name(&self) -> &str {
        match self {
            ArabicSupplement::ArabicLetterBehWithThreeDotsHorizontallyBelow => "arabic letter beh with three dots horizontally below",
            ArabicSupplement::ArabicLetterBehWithDotBelowAndThreeDotsAbove => "arabic letter beh with dot below and three dots above",
            ArabicSupplement::ArabicLetterBehWithThreeDotsPointingUpwardsBelow => "arabic letter beh with three dots pointing upwards below",
            ArabicSupplement::ArabicLetterBehWithThreeDotsPointingUpwardsBelowAndTwoDotsAbove => "arabic letter beh with three dots pointing upwards below and two dots above",
            ArabicSupplement::ArabicLetterBehWithTwoDotsBelowAndDotAbove => "arabic letter beh with two dots below and dot above",
            ArabicSupplement::ArabicLetterBehWithInvertedSmallVBelow => "arabic letter beh with inverted small v below",
            ArabicSupplement::ArabicLetterBehWithSmallV => "arabic letter beh with small v",
            ArabicSupplement::ArabicLetterHahWithTwoDotsAbove => "arabic letter hah with two dots above",
            ArabicSupplement::ArabicLetterHahWithThreeDotsPointingUpwardsBelow => "arabic letter hah with three dots pointing upwards below",
            ArabicSupplement::ArabicLetterDalWithTwoDotsVerticallyBelowAndSmallTah => "arabic letter dal with two dots vertically below and small tah",
            ArabicSupplement::ArabicLetterDalWithInvertedSmallVBelow => "arabic letter dal with inverted small v below",
            ArabicSupplement::ArabicLetterRehWithStroke => "arabic letter reh with stroke",
            ArabicSupplement::ArabicLetterSeenWithFourDotsAbove => "arabic letter seen with four dots above",
            ArabicSupplement::ArabicLetterAinWithTwoDotsAbove => "arabic letter ain with two dots above",
            ArabicSupplement::ArabicLetterAinWithThreeDotsPointingDownwardsAbove => "arabic letter ain with three dots pointing downwards above",
            ArabicSupplement::ArabicLetterAinWithTwoDotsVerticallyAbove => "arabic letter ain with two dots vertically above",
            ArabicSupplement::ArabicLetterFehWithTwoDotsBelow => "arabic letter feh with two dots below",
            ArabicSupplement::ArabicLetterFehWithThreeDotsPointingUpwardsBelow => "arabic letter feh with three dots pointing upwards below",
            ArabicSupplement::ArabicLetterKehehWithDotAbove => "arabic letter keheh with dot above",
            ArabicSupplement::ArabicLetterKehehWithThreeDotsAbove => "arabic letter keheh with three dots above",
            ArabicSupplement::ArabicLetterKehehWithThreeDotsPointingUpwardsBelow => "arabic letter keheh with three dots pointing upwards below",
            ArabicSupplement::ArabicLetterMeemWithDotAbove => "arabic letter meem with dot above",
            ArabicSupplement::ArabicLetterMeemWithDotBelow => "arabic letter meem with dot below",
            ArabicSupplement::ArabicLetterNoonWithTwoDotsBelow => "arabic letter noon with two dots below",
            ArabicSupplement::ArabicLetterNoonWithSmallTah => "arabic letter noon with small tah",
            ArabicSupplement::ArabicLetterNoonWithSmallV => "arabic letter noon with small v",
            ArabicSupplement::ArabicLetterLamWithBar => "arabic letter lam with bar",
            ArabicSupplement::ArabicLetterRehWithTwoDotsVerticallyAbove => "arabic letter reh with two dots vertically above",
            ArabicSupplement::ArabicLetterRehWithHamzaAbove => "arabic letter reh with hamza above",
            ArabicSupplement::ArabicLetterSeenWithTwoDotsVerticallyAbove => "arabic letter seen with two dots vertically above",
            ArabicSupplement::ArabicLetterHahWithSmallArabicLetterTahBelow => "arabic letter hah with small arabic letter tah below",
            ArabicSupplement::ArabicLetterHahWithSmallArabicLetterTahAndTwoDots => "arabic letter hah with small arabic letter tah and two dots",
            ArabicSupplement::ArabicLetterSeenWithSmallArabicLetterTahAndTwoDots => "arabic letter seen with small arabic letter tah and two dots",
            ArabicSupplement::ArabicLetterRehWithSmallArabicLetterTahAndTwoDots => "arabic letter reh with small arabic letter tah and two dots",
            ArabicSupplement::ArabicLetterHahWithSmallArabicLetterTahAbove => "arabic letter hah with small arabic letter tah above",
            ArabicSupplement::ArabicLetterAlefWithExtendedArabicDashIndicDigitTwoAbove => "arabic letter alef with extended arabic-indic digit two above",
            ArabicSupplement::ArabicLetterAlefWithExtendedArabicDashIndicDigitThreeAbove => "arabic letter alef with extended arabic-indic digit three above",
            ArabicSupplement::ArabicLetterFarsiYehWithExtendedArabicDashIndicDigitTwoAbove => "arabic letter farsi yeh with extended arabic-indic digit two above",
            ArabicSupplement::ArabicLetterFarsiYehWithExtendedArabicDashIndicDigitThreeAbove => "arabic letter farsi yeh with extended arabic-indic digit three above",
            ArabicSupplement::ArabicLetterFarsiYehWithExtendedArabicDashIndicDigitFourBelow => "arabic letter farsi yeh with extended arabic-indic digit four below",
            ArabicSupplement::ArabicLetterWawWithExtendedArabicDashIndicDigitTwoAbove => "arabic letter waw with extended arabic-indic digit two above",
            ArabicSupplement::ArabicLetterWawWithExtendedArabicDashIndicDigitThreeAbove => "arabic letter waw with extended arabic-indic digit three above",
            ArabicSupplement::ArabicLetterYehBarreeWithExtendedArabicDashIndicDigitTwoAbove => "arabic letter yeh barree with extended arabic-indic digit two above",
            ArabicSupplement::ArabicLetterYehBarreeWithExtendedArabicDashIndicDigitThreeAbove => "arabic letter yeh barree with extended arabic-indic digit three above",
            ArabicSupplement::ArabicLetterHahWithExtendedArabicDashIndicDigitFourBelow => "arabic letter hah with extended arabic-indic digit four below",
            ArabicSupplement::ArabicLetterSeenWithExtendedArabicDashIndicDigitFourAbove => "arabic letter seen with extended arabic-indic digit four above",
            ArabicSupplement::ArabicLetterSeenWithInvertedV => "arabic letter seen with inverted v",
        }
    }
}