-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsnowball.bundle.java
21446 lines (20717 loc) · 485 KB
/
snowball.bundle.java
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
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
public class StringBuffer {
private String b = "";
@Override
public int length() {
return b.length();
}
void replace(int start, int end, String str) {
if (start == 0 && end == b.length()) {
b = str;
} else {
String left = b.substring(0, start), right = b.substring(end);
b = left + str + right;
}
}
String substring(int start, int end) {
return b.substring(start, end);
}
@Override
public char charAt(int index) {
return b.charAt(index);
}
@Override
public CharSequence subSequence(int start, int end) {
throw new Error("NotImpl: CharSequence::subSequence");
}
@Override
public String toString() {
return b;
}
}
public class StringBuilder extends StringBuffer {
}
public class Among {
private static char[] toCharArray(String s) {
int sLength = s.length();
char[] charArr = new char[sLength];
for (int i = 0; i < sLength; i++)
charArr[i] = s.charAt(i);
return charArr;
}
public Among(String s, int substring_i, int result, String methodname, Class obj) {
this.s = toCharArray(s);
this.substring_i = substring_i;
this.result = result;
method = methodname ? obj[methodname] : null;
methodobject = obj;
}
public final char[] s; /* search string */
public final int substring_i; /* index to longest matching substring */
public final int result; /* result of the lookup */
public final Method method; /* method to use if substring matches */
public Object methodobject; /* object to invoke method on */
};
public class SnowballProgram {
protected SnowballProgram() {
current = new StringBuffer();
setCurrent("");
}
/**
* Set the current string.
*/
public void setCurrent(String value) {
current.replace(0, current.length(), value);
cursor = 0;
limit = current.length();
limit_backward = 0;
bra = cursor;
ket = limit;
}
/**
* Get the current string.
*/
public String getCurrent() {
String result = current.toString();
// Make a new StringBuffer. If we reuse the old one, and a user of
// the library keeps a reference to the buffer returned (for example,
// by converting it to a String in a way which doesn't force a copy),
// the buffer size will not decrease, and we will risk wasting a large
// amount of memory.
// Thanks to Wolfram Esser for spotting this problem.
current = new StringBuffer();
return result;
}
// current string
protected StringBuffer current;
protected int cursor;
protected int limit;
protected int limit_backward;
protected int bra;
protected int ket;
protected boolean in_grouping(char[] s, int min, int max) {
if (cursor >= limit)
return false;
char ch = current.charAt(cursor);
if (ch > max || ch < min)
return false;
ch -= min;
if ((s[ch >> 3] & (0X1 << (ch & 0X7))) == 0)
return false;
cursor++;
return true;
}
protected boolean in_grouping_b(char[] s, int min, int max) {
if (cursor <= limit_backward)
return false;
char ch = current.charAt(cursor - 1);
if (ch > max || ch < min)
return false;
ch -= min;
if ((s[ch >> 3] & (0X1 << (ch & 0X7))) == 0)
return false;
cursor--;
return true;
}
protected boolean out_grouping(char[] s, int min, int max) {
if (cursor >= limit)
return false;
char ch = current.charAt(cursor);
if (ch > max || ch < min) {
cursor++;
return true;
}
ch -= min;
if ((s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) {
cursor++;
return true;
}
return false;
}
protected boolean out_grouping_b(char[] s, int min, int max) {
if (cursor <= limit_backward)
return false;
char ch = current.charAt(cursor - 1);
if (ch > max || ch < min) {
cursor--;
return true;
}
ch -= min;
if ((s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) {
cursor--;
return true;
}
return false;
}
protected boolean eq_s(String s) {
if (limit - cursor < s.length())
return false;
int i;
for (i = 0; i != s.length(); i++) {
if (current.charAt(cursor + i) != s.charAt(i))
return false;
}
cursor += s.length();
return true;
}
protected boolean eq_s_b(String s) {
if (cursor - limit_backward < s.length())
return false;
int i;
for (i = 0; i != s.length(); i++) {
if (current.charAt(cursor - s.length() + i) != s.charAt(i))
return false;
}
cursor -= s.length();
return true;
}
protected int find_among(Among v[]) {
int i = 0;
int j = v.length;
int c = cursor;
int l = limit;
int common_i = 0;
int common_j = 0;
boolean first_key_inspected = false;
while (true) {
int k = i + ((j - i) >> 1);
int diff = 0;
int common = common_i < common_j ? common_i : common_j; // smaller
Among w = v[k];
int i2;
for (i2 = common; i2 < w.s.length; i2++) {
if (c + common == l) {
diff = -1;
break;
}
diff = current.charAt(c + common) - w.s[i2];
if (diff != 0)
break;
common++;
}
if (diff < 0) {
j = k;
common_j = common;
} else {
i = k;
common_i = common;
}
if (j - i <= 1) {
if (i > 0)
break; // v->s has been inspected
if (j == i)
break; // only one item in v
// - but now we need to go round once more to get
// v->s inspected. This looks messy, but is actually
// the optimal approach.
if (first_key_inspected)
break;
first_key_inspected = true;
}
}
while (true) {
Among w = v[i];
if (common_i >= w.s.length) {
cursor = c + w.s.length;
if (w.method == null)
return w.result;
boolean res;
res = w.method.call(w.methodobject);
cursor = c + w.s.length;
if (res)
return w.result;
}
i = w.substring_i;
if (i < 0)
return 0;
}
}
// find_among_b is for backwards processing. Same comments apply
protected int find_among_b(Among v[]) {
int i = 0;
int j = v.length;
int c = cursor;
int lb = limit_backward;
int common_i = 0;
int common_j = 0;
boolean first_key_inspected = false;
while (true) {
int k = i + ((j - i) >> 1);
int diff = 0;
int common = common_i < common_j ? common_i : common_j;
Among w = v[k];
int i2;
for (i2 = w.s.length - 1 - common; i2 >= 0; i2--) {
if (c - common == lb) {
diff = -1;
break;
}
diff = current.charAt(c - 1 - common) - w.s[i2];
if (diff != 0)
break;
common++;
}
if (diff < 0) {
j = k;
common_j = common;
} else {
i = k;
common_i = common;
}
if (j - i <= 1) {
if (i > 0)
break;
if (j == i)
break;
if (first_key_inspected)
break;
first_key_inspected = true;
}
}
while (true) {
Among w = v[i];
if (common_i >= w.s.length) {
cursor = c - w.s.length;
if (w.method == null)
return w.result;
boolean res;
res = w.method.call(w.methodobject);
cursor = c - w.s.length;
if (res)
return w.result;
}
i = w.substring_i;
if (i < 0)
return 0;
}
}
/*
* to replace chars between c_bra and c_ket in current by the chars in s.
*/
protected int replace_s(int c_bra, int c_ket, String s) {
int adjustment = s.length() - (c_ket - c_bra);
current.replace(c_bra, c_ket, s);
limit += adjustment;
if (cursor >= c_ket)
cursor += adjustment;
else if (cursor > c_bra)
cursor = c_bra;
return adjustment;
}
protected void slice_check() {
if (bra < 0 || bra > ket || ket > limit || limit > current.length()) // this
// line
// could
// be
// removed
{
throw new Error("Snowball: faulty slice operation");
}
}
protected void slice_from(String s) {
slice_check();
replace_s(bra, ket, s);
}
protected void slice_del() {
slice_from("");
}
protected void insert(int c_bra, int c_ket, String s) {
int adjustment = replace_s(c_bra, c_ket, s);
if (c_bra <= bra)
bra += adjustment;
if (c_bra <= ket)
ket += adjustment;
}
/* Copy the slice into the supplied StringBuilder */
protected StringBuilder slice_to(StringBuilder s) {
slice_check();
s.replace(0, s.length(), current.substring(bra, ket));
return s;
}
};
public abstract class SnowballStemmer extends SnowballProgram {
public abstract boolean stem();
};
// This file was generated automatically by the Snowball to Java compiler
// http://snowballstem.org/
/**
* This class was automatically generated by a Snowball to Java compiler It
* implements the stemming algorithm defined by a snowball script.
*/
public class arabicStemmer extends SnowballStemmer {
private final static Among a_0[] = { new Among("!", -1, 3), new Among("\"", -1, 3), new Among("%", -1, 3),
new Among("*", -1, 3), new Among(",", -1, 3), new Among(".", -1, 3), new Among("/", -1, 3),
new Among(":", -1, 3), new Among(";", -1, 3), new Among("?", -1, 3), new Among("\\", -1, 3),
new Among("\u060C", -1, 4), new Among("\u061B", -1, 4), new Among("\u061F", -1, 4),
new Among("\u0640", -1, 2), new Among("\u064B", -1, 1), new Among("\u064C", -1, 1),
new Among("\u064D", -1, 1), new Among("\u064E", -1, 1), new Among("\u064F", -1, 1),
new Among("\u0650", -1, 1), new Among("\u0651", -1, 1), new Among("\u0652", -1, 1),
new Among("\u0660", -1, 5), new Among("\u0661", -1, 6), new Among("\u0662", -1, 7),
new Among("\u0663", -1, 8), new Among("\u0664", -1, 9), new Among("\u0665", -1, 10),
new Among("\u0666", -1, 11), new Among("\u0667", -1, 12), new Among("\u0668", -1, 13),
new Among("\u0669", -1, 14), new Among("\u066A", -1, 15), new Among("\u066B", -1, 15),
new Among("\u066C", -1, 15), new Among("\uFE80", -1, 16), new Among("\uFE81", -1, 20),
new Among("\uFE82", -1, 20), new Among("\uFE83", -1, 17), new Among("\uFE84", -1, 17),
new Among("\uFE85", -1, 21), new Among("\uFE86", -1, 21), new Among("\uFE87", -1, 18),
new Among("\uFE88", -1, 18), new Among("\uFE89", -1, 19), new Among("\uFE8A", -1, 19),
new Among("\uFE8B", -1, 19), new Among("\uFE8C", -1, 19), new Among("\uFE8D", -1, 22),
new Among("\uFE8E", -1, 22), new Among("\uFE8F", -1, 23), new Among("\uFE90", -1, 23),
new Among("\uFE91", -1, 23), new Among("\uFE92", -1, 23), new Among("\uFE93", -1, 24),
new Among("\uFE94", -1, 24), new Among("\uFE95", -1, 25), new Among("\uFE96", -1, 25),
new Among("\uFE97", -1, 25), new Among("\uFE98", -1, 25), new Among("\uFE99", -1, 26),
new Among("\uFE9A", -1, 26), new Among("\uFE9B", -1, 26), new Among("\uFE9C", -1, 26),
new Among("\uFE9D", -1, 27), new Among("\uFE9E", -1, 27), new Among("\uFE9F", -1, 27),
new Among("\uFEA0", -1, 27), new Among("\uFEA1", -1, 28), new Among("\uFEA2", -1, 28),
new Among("\uFEA3", -1, 28), new Among("\uFEA4", -1, 28), new Among("\uFEA5", -1, 29),
new Among("\uFEA6", -1, 29), new Among("\uFEA7", -1, 29), new Among("\uFEA8", -1, 29),
new Among("\uFEA9", -1, 30), new Among("\uFEAA", -1, 30), new Among("\uFEAB", -1, 31),
new Among("\uFEAC", -1, 31), new Among("\uFEAD", -1, 32), new Among("\uFEAE", -1, 32),
new Among("\uFEAF", -1, 33), new Among("\uFEB0", -1, 33), new Among("\uFEB1", -1, 34),
new Among("\uFEB2", -1, 34), new Among("\uFEB3", -1, 34), new Among("\uFEB4", -1, 34),
new Among("\uFEB5", -1, 35), new Among("\uFEB6", -1, 35), new Among("\uFEB7", -1, 35),
new Among("\uFEB8", -1, 35), new Among("\uFEB9", -1, 36), new Among("\uFEBA", -1, 36),
new Among("\uFEBB", -1, 36), new Among("\uFEBC", -1, 36), new Among("\uFEBD", -1, 37),
new Among("\uFEBE", -1, 37), new Among("\uFEBF", -1, 37), new Among("\uFEC0", -1, 37),
new Among("\uFEC1", -1, 38), new Among("\uFEC2", -1, 38), new Among("\uFEC3", -1, 38),
new Among("\uFEC4", -1, 38), new Among("\uFEC5", -1, 39), new Among("\uFEC6", -1, 39),
new Among("\uFEC7", -1, 39), new Among("\uFEC8", -1, 39), new Among("\uFEC9", -1, 40),
new Among("\uFECA", -1, 40), new Among("\uFECB", -1, 40), new Among("\uFECC", -1, 40),
new Among("\uFECD", -1, 41), new Among("\uFECE", -1, 41), new Among("\uFECF", -1, 41),
new Among("\uFED0", -1, 41), new Among("\uFED1", -1, 42), new Among("\uFED2", -1, 42),
new Among("\uFED3", -1, 42), new Among("\uFED4", -1, 42), new Among("\uFED5", -1, 43),
new Among("\uFED6", -1, 43), new Among("\uFED7", -1, 43), new Among("\uFED8", -1, 43),
new Among("\uFED9", -1, 44), new Among("\uFEDA", -1, 44), new Among("\uFEDB", -1, 44),
new Among("\uFEDC", -1, 44), new Among("\uFEDD", -1, 45), new Among("\uFEDE", -1, 45),
new Among("\uFEDF", -1, 45), new Among("\uFEE0", -1, 45), new Among("\uFEE1", -1, 46),
new Among("\uFEE2", -1, 46), new Among("\uFEE3", -1, 46), new Among("\uFEE4", -1, 46),
new Among("\uFEE5", -1, 47), new Among("\uFEE6", -1, 47), new Among("\uFEE7", -1, 47),
new Among("\uFEE8", -1, 47), new Among("\uFEE9", -1, 48), new Among("\uFEEA", -1, 48),
new Among("\uFEEB", -1, 48), new Among("\uFEEC", -1, 48), new Among("\uFEED", -1, 49),
new Among("\uFEEE", -1, 49), new Among("\uFEEF", -1, 50), new Among("\uFEF0", -1, 50),
new Among("\uFEF1", -1, 51), new Among("\uFEF2", -1, 51), new Among("\uFEF3", -1, 51),
new Among("\uFEF4", -1, 51), new Among("\uFEF5", -1, 55), new Among("\uFEF6", -1, 55),
new Among("\uFEF7", -1, 53), new Among("\uFEF8", -1, 53), new Among("\uFEF9", -1, 54),
new Among("\uFEFA", -1, 54), new Among("\uFEFB", -1, 52), new Among("\uFEFC", -1, 52) };
private final static Among a_1[] = { new Among("\u0622", -1, 1), new Among("\u0623", -1, 1),
new Among("\u0624", -1, 2), new Among("\u0625", -1, 1), new Among("\u0626", -1, 3) };
private final static Among a_2[] = { new Among("\u0622", -1, 1), new Among("\u0623", -1, 1),
new Among("\u0624", -1, 2), new Among("\u0625", -1, 1), new Among("\u0626", -1, 3) };
private final static Among a_3[] = { new Among("\u0627\u0644", -1, 2), new Among("\u0628\u0627\u0644", -1, 1),
new Among("\u0643\u0627\u0644", -1, 1), new Among("\u0644\u0644", -1, 2) };
private final static Among a_4[] = { new Among("\u0623\u0622", -1, 2), new Among("\u0623\u0623", -1, 1),
new Among("\u0623\u0624", -1, 3), new Among("\u0623\u0625", -1, 5), new Among("\u0623\u0627", -1, 4) };
private final static Among a_5[] = { new Among("\u0641", -1, 1), new Among("\u0648", -1, 2) };
private final static Among a_6[] = { new Among("\u0627\u0644", -1, 2), new Among("\u0628\u0627\u0644", -1, 1),
new Among("\u0643\u0627\u0644", -1, 1), new Among("\u0644\u0644", -1, 2) };
private final static Among a_7[] = { new Among("\u0628", -1, 1), new Among("\u0628\u0628", 0, 2),
new Among("\u0643\u0643", -1, 3) };
private final static Among a_8[] = { new Among("\u0633\u0623", -1, 4), new Among("\u0633\u062A", -1, 2),
new Among("\u0633\u0646", -1, 3), new Among("\u0633\u064A", -1, 1) };
private final static Among a_9[] = { new Among("\u062A\u0633\u062A", -1, 1), new Among("\u0646\u0633\u062A", -1, 1),
new Among("\u064A\u0633\u062A", -1, 1) };
private final static Among a_10[] = { new Among("\u0643\u0645\u0627", -1, 3),
new Among("\u0647\u0645\u0627", -1, 3), new Among("\u0646\u0627", -1, 2), new Among("\u0647\u0627", -1, 2),
new Among("\u0643", -1, 1), new Among("\u0643\u0645", -1, 2), new Among("\u0647\u0645", -1, 2),
new Among("\u0647\u0646", -1, 2), new Among("\u0647", -1, 1), new Among("\u064A", -1, 1) };
private final static Among a_11[] = { new Among("\u0646", -1, 1) };
private final static Among a_12[] = { new Among("\u0627", -1, 1), new Among("\u0648", -1, 1),
new Among("\u064A", -1, 1) };
private final static Among a_13[] = { new Among("\u0627\u062A", -1, 1) };
private final static Among a_14[] = { new Among("\u062A", -1, 1) };
private final static Among a_15[] = { new Among("\u0629", -1, 1) };
private final static Among a_16[] = { new Among("\u064A", -1, 1) };
private final static Among a_17[] = { new Among("\u0643\u0645\u0627", -1, 3),
new Among("\u0647\u0645\u0627", -1, 3), new Among("\u0646\u0627", -1, 2), new Among("\u0647\u0627", -1, 2),
new Among("\u0643", -1, 1), new Among("\u0643\u0645", -1, 2), new Among("\u0647\u0645", -1, 2),
new Among("\u0643\u0646", -1, 2), new Among("\u0647\u0646", -1, 2), new Among("\u0647", -1, 1),
new Among("\u0643\u0645\u0648", -1, 3), new Among("\u0646\u064A", -1, 2) };
private final static Among a_18[] = { new Among("\u0627", -1, 2), new Among("\u062A\u0627", 0, 3),
new Among("\u062A\u0645\u0627", 0, 5), new Among("\u0646\u0627", 0, 3), new Among("\u062A", -1, 1),
new Among("\u0646", -1, 2), new Among("\u0627\u0646", 5, 4), new Among("\u062A\u0646", 5, 3),
new Among("\u0648\u0646", 5, 4), new Among("\u064A\u0646", 5, 4), new Among("\u064A", -1, 2) };
private final static Among a_19[] = { new Among("\u0648\u0627", -1, 1), new Among("\u062A\u0645", -1, 1) };
private final static Among a_20[] = { new Among("\u0648", -1, 1), new Among("\u062A\u0645\u0648", 0, 2) };
private final static Among a_21[] = { new Among("\u0649", -1, 1) };
private boolean B_is_defined;
private boolean B_is_verb;
private boolean B_is_noun;
private int I_word_len;
private boolean r_Normalize_pre() {
int among_var;
int v_1;
int v_2;
// (, line 258
// loop, line 259
for (v_1 = (current.length()); v_1 > 0; v_1--) {
// (, line 259
// or, line 328
lab0: do {
v_2 = cursor;
lab1: do {
// (, line 260
// [, line 261
bra = cursor;
// substring, line 261
among_var = find_among(a_0);
if (among_var == 0) {
break lab1;
}
// ], line 261
ket = cursor;
switch (among_var) {
case 0:
break lab1;
case 1:
// (, line 262
// delete, line 262
slice_del();
break;
case 2:
// (, line 263
// delete, line 263
slice_del();
break;
case 3:
// (, line 266
// delete, line 266
slice_del();
break;
case 4:
// (, line 267
// delete, line 267
slice_del();
break;
case 5:
// (, line 270
// <-, line 270
slice_from("0");
break;
case 6:
// (, line 271
// <-, line 271
slice_from("1");
break;
case 7:
// (, line 272
// <-, line 272
slice_from("2");
break;
case 8:
// (, line 273
// <-, line 273
slice_from("3");
break;
case 9:
// (, line 274
// <-, line 274
slice_from("4");
break;
case 10:
// (, line 275
// <-, line 275
slice_from("5");
break;
case 11:
// (, line 276
// <-, line 276
slice_from("6");
break;
case 12:
// (, line 277
// <-, line 277
slice_from("7");
break;
case 13:
// (, line 278
// <-, line 278
slice_from("8");
break;
case 14:
// (, line 279
// <-, line 279
slice_from("9");
break;
case 15:
// (, line 280
// delete, line 280
slice_del();
break;
case 16:
// (, line 283
// <-, line 283
slice_from("\u0621");
break;
case 17:
// (, line 284
// <-, line 284
slice_from("\u0623");
break;
case 18:
// (, line 285
// <-, line 285
slice_from("\u0625");
break;
case 19:
// (, line 286
// <-, line 286
slice_from("\u0626");
break;
case 20:
// (, line 287
// <-, line 287
slice_from("\u0622");
break;
case 21:
// (, line 288
// <-, line 288
slice_from("\u0624");
break;
case 22:
// (, line 289
// <-, line 289
slice_from("\u0627");
break;
case 23:
// (, line 290
// <-, line 290
slice_from("\u0628");
break;
case 24:
// (, line 291
// <-, line 291
slice_from("\u0629");
break;
case 25:
// (, line 292
// <-, line 292
slice_from("\u062A");
break;
case 26:
// (, line 293
// <-, line 293
slice_from("\u062B");
break;
case 27:
// (, line 294
// <-, line 294
slice_from("\u062C");
break;
case 28:
// (, line 295
// <-, line 295
slice_from("\u062D");
break;
case 29:
// (, line 296
// <-, line 296
slice_from("\u062E");
break;
case 30:
// (, line 297
// <-, line 297
slice_from("\u062F");
break;
case 31:
// (, line 298
// <-, line 298
slice_from("\u0630");
break;
case 32:
// (, line 299
// <-, line 299
slice_from("\u0631");
break;
case 33:
// (, line 300
// <-, line 300
slice_from("\u0632");
break;
case 34:
// (, line 301
// <-, line 301
slice_from("\u0633");
break;
case 35:
// (, line 302
// <-, line 302
slice_from("\u0634");
break;
case 36:
// (, line 303
// <-, line 303
slice_from("\u0635");
break;
case 37:
// (, line 304
// <-, line 304
slice_from("\u0636");
break;
case 38:
// (, line 305
// <-, line 305
slice_from("\u0637");
break;
case 39:
// (, line 306
// <-, line 306
slice_from("\u0638");
break;
case 40:
// (, line 307
// <-, line 307
slice_from("\u0639");
break;
case 41:
// (, line 308
// <-, line 308
slice_from("\u063A");
break;
case 42:
// (, line 309
// <-, line 309
slice_from("\u0641");
break;
case 43:
// (, line 310
// <-, line 310
slice_from("\u0642");
break;
case 44:
// (, line 311
// <-, line 311
slice_from("\u0643");
break;
case 45:
// (, line 312
// <-, line 312
slice_from("\u0644");
break;
case 46:
// (, line 313
// <-, line 313
slice_from("\u0645");
break;
case 47:
// (, line 314
// <-, line 314
slice_from("\u0646");
break;
case 48:
// (, line 315
// <-, line 315
slice_from("\u0647");
break;
case 49:
// (, line 316
// <-, line 316
slice_from("\u0648");
break;
case 50:
// (, line 317
// <-, line 317
slice_from("\u0649");
break;
case 51:
// (, line 318
// <-, line 318
slice_from("\u064A");
break;
case 52:
// (, line 321
// <-, line 321
slice_from("\u0644\u0627");
break;
case 53:
// (, line 322
// <-, line 322
slice_from("\u0644\u0623");
break;
case 54:
// (, line 323
// <-, line 323
slice_from("\u0644\u0625");
break;
case 55:
// (, line 324
// <-, line 324
slice_from("\u0644\u0622");
break;
}
break lab0;
} while (false);
cursor = v_2;
// next, line 329
if (cursor >= limit) {
return false;
}
cursor++;
} while (false);
}
return true;
}
private boolean r_Normalize_post() {
int among_var;
int v_1;
int v_2;
int v_3;
int v_4;
// (, line 333
// do, line 335
v_1 = cursor;
lab0: do {
// (, line 335
// backwards, line 337
limit_backward = cursor;
cursor = limit;
// (, line 337
// [, line 338
ket = cursor;
// substring, line 338
among_var = find_among_b(a_1);
if (among_var == 0) {
break lab0;
}
// ], line 338
bra = cursor;
switch (among_var) {
case 0:
break lab0;
case 1:
// (, line 339
// <-, line 339
slice_from("\u0621");
break;
case 2:
// (, line 340
// <-, line 340
slice_from("\u0621");
break;
case 3:
// (, line 341
// <-, line 341
slice_from("\u0621");
break;
}
cursor = limit_backward;
} while (false);
cursor = v_1;
// do, line 346
v_2 = cursor;
lab1: do {
// loop, line 346
for (v_3 = I_word_len; v_3 > 0; v_3--) {
// (, line 346
// or, line 355
lab2: do {
v_4 = cursor;
lab3: do {
// (, line 347
// [, line 349
bra = cursor;
// substring, line 349
among_var = find_among(a_2);
if (among_var == 0) {
break lab3;
}
// ], line 349
ket = cursor;
switch (among_var) {
case 0:
break lab3;
case 1:
// (, line 350
// <-, line 350
slice_from("\u0627");
break;
case 2:
// (, line 351
// <-, line 351
slice_from("\u0648");
break;
case 3:
// (, line 352
// <-, line 352
slice_from("\u064A");
break;
}
break lab2;
} while (false);
cursor = v_4;
// next, line 356
if (cursor >= limit) {
break lab1;
}
cursor++;
} while (false);
}
} while (false);
cursor = v_2;
return true;
}
private boolean r_Checks1() {
int among_var;
// (, line 361
I_word_len = (current.length());
// [, line 363
bra = cursor;
// substring, line 363
among_var = find_among(a_3);
if (among_var == 0) {
return false;
}
// ], line 363
ket = cursor;
switch (among_var) {
case 0:
return false;
case 1:
// (, line 364
if (!(I_word_len > 4)) {
return false;
}
// set is_noun, line 364
B_is_noun = true;
// unset is_verb, line 364
B_is_verb = false;
// set is_defined, line 364
B_is_defined = true;
break;
case 2:
// (, line 365
if (!(I_word_len > 3)) {
return false;
}
// set is_noun, line 365
B_is_noun = true;
// unset is_verb, line 365
B_is_verb = false;
// set is_defined, line 365
B_is_defined = true;
break;
}
return true;
}
private boolean r_Prefix_Step1() {
int among_var;
// (, line 371
I_word_len = (current.length());
// [, line 373
bra = cursor;
// substring, line 373
among_var = find_among(a_4);
if (among_var == 0) {
return false;
}
// ], line 373
ket = cursor;
switch (among_var) {
case 0:
return false;
case 1:
// (, line 374
if (!(I_word_len > 3)) {
return false;
}
// <-, line 374
slice_from("\u0623");
break;
case 2:
// (, line 375
if (!(I_word_len > 3)) {
return false;