-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.v
More file actions
1779 lines (1701 loc) · 35.5 KB
/
Copy pathmain.v
File metadata and controls
1779 lines (1701 loc) · 35.5 KB
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
module vouconv
pub enum EncodingStyle {
circled
circled_neg
fullwidth
math_bold
math_bold_fraktur
math_bold_italic
math_bold_script
math_double_struck
math_monospace
math_sans
math_sans_bold
math_sans_bold_italic
math_sans_italic
parenthesized
regional_indicator
squared
squared_neg
a_cute
cjk_thai
curvy1
curvy2
curvy3
faux_cyrillic
faux_ethiopic
math_fraktur
rock_dots
small_caps
stroked
subscript
superscript
inverted
inverted_backward
reversed
reversed_backward
}
pub fn convert_to_exotic(s string, style EncodingStyle) string {
match style {
.circled { return convert_to_circled(s) }
.circled_neg { return convert_to_circled_neg(s) }
.fullwidth { return convert_to_fullwidth(s) }
.math_bold { return convert_to_math_bold(s) }
.math_bold_fraktur { return convert_to_math_bold_fraktur(s) }
.math_bold_italic { return convert_to_math_bold_italic(s) }
.math_bold_script { return convert_to_math_bold_script(s) }
.math_double_struck { return convert_to_math_double_struck(s) }
.math_monospace { return convert_to_math_monospace(s) }
.math_sans { return convert_to_math_sans(s) }
.math_sans_bold { return convert_to_math_sans_bold(s) }
.math_sans_bold_italic { return convert_to_math_sans_bold_italic(s) }
.math_sans_italic { return convert_to_math_sans_italic(s) }
.parenthesized { return convert_to_parenthesized(s) }
.regional_indicator { return convert_to_regional_indicator(s) }
.squared { return convert_to_squared(s) }
.squared_neg { return convert_to_squared_neg(s) }
.a_cute { return convert_to_a_cute(s) }
.cjk_thai { return convert_to_cjk_thai(s) }
.curvy1 { return convert_to_curvy1(s) }
.curvy2 { return convert_to_curvy2(s) }
.curvy3 { return convert_to_curvy3(s) }
.faux_cyrillic { return convert_to_faux_cyrillic(s) }
.faux_ethiopic { return convert_to_faux_ethiopic(s) }
.math_fraktur { return convert_to_math_fraktur(s) }
.rock_dots { return convert_to_rock_dots(s) }
.small_caps { return convert_to_small_caps(s) }
.stroked { return convert_to_stroked(s) }
.subscript { return convert_to_subscript(s) }
.superscript { return convert_to_superscript(s) }
.inverted { return convert_to_inverted(s) }
.inverted_backward { return convert_to_inverted_backward(s) }
.reversed { return convert_to_reversed(s) }
.reversed_backward { return convert_to_reversed_backward(s) }
}
}
pub fn convert_to_circled(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {
// Convert uppercase letters to circled uppercase (Ⓐ-Ⓩ)
result += rune(0x24B6 + (c - `A`)).str()
} else if c >= `a` && c <= `z` {
// Convert lowercase letters to circled lowercase (ⓐ-ⓩ)
result += rune(0x24D0 + (c - `a`)).str()
} else if c >= `0` && c <= `9` {
if c == `0` {
// Circled zero is different
result += '0'
} else {
// Convert digits 1-9 to circled digits (①-⑨)
result += rune(0x2460 + (c - `1`)).str()
}
} else if c == ` ` {
// Preserve spaces as-is
result += ' '
} else {
// Keep other characters unchanged
result += c.str()
}
}
return result
}
pub fn convert_to_circled_neg(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {
// Convert uppercase letters to negative circled uppercase (🅐-🅩)
result += rune(0x1F150 + (c - `A`)).str()
} else if c >= `a` && c <= `z` {
// Convert lowercase letters to negative circled lowercase (using uppercase symbols)
result += rune(0x1F150 + (c - `a`)).str()
} else if c == `0` {
// Negative circled zero
result += '⓿'
} else if c >= `1` && c <= `9` {
// Keep digits 1-9 as regular characters
result += c.ascii_str()
} else if c == ` ` {
// Preserve spaces as-is
result += ' '
} else {
// Keep other characters unchanged
result += c.str()
}
}
return result
}
pub fn convert_to_fullwidth(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {
// Convert uppercase letters to fullwidth uppercase (A-Z)
result += rune(0xFF21 + (c - `A`)).str()
} else if c >= `a` && c <= `z` {
// Convert lowercase letters to fullwidth lowercase (a-z)
result += rune(0xFF41 + (c - `a`)).str()
} else if c >= `0` && c <= `9` {
// Convert digits to fullwidth digits (0-9)
result += rune(0xFF10 + (c - `0`)).str()
} else if c == ` ` {
// Preserve spaces as-is
result += ' '
} else {
// Keep other characters unchanged
result += c.str()
}
}
return result
}
pub fn convert_to_math_bold(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {
// Convert uppercase letters to math bold uppercase (𝐀-𝐙)
result += rune(0x1D400 + (c - `A`)).str()
} else if c >= `a` && c <= `z` {
// Convert lowercase letters to math bold lowercase (𝐚-𝐳)
result += rune(0x1D41A + (c - `a`)).str()
} else if c >= `0` && c <= `9` {
// Convert digits to math bold digits (𝟎-𝟗)
result += rune(0x1D7CE + (c - `0`)).str()
} else if c == ` ` {
// Preserve spaces as-is
result += ' '
} else {
// Keep other characters unchanged
result += c.str()
}
}
return result
}
pub fn convert_to_math_bold_fraktur(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {
// Convert uppercase letters to math bold fraktur uppercase (𝕬-𝖅)
result += rune(0x1D56C + (c - `A`)).str()
} else if c >= `a` && c <= `z` {
// Convert lowercase letters to math bold fraktur lowercase (𝖆-𝖟)
result += rune(0x1D586 + (c - `a`)).str()
} else if c >= `0` && c <= `9` {
// Keep digits as is (based on test)
result += c.ascii_str()
} else if c == ` ` {
// Preserve spaces as-is
result += ' '
} else {
// Keep other characters unchanged
result += c.str()
}
}
return result
}
pub fn convert_to_math_bold_italic(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {
// Convert uppercase letters to math bold italic uppercase (𝑨-𝒁)
result += rune(0x1D468 + (c - `A`)).str()
} else if c >= `a` && c <= `z` {
// Convert lowercase letters to math bold italic lowercase (𝒂-𝒛)
result += rune(0x1D482 + (c - `a`)).str()
} else if c >= `0` && c <= `9` {
// Keep digits as is (based on test)
result += c.ascii_str()
} else if c == ` ` {
// Preserve spaces as-is
result += ' '
} else {
// Keep other characters unchanged
result += c.str()
}
}
return result
}
pub fn convert_to_math_bold_script(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {
// Convert uppercase letters to math bold script uppercase (𝓐-𝓩)
result += rune(0x1D4D0 + (c - `A`)).str()
} else if c >= `a` && c <= `z` {
// Convert lowercase letters to math bold script lowercase (𝓪-𝔃)
result += rune(0x1D4EA + (c - `a`)).str()
} else if c >= `0` && c <= `9` {
// Keep digits as is (based on test)
result += c.ascii_str()
} else if c == ` ` {
// Preserve spaces as-is
result += ' '
} else {
// Keep other characters unchanged
result += c.str()
}
}
return result
}
pub fn convert_to_math_double_struck(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {
// Convert uppercase letters to math double-struck uppercase (𝔸-ℤ)
// Special cases for C, H, N, P, Q, R, Z which have different code points
match c {
`C` { result += 'ℂ' }
`H` { result += 'ℍ' }
`N` { result += 'ℕ' }
`P` { result += 'ℙ' }
`Q` { result += 'ℚ' }
`R` { result += 'ℝ' }
`Z` { result += 'ℤ' }
else { result += rune(0x1D538 + (c - `A`)).str() }
}
} else if c >= `a` && c <= `z` {
// Convert lowercase letters to math double-struck lowercase (𝕒-𝕫)
result += rune(0x1D552 + (c - `a`)).str()
} else if c >= `0` && c <= `9` {
// Convert digits to math double-struck digits (𝟘-𝟡)
result += rune(0x1D7D8 + (c - `0`)).str()
} else if c == ` ` {
// Preserve spaces as-is
result += ' '
} else {
// Keep other characters unchanged
result += c.str()
}
}
return result
}
pub fn convert_to_math_monospace(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {
// Convert uppercase letters to math monospace uppercase (𝙰-𝚉)
result += rune(0x1D670 + (c - `A`)).str()
} else if c >= `a` && c <= `z` {
// Convert lowercase letters to math monospace lowercase (𝚊-𝚣)
result += rune(0x1D68A + (c - `a`)).str()
} else if c >= `0` && c <= `9` {
// Convert digits to math monospace digits (𝟶-𝟿)
result += rune(0x1D7F6 + (c - `0`)).str()
} else if c == ` ` {
// Preserve spaces as-is
result += ' '
} else {
// Keep other characters unchanged
result += c.str()
}
}
return result
}
pub fn convert_to_math_sans(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {
// Convert uppercase letters to math sans uppercase (𝖠-𝖹)
result += rune(0x1D5A0 + (c - `A`)).str()
} else if c >= `a` && c <= `z` {
// Convert lowercase letters to math sans lowercase (𝖺-𝗓)
result += rune(0x1D5BA + (c - `a`)).str()
} else if c >= `0` && c <= `9` {
// Convert digits to math sans digits (𝟢-𝟫)
result += rune(0x1D7E2 + (c - `0`)).str()
} else if c == ` ` {
// Preserve spaces as-is
result += ' '
} else {
// Keep other characters unchanged
result += c.str()
}
}
return result
}
pub fn convert_to_math_sans_bold(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {
// Convert uppercase letters to math sans bold uppercase (𝗔-𝗭)
result += rune(0x1D5D4 + (c - `A`)).str()
} else if c >= `a` && c <= `z` {
// Convert lowercase letters to math sans bold lowercase (𝗮-𝘇)
result += rune(0x1D5EE + (c - `a`)).str()
} else if c >= `0` && c <= `9` {
// Convert digits to math sans bold digits (𝟬-𝟵)
result += rune(0x1D7EC + (c - `0`)).str()
} else if c == ` ` {
// Preserve spaces as-is
result += ' '
} else {
// Keep other characters unchanged
result += c.str()
}
}
return result
}
pub fn convert_to_math_sans_bold_italic(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {
// Convert uppercase letters to math sans bold italic uppercase (𝘼-𝙕)
result += rune(0x1D63C + (c - `A`)).str()
} else if c >= `a` && c <= `z` {
// Convert lowercase letters to math sans bold italic lowercase (𝙖-𝙯)
result += rune(0x1D656 + (c - `a`)).str()
} else if c >= `0` && c <= `9` {
// Keep digits as is (based on test)
result += c.ascii_str()
} else if c == ` ` {
// Preserve spaces as-is
result += ' '
} else {
// Keep other characters unchanged
result += c.str()
}
}
return result
}
pub fn convert_to_math_sans_italic(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {
// Convert uppercase letters to math sans italic uppercase (𝘈-𝘡)
result += rune(0x1D608 + (c - `A`)).str()
} else if c >= `a` && c <= `z` {
// Convert lowercase letters to math sans italic lowercase (𝘢-𝘻)
result += rune(0x1D622 + (c - `a`)).str()
} else if c >= `0` && c <= `9` {
// Keep digits as is (based on test)
result += c.ascii_str()
} else if c == ` ` {
// Preserve spaces as-is
result += ' '
} else {
// Keep other characters unchanged
result += c.str()
}
}
return result
}
pub fn convert_to_parenthesized(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {
// Uppercase letters - convert to lowercase parenthesized (⒜-⒵)
result += rune(0x249C + (c - `A`)).str()
} else if c >= `a` && c <= `z` {
// Lowercase letters to parenthesized (⒜-⒵)
result += rune(0x249C + (c - `a`)).str()
} else if c >= `0` && c <= `9` {
if c == `0` {
// Regular 0 for zero
result += '0'
} else {
// Parenthesized numbers 1-9 (⑴-⑼)
result += rune(0x2474 + (c - `1`)).str()
}
} else if c == ` ` {
// Preserve spaces as-is
result += ' '
} else {
// Keep other characters unchanged
result += c.str()
}
}
return result
}
pub fn convert_to_regional_indicator(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {
// Uppercase letters to regional indicators (🇦-🇿)
result += rune(0x1F1E6 + (c - `A`)).str()
} else if c >= `a` && c <= `z` {
// Lowercase letters also to regional indicators (same as uppercase)
result += rune(0x1F1E6 + (c - `a`)).str()
} else if c >= `0` && c <= `9` {
// Keep digits as is
result += c.ascii_str()
} else if c == ` ` {
// Preserve spaces as-is
result += ' '
} else {
// Keep other characters unchanged
result += c.str()
}
}
return result
}
pub fn convert_to_squared(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {
// Uppercase letters to squared (🄰-🅉)
result += rune(0x1F130 + (c - `A`)).str()
} else if c >= `a` && c <= `z` {
// Lowercase letters to squared (same as uppercase)
result += rune(0x1F130 + (c - `a`)).str()
} else if c >= `0` && c <= `9` {
// Keep digits as is
result += c.ascii_str()
} else if c == ` ` {
// Preserve spaces as-is
result += ' '
} else {
// Keep other characters unchanged
result += c.str()
}
}
return result
}
pub fn convert_to_squared_neg(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {
// Uppercase letters to negative squared (🅰-🆉)
result += rune(0x1F170 + (c - `A`)).str()
} else if c >= `a` && c <= `z` {
// Lowercase letters to negative squared (same as uppercase)
result += rune(0x1F170 + (c - `a`)).str()
} else if c >= `0` && c <= `9` {
// Keep digits as is
result += c.ascii_str()
} else if c == ` ` {
// Preserve spaces as-is
result += ' '
} else {
// Keep other characters unchanged
result += c.str()
}
}
return result
}
pub fn convert_to_a_cute(s string) string {
// Updated mapping based on the test assertion
mappings := {
`A`: 'Á'
`B`: 'B'
`C`: 'Ć'
`D`: 'D'
`E`: 'É'
`F`: 'F'
`G`: 'Ǵ'
`H`: 'H'
`I`: 'í'
`J`: 'J'
`K`: 'Ḱ'
`L`: 'Ĺ'
`M`: 'Ḿ'
`N`: 'Ń'
`O`: 'Ő'
`P`: 'Ṕ'
`Q`: 'Q'
`R`: 'Ŕ'
`S`: 'ś'
`T`: 'T'
`U`: 'Ű'
`V`: 'V'
`W`: 'Ẃ'
`X`: 'X'
`Y`: 'Ӳ'
`Z`: 'Ź'
`a`: 'á'
`b`: 'b'
`c`: 'ć'
`d`: 'd'
`e`: 'é'
`f`: 'f'
`g`: 'ǵ'
`h`: 'h'
`i`: 'í'
`j`: 'j'
`k`: 'ḱ'
`l`: 'ĺ'
`m`: 'ḿ'
`n`: 'ń'
`o`: 'ő'
`p`: 'ṕ'
`q`: 'q'
`r`: 'ŕ'
`s`: 'ś'
`t`: 't'
`u`: 'ú'
`v`: 'v'
`w`: 'ẃ'
`x`: 'x'
`y`: 'ӳ'
`z`: 'ź'
}
mut result := ''
for c in s {
if c in mappings {
result += mappings[c]
} else {
// Keep digits and other chars as is
result += c.ascii_str()
}
}
return result
}
pub fn convert_to_cjk_thai(s string) string {
// Based on the test, this maps to a mix of CJK and Thai characters
mappings := {
`A`: 'ム'
`B`: '乃'
`C`: 'c'
`D`: 'd'
`E`: '乇'
`F`: 'キ'
`G`: 'g'
`H`: 'ん'
`I`: 'ノ'
`J`: 'フ'
`K`: 'ズ'
`L`: 'レ'
`M`: 'ᄊ'
`N`: '刀'
`O`: 'o'
`P`: 'ア'
`Q`: 'q'
`R`: '尺'
`S`: '丂'
`T`: 'イ'
`U`: 'u'
`V`: '√'
`W`: 'w'
`X`: 'メ'
`Y`: 'リ'
`Z`: '乙'
`a`: 'ム'
`b`: '乃'
`c`: 'c'
`d`: 'd'
`e`: '乇'
`f`: 'キ'
`g`: 'g'
`h`: 'ん'
`i`: 'ノ'
`j`: 'フ'
`k`: 'ズ'
`l`: 'レ'
`m`: 'ᄊ'
`n`: '刀'
`o`: 'o'
`p`: 'ア'
`q`: 'q'
`r`: '尺'
`s`: '丂'
`t`: 'イ'
`u`: 'u'
`v`: '√'
`w`: 'w'
`x`: 'メ'
`y`: 'リ'
`z`: '乙'
}
mut result := ''
for c in s {
if c in mappings {
result += mappings[c]
} else {
// Keep digits and other chars as is
result += c.ascii_str()
}
}
return result
}
pub fn convert_to_curvy1(s string) string {
// First curvy style based on test
mappings := {
`A`: 'ค'
`B`: '๒'
`C`: 'ƈ'
`D`: 'ɗ'
`E`: 'ﻉ'
`F`: 'ि'
`G`: 'ﻭ'
`H`: 'ɦ'
`I`: 'ٱ'
`J`: 'ﻝ'
`K`: 'ᛕ'
`L`: 'ɭ'
`M`: '๓'
`N`: 'ก'
`O`: 'ѻ'
`P`: 'ρ'
`Q`: '۹'
`R`: 'ɼ'
`S`: 'ร'
`T`: 'Շ'
`U`: 'પ'
`V`: '۷'
`W`: 'ฝ'
`X`: 'ซ'
`Y`: 'ץ'
`Z`: 'չ'
`a`: 'ค'
`b`: '๒'
`c`: 'ƈ'
`d`: 'ɗ'
`e`: 'ﻉ'
`f`: 'ि'
`g`: 'ﻭ'
`h`: 'ɦ'
`i`: 'ٱ'
`j`: 'ﻝ'
`k`: 'ᛕ'
`l`: 'ɭ'
`m`: '๓'
`n`: 'ก'
`o`: 'ѻ'
`p`: 'ρ'
`q`: '۹'
`r`: 'ɼ'
`s`: 'ร'
`t`: 'Շ'
`u`: 'પ'
`v`: '۷'
`w`: 'ฝ'
`x`: 'ซ'
`y`: 'ץ'
`z`: 'չ'
}
mut result := ''
for c in s {
if c in mappings {
result += mappings[c]
} else {
// Keep digits and other chars as is
result += c.ascii_str()
}
}
return result
}
pub fn convert_to_curvy2(s string) string {
// Second curvy style based on test
mappings := {
`A`: 'α'
`B`: 'в'
`C`: '¢'
`D`: '∂'
`E`: 'є'
`F`: 'ƒ'
`G`: 'ﻭ'
`H`: 'н'
`I`: 'ι'
`J`: 'נ'
`K`: 'к'
`L`: 'ℓ'
`M`: 'м'
`N`: 'η'
`O`: 'σ'
`P`: 'ρ'
`Q`: '۹'
`R`: 'я'
`S`: 'ѕ'
`T`: 'т'
`U`: 'υ'
`V`: 'ν'
`W`: 'ω'
`X`: 'χ'
`Y`: 'у'
`Z`: 'չ'
`a`: 'α'
`b`: 'в'
`c`: '¢'
`d`: '∂'
`e`: 'є'
`f`: 'ƒ'
`g`: 'ﻭ'
`h`: 'н'
`i`: 'ι'
`j`: 'נ'
`k`: 'к'
`l`: 'ℓ'
`m`: 'м'
`n`: 'η'
`o`: 'σ'
`p`: 'ρ'
`q`: '۹'
`r`: 'я'
`s`: 'ѕ'
`t`: 'т'
`u`: 'υ'
`v`: 'ν'
`w`: 'ω'
`x`: 'χ'
`y`: 'у'
`z`: 'չ'
}
mut result := ''
for c in s {
if c in mappings {
result += mappings[c]
} else {
// Keep digits and other chars as is
result += c.ascii_str()
}
}
return result
}
pub fn convert_to_curvy3(s string) string {
// Updated mapping based on the test assertion
mappings := {
`A`: 'ค'
`B`: '๒'
`C`: 'ς'
`D`: '๔'
`E`: 'є'
`F`: 'Ŧ'
`G`: 'ﻮ'
`H`: 'ђ'
`I`: 'เ'
`J`: 'ן'
`K`: 'к'
`L`: 'ɭ'
`M`: '๓'
`N`: 'ภ'
`O`: '๏'
`P`: 'ק'
`Q`: 'ợ'
`R`: 'г'
`S`: 'ร'
`T`: 'Շ'
`U`: 'ย'
`V`: 'ש'
`W`: 'ฬ'
`X`: 'א'
`Y`: 'ץ'
`Z`: 'չ'
`a`: 'ค'
`b`: '๒'
`c`: 'ς'
`d`: '๔'
`e`: 'є'
`f`: 'Ŧ'
`g`: 'ﻮ'
`h`: 'ђ'
`i`: 'เ'
`j`: 'ן'
`k`: 'к'
`l`: 'ɭ'
`m`: '๓'
`n`: 'ภ'
`o`: '๏'
`p`: 'ק'
`q`: 'ợ'
`r`: 'г'
`s`: 'ร'
`t`: 'Շ'
`u`: 'ย'
`v`: 'ש'
`w`: 'ฬ'
`x`: 'א'
`y`: 'ץ'
`z`: 'չ'
}
mut result := ''
for c in s {
if c in mappings {
result += mappings[c]
} else {
// Keep digits and other chars as is
result += c.ascii_str()
}
}
return result
}
pub fn convert_to_faux_cyrillic(s string) string {
// Updated mapping based on the test assertion
mappings := {
`A`: 'Д'
`B`: 'Б'
`C`: 'Ҁ'
`D`: 'ↁ'
`E`: 'Є'
`F`: 'F'
`G`: 'Б'
`H`: 'Н'
`I`: 'І'
`J`: 'Ј'
`K`: 'Ќ'
`L`: 'L'
`M`: 'М'
`N`: 'И'
`O`: 'Ф'
`P`: 'Р'
`Q`: 'Q'
`R`: 'Я'
`S`: 'Ѕ'
`T`: 'Г'
`U`: 'Ц'
`V`: 'V'
`W`: 'Щ'
`X`: 'Ж'
`Y`: 'Ч'
`Z`: 'Z'
`a`: 'а'
`b`: 'ъ'
`c`: 'с'
`d`: 'ↁ'
`e`: 'э'
`f`: 'f'
`g`: 'Б'
`h`: 'Ђ'
`i`: 'і'
`j`: 'ј'
`k`: 'к'
`l`: 'l'
`m`: 'м'
`n`: 'и'
`o`: 'о'
`p`: 'р'
`q`: 'q'
`r`: 'ѓ'
`s`: 'ѕ'
`t`: 'т'
`u`: 'ц'
`v`: 'v'
`w`: 'ш'
`x`: 'х'
`y`: 'Ў'
`z`: 'z'
}
mut result := ''
for c in s {
if c in mappings {
result += mappings[c]
} else {
result += c.ascii_str()
}
}
return result
}
pub fn convert_to_faux_ethiopic(s string) string {
// Updated mapping based on the test assertion
mappings := {
`A`: 'ል'
`B`: 'ጌ'
`C`: 'ር'
`D`: 'ዕ'
`E`: 'ቿ'
`F`: 'ቻ'
`G`: 'ኗ'
`H`: 'ዘ'
`I`: 'ጎ'
`J`: 'ጋ'
`K`: 'ጕ'
`L`: 'ረ'
`M`: 'ጠ'
`N`: 'ክ'
`O`: 'ዐ'
`P`: 'የ'
`Q`: 'ዒ'
`R`: 'ዪ'
`S`: 'ነ'
`T`: 'ፕ'
`U`: 'ሁ'
`V`: 'ሀ'
`W`: 'ሠ'
`X`: 'ሸ'
`Y`: 'ሃ'
`Z`: 'ጊ'
`a`: 'ል'
`b`: 'ጌ'
`c`: 'ር'
`d`: 'ዕ'
`e`: 'ቿ'
`f`: 'ቻ'
`g`: 'ኗ'
`h`: 'ዘ'
`i`: 'ጎ'
`j`: 'ጋ'
`k`: 'ጕ'
`l`: 'ረ'
`m`: 'ጠ'
`n`: 'ክ'
`o`: 'ዐ'
`p`: 'የ'
`q`: 'ዒ'
`r`: 'ዪ'
`s`: 'ነ'
`t`: 'ፕ'
`u`: 'ሁ'
`v`: 'ሀ'
`w`: 'ሠ'
`x`: 'ሸ'
`y`: 'ሃ'
`z`: 'ጊ'
}
mut result := ''
for c in s {
if c in mappings {
result += mappings[c]
} else {
result += c.ascii_str()
}
}
return result
}
pub fn convert_to_math_fraktur(s string) string {
mut result := ''
for c in s {
if c >= `A` && c <= `Z` {