/
main.dart
82 lines (63 loc) · 2.71 KB
/
main.dart
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
import 'package:dartarabic/dartarabic.dart';
void main() async {
String output = "";
final stopwatch = Stopwatch();
//Use Isolates for heavy computation
stopwatch.reset();
stopwatch.start();
// output = DartArabic.stripHarakat("الْعَرَبِيّةُ");
output = "الْعَرَبِيّةُ".stripHarakat();
print("stripHarakat ${stopwatch.elapsedMilliseconds}ms: $output");
stopwatch.reset();
stopwatch.start();
//output = DartArabic.stripTashkeel("الْعَرَبِيّةُُ");
output = "الْعَرَبِيّةُُ".stripTashkeel();
print("stripTashkeel ${stopwatch.elapsedMilliseconds}ms: $output");
stopwatch.reset();
stopwatch.start();
//output = DartArabic.stripShadda("الشّمسيّة");
output = "الشّمسيّة".stripShadda();
print("stripShadda ${stopwatch.elapsedMilliseconds}ms: $output");
stopwatch.reset();
stopwatch.start();
//output = DartArabic.normalizeLigature("ﻻنحالي ﻷﻹﻵ");
output = "ﻻنحالي ﻷﻹﻵ".normalizeLigature();
print("normalizeLigature ${stopwatch.elapsedMilliseconds}ms: $output");
stopwatch.reset();
stopwatch.start();
//output = DartArabic.normalizeHamzaUniform("جاء سؤال الأئمة عن الإسلام آجلا");
output = "جاء سؤال الأئمة عن الإسلام آجلا".normalizeHamzaUniform();
print("normalizeHamzaUniform ${stopwatch.elapsedMilliseconds}ms: $output");
stopwatch.reset();
stopwatch.start();
output = DartArabic.normalizeHamzaTasheel("جاء سؤال الأئمة عن الإسلام آجلا");
print("normalizeHamzaTasheel ${stopwatch.elapsedMilliseconds}ms: $output");
stopwatch.reset();
stopwatch.start();
output = DartArabic.normalizeAlef("بِٱلْهُدَىٰ");
print("normalizeAlef ${stopwatch.elapsedMilliseconds}ms: $output");
stopwatch.reset();
stopwatch.start();
output = DartArabic.stripDiacritics("الْعَرَبِيّة");
print("stripDiacritics ${stopwatch.elapsedMilliseconds}ms: $output");
stopwatch.reset();
stopwatch.start();
output = DartArabic.stripDiacritics("الْعَرَبِيّةُ");
print("stripDiacritics ${stopwatch.elapsedMilliseconds}ms: $output");
stopwatch.reset();
stopwatch.start();
output = DartArabic.stripTatweel("العـــــربيةُ");
print("stripTatweel ${stopwatch.elapsedMilliseconds}ms: $output");
stopwatch.reset();
stopwatch.start();
output = DartArabic.normalizeLetters("ﻫﻞ");
print("normalizeLetters ${stopwatch.elapsedMilliseconds}ms: $output");
// Accessing Characters string
print(Arabic.ALEF);
print(Arabic.BEH);
print(Arabic.TEH);
print(Arabic.Symbols.QUESTION);
print(Arabic.Symbols.SEMICOLON);
print(Arabic.Symbols.SHADDA);
print(Arabic.NAMES);
}