-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1912 lines (1867 loc) · 97.7 KB
/
Copy pathindex.html
File metadata and controls
1912 lines (1867 loc) · 97.7 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<meta name="theme-color" content="#8e4b34">
<title>Brahui Dictionary</title>
<style>
/* ============================================================
MATERIAL 3 — Android dictionary shell
Terracotta tonal palette, light + dark, no external assets.
============================================================ */
:root{
--p:#8e4b34; --op:#ffffff; --pc:#ffdbcf; --opc:#380d00;
--s:#77574c; --os:#ffffff; --sc:#ffdbcf; --osc:#2c150e;
--t:#6c5d2f; --tc:#f6e2a7; --otc:#221b00;
--err:#ba1a1a; --pe:#ffdad6;
--bg:#fff8f6; --obg:#231917;
--surf:#fff8f6; --osurf:#231917;
--sv:#f5ded7; --osv:#53433f;
--sc1:#fdf1ed; --sc2:#f9eae5; --sc3:#f4e4de; --sc4:#f2e0da; --sc5:#efdad3;
--outline:#85736e; --outv:#d8c2bc;
--shadow:rgba(60,30,20,.28);
--nast:"Noto Nastaliq Urdu","Jameel Noori Nastaleeq","Noto Naskh Arabic","Urdu Typesetting",serif;
--sans:Roboto,"Helvetica Neue","Segoe UI",system-ui,-apple-system,sans-serif;
--mono:"Roboto Mono",ui-monospace,"SF Mono",Menlo,monospace;
--r-xs:4px; --r-s:8px; --r-m:12px; --r-l:16px; --r-xl:28px;
}
@media (prefers-color-scheme:dark){
:root{
--p:#ffb59d; --op:#552007; --pc:#723519; --opc:#ffdbcf;
--s:#e7bfb0; --os:#442a20; --sc:#5d4036; --osc:#ffdbcf;
--t:#d9c68d; --tc:#534619; --otc:#f6e2a7;
--err:#ffb4ab; --pe:#93000a;
--bg:#1a120f; --obg:#f1dfda;
--surf:#1a120f; --osurf:#f1dfda;
--sv:#53433f; --osv:#d8c2bc;
--sc1:#221714; --sc2:#271d19; --sc3:#322723; --sc4:#3d2f2a; --sc5:#48382f;
--outline:#a08d87; --outv:#53433f;
--shadow:rgba(0,0,0,.6);
}
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{
margin:0;background:#2a201d;color:var(--obg);
font-family:var(--sans);font-size:14px;line-height:1.45;
display:flex;align-items:center;justify-content:center;
}
/* --- phone frame: real app on mobile, framed device on desktop --- */
.phone{
position:relative;display:flex;flex-direction:column;
width:100%;height:100%;max-width:100%;background:var(--bg);overflow:hidden;
}
main,.view{max-width:100%;overflow-x:hidden}
/* tablet / small laptop: keep the phone, framed as a device */
@media (min-width:760px) and (max-width:1099px){
body{padding:24px}
.phone{
width:412px;height:min(880px,calc(100vh - 48px));
border-radius:36px;box-shadow:0 0 0 10px #12100f,0 24px 60px rgba(0,0,0,.55);
}
.statusbar{padding:12px 26px 2px} /* clear of the rounded corners */
.nav{padding-bottom:18px}
}
}
/* --- status bar --- */
.statusbar{
flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;
padding:8px 18px 2px;font-size:12px;font-weight:600;color:var(--osurf);
background:var(--sc2);letter-spacing:.02em;
}
.statusbar .icons{display:flex;gap:5px;align-items:center;opacity:.9}
/* --- app bar --- */
.appbar{flex:0 0 auto;background:var(--sc2);padding:4px 4px 10px}
.appbar-row{display:flex;align-items:center;gap:4px;min-height:48px;padding:0 4px}
.appbar h1{
font-size:20px;font-weight:500;margin:0;flex:1;letter-spacing:.01em;color:var(--osurf);
}
.appbar h1 small{display:block;font-size:11px;color:var(--osv);font-weight:400;letter-spacing:.06em;text-transform:uppercase}
.applogo{
width:36px;height:36px;border-radius:50%;background:var(--p);color:var(--op);
display:grid;place-items:center;font-family:var(--nast);font-size:19px;flex:0 0 auto;margin:0 6px 0 8px;
padding-bottom:4px;
}
.iconbtn{
width:40px;height:40px;border-radius:50%;border:0;background:transparent;color:var(--osurf);
display:grid;place-items:center;cursor:pointer;flex:0 0 auto;position:relative;overflow:hidden;
}
.iconbtn:hover{background:color-mix(in srgb,var(--osurf) 8%,transparent)}
.iconbtn svg{width:22px;height:22px;fill:currentColor}
/* --- search --- */
.searchbar{
display:flex;align-items:center;gap:8px;margin:2px 8px 0;padding:0 6px 0 14px;
height:48px;border-radius:var(--r-xl);background:var(--sc4);color:var(--osurf);
}
.searchbar svg{width:20px;height:20px;fill:var(--osv);flex:0 0 auto}
.searchbar input{
flex:1;border:0;background:transparent;color:inherit;font:inherit;font-size:15px;outline:0;min-width:0;
}
.searchbar input::placeholder{color:var(--osv)}
/* --- chips --- */
.chiprow{display:flex;gap:8px;overflow-x:auto;padding:10px 12px 2px;scrollbar-width:none}
.chiprow::-webkit-scrollbar{display:none}
.chip{
flex:0 0 auto;border:1px solid var(--outv);background:transparent;color:var(--osurf);
border-radius:var(--r-s);padding:6px 12px;font:inherit;font-size:12.5px;font-weight:500;
cursor:pointer;display:flex;align-items:center;gap:6px;white-space:nowrap;
}
.chip[aria-pressed="true"]{background:var(--sc);color:var(--osc);border-color:transparent}
.chip svg{width:16px;height:16px;fill:currentColor}
.chip .n{opacity:.65;font-weight:400}
/* --- content --- */
main{flex:1;overflow-y:auto;overscroll-behavior:contain;background:var(--bg);position:relative}
main::-webkit-scrollbar{width:6px}
main::-webkit-scrollbar-thumb{background:var(--outv);border-radius:3px}
.view{display:none;padding-bottom:110px}
.view.on{display:block}
.section-h{
font-size:11px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;
color:var(--p);padding:18px 20px 6px;
}
.hint{padding:2px 20px 10px;font-size:12.5px;color:var(--osv);line-height:1.5}
.hint b{color:var(--osurf)}
.divider{height:1px;background:var(--outv);margin:6px 20px;opacity:.6}
/* --- list --- */
.li{
display:flex;align-items:center;gap:14px;padding:11px 16px;cursor:pointer;
position:relative;overflow:hidden;border:0;background:transparent;width:100%;text-align:left;
color:var(--osurf);font:inherit;
}
.li:active{background:var(--sc3)}
.li:hover{background:var(--sc2)}
.avatar{
width:42px;height:42px;border-radius:50%;background:var(--pc);color:var(--opc);
display:grid;place-items:center;flex:0 0 auto;font-family:var(--nast);font-size:20px;padding-bottom:6px;
}
.avatar.alt{background:var(--tc);color:var(--otc)}
.li .body{flex:1;min-width:0}
.li .ur{display:block;font-family:var(--nast);font-size:21px;line-height:1.85;direction:rtl;
unicode-bidi:isolate;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.li .en{display:block;font-size:13.5px;color:var(--osurf);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.li .lat{display:block;font-size:12px;color:var(--osv);font-family:var(--mono);
white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.li .tail{flex:0 0 auto;display:flex;align-items:center;gap:4px}
.tag{
font-size:9.5px;font-weight:700;letter-spacing:.08em;padding:3px 6px;border-radius:var(--r-xs);
background:var(--sv);color:var(--osv);text-transform:uppercase;
}
.tag.lsi{background:var(--tc);color:var(--otc)}
.tag.warn{background:var(--pe);color:var(--err)}
.tag.mine{background:var(--pc);color:var(--opc)}
.empty{padding:56px 24px;text-align:center;color:var(--osv);font-size:13px}
.empty svg{width:46px;height:46px;fill:var(--outv);margin-bottom:10px}
/* --- cards --- */
.card{
background:var(--sc2);border-radius:var(--r-l);margin:10px 14px;padding:14px 16px;
}
.card.out{background:var(--sc3)}
.card h3{margin:0 0 8px;font-size:12px;letter-spacing:.1em;text-transform:uppercase;color:var(--osv);font-weight:600}
.ur-big{font-family:var(--nast);font-size:26px;line-height:2.1;direction:rtl;unicode-bidi:isolate;word-break:break-word}
.mono{font-family:var(--mono);font-size:13px}
.ipa{font-family:var(--mono);color:var(--p);font-size:13px}
.kv{display:flex;justify-content:space-between;gap:12px;padding:5px 0;font-size:13px;border-bottom:1px solid var(--outv)}
.kv:last-child{border:0}
.kv span:first-child{color:var(--osv)}
.kv span:last-child{text-align:right;max-width:62%}
/* --- fields --- */
.field{position:relative;margin:14px}
.field input,.field textarea,.field select{
width:100%;font:inherit;font-size:15px;color:var(--osurf);background:transparent;
border:1px solid var(--outline);border-radius:var(--r-xs);padding:15px 14px 7px;outline:0;
}
.field textarea{min-height:76px;resize:vertical;line-height:1.5}
.field input:focus,.field textarea:focus,.field select:focus{border-color:var(--p);border-width:2px;padding:14px 13px 6px}
.field label{
position:absolute;top:-8px;left:10px;background:var(--bg);padding:0 5px;
font-size:11px;color:var(--osv);letter-spacing:.03em;
}
.field input:focus+label,.field textarea:focus+label{color:var(--p)}
.field.ur input,.field.ur textarea{font-family:var(--nast);font-size:22px;line-height:2;direction:rtl}
.btnrow{display:flex;gap:8px;flex-wrap:wrap;padding:0 14px 6px}
.btn{
border:0;border-radius:var(--r-xl);padding:10px 20px;font:inherit;font-size:13.5px;font-weight:500;
background:var(--p);color:var(--op);cursor:pointer;display:inline-flex;align-items:center;gap:8px;
}
.btn.tonal{background:var(--sc);color:var(--osc)}
.btn.out{background:transparent;color:var(--p);border:1px solid var(--outline)}
.btn.text{background:transparent;color:var(--p);padding:10px 12px}
.btn:active{filter:brightness(.94)}
.btn svg{width:18px;height:18px;fill:currentColor}
.btn[disabled]{opacity:.45;cursor:default}
.switchrow{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 20px;font-size:14px}
.switchrow small{display:block;color:var(--osv);font-size:12px}
.sw{
width:50px;height:30px;border-radius:16px;background:var(--sv);border:2px solid var(--outline);
position:relative;cursor:pointer;flex:0 0 auto;transition:background .15s;
}
.sw::after{content:"";position:absolute;top:5px;left:5px;width:16px;height:16px;border-radius:50%;
background:var(--outline);transition:.15s}
.sw[aria-pressed="true"]{background:var(--p);border-color:var(--p)}
.sw[aria-pressed="true"]::after{left:25px;width:22px;height:22px;top:2px;background:var(--op)}
input[type=range]{width:100%;accent-color:var(--p)}
/* --- fab --- */
.fab{
position:absolute;right:16px;bottom:96px;z-index:6;
height:56px;min-width:56px;border-radius:var(--r-l);border:0;background:var(--pc);color:var(--opc);
box-shadow:0 4px 10px var(--shadow);cursor:pointer;display:flex;align-items:center;gap:8px;
padding:0 18px;font:inherit;font-size:14px;font-weight:600;
}
.fab svg{width:24px;height:24px;fill:currentColor}
.fab:active{filter:brightness(.95)}
/* --- bottom nav --- */
.nav{
flex:0 0 auto;display:flex;background:var(--sc2);padding:8px 4px 12px;z-index:7;
border-top:1px solid var(--outv);
}
.nav button{
flex:1;border:0;background:transparent;cursor:pointer;color:var(--osv);
display:flex;flex-direction:column;align-items:center;gap:3px;padding:2px 0;font:inherit;font-size:11px;
}
.nav .pill{
width:56px;height:30px;border-radius:16px;display:grid;place-items:center;transition:background .15s;
}
.nav svg{width:22px;height:22px;fill:currentColor}
.nav button[aria-current="page"]{color:var(--osurf);font-weight:600}
.nav button[aria-current="page"] .pill{background:var(--sc);color:var(--osc)}
/* --- scrim, bottom sheet, dialog --- */
.scrim{
position:absolute;inset:0;background:rgba(0,0,0,.42);opacity:0;pointer-events:none;
transition:opacity .18s;z-index:8;
}
.scrim.on{opacity:1;pointer-events:auto}
.sheet{
position:absolute;left:0;right:0;bottom:0;max-height:86%;z-index:9;
background:var(--sc1);border-radius:var(--r-xl) var(--r-xl) 0 0;
transform:translateY(105%);transition:transform .22s cubic-bezier(.2,0,0,1);
display:flex;flex-direction:column;box-shadow:0 -4px 24px var(--shadow);
}
.sheet.on{transform:translateY(0)}
.grabber{width:32px;height:4px;border-radius:2px;background:var(--outv);margin:12px auto 4px;flex:0 0 auto}
.sheet-body{overflow-y:auto;padding:4px 0 26px}
.dialog{
position:absolute;left:16px;right:16px;top:50%;transform:translateY(-50%) scale(.92);
background:var(--sc3);border-radius:var(--r-xl);padding:20px;z-index:10;
opacity:0;pointer-events:none;transition:opacity .16s,transform .16s;max-height:88%;overflow-y:auto;
}
.dialog.on{opacity:1;pointer-events:auto;transform:translateY(-50%) scale(1)}
.dialog h2{margin:0 0 4px;font-size:19px;font-weight:500}
.dialog p{margin:0 0 12px;font-size:13px;color:var(--osv)}
.dialog .field{margin:16px 0}
.dialog .field label{background:var(--sc3)}
.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}
/* --- snackbar --- */
.snack{
position:absolute;left:16px;right:16px;bottom:92px;z-index:11;
background:var(--osurf);color:var(--surf);border-radius:var(--r-xs);padding:14px 16px;font-size:13.5px;
box-shadow:0 3px 12px var(--shadow);opacity:0;transform:translateY(12px);pointer-events:none;
transition:.18s;display:flex;align-items:center;gap:12px;
}
.snack.on{opacity:1;transform:translateY(0)}
/* --- misc --- */
.badge{
display:inline-block;font-size:11px;padding:2px 8px;border-radius:var(--r-xs);
background:var(--tc);color:var(--otc);font-weight:600;
}
a{color:var(--p)}
code{font-family:var(--mono);font-size:12px;background:var(--sc4);padding:1px 5px;border-radius:3px}
table.sounds{width:100%;border-collapse:collapse}
table.sounds td{padding:8px 6px;border-bottom:1px solid var(--outv);vertical-align:middle;font-size:13px}
table.sounds .k{font-family:var(--mono);font-weight:700;font-size:15px;width:44px}
table.sounds .u{font-family:var(--nast);font-size:20px;width:52px;text-align:center}
.grp{
background:var(--sc4);color:var(--osurf);font-size:10.5px;font-weight:700;letter-spacing:.12em;
text-transform:uppercase;padding:6px 20px;
}
.srcline{display:flex;gap:12px;padding:12px 20px;border-bottom:1px solid var(--outv);font-size:13px}
.srcline .code{font-family:var(--mono);font-weight:700;color:var(--p);flex:0 0 52px}
.warnbox{
margin:12px 14px;padding:12px 14px;border-radius:var(--r-m);background:var(--pe);color:var(--err);
font-size:12.5px;line-height:1.5;
}
.notebox{
margin:12px 14px;padding:12px 14px;border-radius:var(--r-m);background:var(--sc3);
font-size:12.5px;line-height:1.55;color:var(--osurf);
}
/* ---------------------------------------------------------------
DESKTOP: same app, laid out for a real window — navigation rail
on the left, list in the middle, the entry as a fixed right pane
instead of a bottom sheet.
--------------------------------------------------------------- */
@media (min-width:1100px){
body{display:block;padding:0;background:var(--bg)}
.phone{
width:100%;height:100vh;max-width:none;border-radius:0;box-shadow:none;
display:grid;grid-template-columns:96px minmax(0,1fr) 440px;grid-template-rows:auto 1fr;
grid-template-areas:"rail bar bar" "rail main sheet";
}
.phone.no-sheet{grid-template-columns:96px minmax(0,1fr);
grid-template-areas:"rail bar" "rail main"}
.phone.no-sheet .sheet{display:none}
.statusbar{display:none}
.appbar{grid-area:bar;display:flex;flex-wrap:wrap;align-items:center;gap:14px;padding:14px 28px 12px}
.appbar-row{flex:0 0 auto;padding:0;min-height:0;gap:2px}
.appbar h1{flex:0 0 auto;font-size:22px}
.applogo{width:40px;height:40px;font-size:21px;margin-left:0}
.searchbar{flex:1 1 320px;max-width:620px;margin:0}
.chiprow{flex:1 1 100%;padding:2px 0 0;overflow-x:visible;flex-wrap:wrap;row-gap:8px}
main{grid-area:main;padding:0 12px}
.view{padding-bottom:36px;max-width:860px;margin:0 auto}
.li{border-radius:var(--r-m);padding:12px 18px}
.li.sel{background:var(--sc)}
.li.sel .en,.li.sel .ur{color:var(--osc)}
.nav{
grid-area:rail;flex-direction:column;justify-content:flex-start;gap:6px;
border-top:0;border-right:1px solid var(--outv);padding:18px 8px;background:var(--sc1);
}
.nav button{flex:0 0 auto;font-size:11.5px;gap:4px}
.sheet{
grid-area:sheet;position:static;transform:none;max-height:none;border-radius:0;
border-left:1px solid var(--outv);box-shadow:none;background:var(--sc1);
}
.grabber{display:none}
.sheet-body{padding-top:18px}
.scrim.sheet-mode{display:none}
.fab{position:fixed;right:472px;bottom:28px}
.phone.no-sheet .fab{right:32px}
.dialog{left:50%;right:auto;width:min(520px,90vw);transform:translate(-50%,-50%) scale(.94)}
.dialog.on{transform:translate(-50%,-50%) scale(1)}
.snack{left:128px;right:auto;min-width:340px;max-width:520px;bottom:28px}
.card,.field,.btnrow,.notebox,.warnbox{margin-left:18px;margin-right:18px}
.sheet .card,.sheet .btnrow,.sheet .notebox,.sheet .warnbox{margin-left:14px;margin-right:14px}
.hint,.section-h{padding-left:20px;padding-right:20px}
table.sounds td{padding:10px 8px}
.empty{padding:80px 24px}
}
/* very wide: stop the middle column from sprawling */
@media (min-width:1600px){
.phone{grid-template-columns:96px minmax(0,1fr) 520px}
.fab{right:552px}
</style>
</head>
<body>
<div class="phone">
<!-- ─────────── status bar ─────────── -->
<div class="statusbar">
<span id="clock">9:41</span>
<span class="icons">
<svg viewBox="0 0 24 24" width="13" height="13" fill="currentColor"><path d="M2 22h20V2z"/></svg>
<svg viewBox="0 0 24 24" width="14" height="14" fill="currentColor"><path d="M12 21l11-13c-3-2.6-7-4-11-4S4 5.4 1 8z"/></svg>
<svg viewBox="0 0 24 24" width="13" height="13" fill="currentColor"><path d="M15.7 4H14V2h-4v2H8.3C7.6 4 7 4.6 7 5.3v15.4c0 .7.6 1.3 1.3 1.3h7.4c.7 0 1.3-.6 1.3-1.3V5.3C17 4.6 16.4 4 15.7 4z"/></svg>
</span>
</div>
<!-- ─────────── app bar ─────────── -->
<header class="appbar">
<div class="appbar-row">
<div class="applogo">ب</div>
<h1 id="screen-title">Brahui Dictionary<small id="screen-sub">براہوئی لغت</small></h1>
<button class="iconbtn" data-act="theme-info" title="About the sources">
<svg viewBox="0 0 24 24"><path d="M11 17h2v-6h-2v6zm1-15C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm0 18a8 8 0 110-16 8 8 0 010 16zM11 9h2V7h-2v2z"/></svg>
</button>
<button class="iconbtn" data-act="settings" title="Voice settings">
<svg viewBox="0 0 24 24"><path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3A4.5 4.5 0 0014 7.97v8.06A4.47 4.47 0 0016.5 12zM14 3.23v2.06c2.9.86 5 3.54 5 6.71s-2.1 5.85-5 6.71v2.06c4-.91 7-4.49 7-8.77S18 4.14 14 3.23z"/></svg>
</button>
</div>
<div class="searchbar" id="searchwrap">
<svg viewBox="0 0 24 24"><path d="M15.5 14h-.8l-.3-.3a6.5 6.5 0 10-.7.7l.3.3v.8l5 5 1.5-1.5-5-5zm-6 0a4.5 4.5 0 110-9 4.5 4.5 0 010 9z"/></svg>
<input id="q" placeholder="Search Brahui, Urdu script or English" autocomplete="off">
<button class="iconbtn" data-act="clear-q" title="Clear">
<svg viewBox="0 0 24 24"><path d="M19 6.4L17.6 5 12 10.6 6.4 5 5 6.4 10.6 12 5 17.6 6.4 19 12 13.4 17.6 19 19 17.6 13.4 12z"/></svg>
</button>
</div>
<div class="chiprow" id="chips"></div>
</header>
<!-- ─────────── content ─────────── -->
<main id="main">
<!-- WORDS -->
<section class="view on" id="view-words">
<div class="hint" id="wordcount"></div>
<div id="wordlist"></div>
</section>
<!-- PHRASES -->
<section class="view" id="view-phrases">
<div class="hint">Published parallel sentences. Connected speech is where a word list stops helping —
intonation and vowel reduction only show up in a whole clause.</div>
<div id="phraselist"></div>
</section>
<!-- SOUNDS -->
<section class="view" id="view-sounds">
<div class="hint">Every sound of Brahui with the Urdu letter that carries it. <b>Drill</b> repeats it three
times; <b>Once</b> says it in a frame word. <b>ڷ</b> /ɬ/ exists in no TTS voice on earth — the
substitution you hear is the voice giving up, not a spelling error.</div>
<table class="sounds"><tbody id="soundlist"></tbody></table>
</section>
<!-- TYPE / CONVERT -->
<section class="view" id="view-type">
<div class="section-h">Latin → Brahui script</div>
<div class="field">
<textarea id="src" placeholder="baŧŧa">baŧŧa</textarea>
<label>Brahui in Brolikva Latin</label>
</div>
<div class="btnrow">
<button class="btn" data-act="speak-src"><svg viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>Speak</button>
<button class="btn tonal" data-act="copy-src">Copy script</button>
<button class="btn out" data-act="save-src">Save to dictionary</button>
</div>
<div class="card out">
<h3>Brahui orthography — store this</h3>
<div class="ur-big" id="o-ur"> </div>
<div class="ipa" id="o-ipa" style="margin-top:6px">/ /</div>
</div>
<div class="card out">
<h3>Vocalized for TTS — send this to the voice</h3>
<div class="ur-big" id="o-tts"> </div>
</div>
<div class="card out">
<h3>Fallbacks</h3>
<div class="kv"><span>Diacritic-stripping</span><span class="ur-big" style="font-size:20px" id="o-plain"> </span></div>
<div class="kv"><span>Devanagari (Hindi voice)</span><span id="o-deva" style="font-size:19px"> </span></div>
<div class="kv"><span>English respelling</span><span class="mono" id="o-eng" style="font-weight:700"> </span></div>
</div>
<div class="notebox">
ASCII accepted: <code>sh</code>=ş · <code>zh</code>=ź · <code>LH</code>=ļ · <code>GH</code>=ģ ·
<code>T</code>=ŧ · <code>D</code>=đ · <code>R</code>=ŕ · <code>N</code>=ń ·
<code>aa</code>=á · <code>ii</code>=í · <code>uu</code>=ú.<br><br>
<b>Not</b> shortcuts, because they destroy real contrasts: <code>tt dd rr</code> are genuine geminates
(<code>baŧŧa</code>, <code>izzat</code>) and <code>kh gh ch</code> are aspirated loan consonants
(<code>khuriyá</code>, <code>bhallo</code>). For /x/ and /ɣ/ type <code>x</code> and <code>ģ</code>.<br><br>
A capital at the <b>start</b> of a word is read as ordinary capitalisation, so <code>Ná</code> is
<i>ná</i> and not <i>ńá</i>. Mid-word the shortcuts still hold, so <code>baTTa</code> is
<code>baŧŧa</code>. If a word really begins with ŧ ń ş ź ģ ŕ đ ļ, type that letter.
</div>
<div class="section-h">Brahui script → Latin</div>
<div class="field ur">
<textarea id="rsrc" placeholder="دِیر"></textarea>
<label>Paste Perso-Arabic Brahui</label>
</div>
<div class="btnrow">
<button class="btn" data-act="speak-rev"><svg viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>Speak</button>
<button class="btn tonal" data-act="rev-to-src">Send to converter</button>
<button class="btn out" data-act="save-rev">Add to dictionary</button>
</div>
<div class="card out">
<div class="kv"><span>Latin</span><span class="mono" id="r-lat" style="font-weight:700;font-size:15px"> </span></div>
<div class="kv"><span>Say as</span><span class="mono" id="r-eng"> </span></div>
<div class="kv"><span>IPA</span><span class="ipa" id="r-ipa"> </span></div>
<div id="r-note" style="font-size:12px;color:var(--p);margin-top:8px"></div>
<div id="r-issues" style="font-size:12px;color:var(--err);margin-top:4px"></div>
</div>
</section>
<!-- SOURCES / ABOUT -->
<section class="view" id="view-about">
<div class="section-h">Where every entry comes from</div>
<div class="hint">The Latin is the source of truth. Script, IPA, Devanagari and the respelling are
regenerated from it on every read, so a fix to the engine propagates to every entry at once.</div>
<div id="sourcelist"></div>
<div class="section-h">Books used</div>
<div class="notebox">
<b>Grierson, G. A. — Linguistic Survey of India, Vol. IV: Muṇḍā and Dravidian Languages</b> (Calcutta, 1906).
Brahui occupies pp. 619–681: sketch grammar, three specimens, and the Standard List of Words and
Phrases in the Brahui of Kalat (items 1–241), which is where the <span class="badge">LSI</span>
entries and most of the sentences in <b>Phrases</b> were read off.<br>
<a href="https://dn790000.ca.archive.org/0/items/in.ernet.dli.2015.42222/2015.42222.Linguistic-Survey-Of-India--Vol-4.pdf" target="_blank" rel="noopener">PDF (66 MB)</a> ·
<a href="https://archive.org/details/in.ernet.dli.2015.42222" target="_blank" rel="noopener">archive.org item</a>
</div>
<div class="notebox">
<b>Bray, Denys de S. — The Brahui Language, Part I: Introduction and Grammar</b> (Calcutta, 1909).
Used to settle readings the 1906 scan had damaged — <i>khākhar</i> “fire”, <i>tuh</i> “moon”,
<i>kātum</i> “head”, <i>bīsh</i> “donkey”, <i>mē</i> “slave” — and for the <span class="badge">BRAY</span> entries.<br>
<a href="https://archive.org/details/in.ernet.dli.2015.13132" target="_blank" rel="noopener">archive.org item</a>
</div>
<div class="notebox">
<b>Universal Declaration of Human Rights, Article 1 — Brahui parallel text</b>, Brahui Language Board /
University of Balochistan. The engine in this app is validated against it: 11 of 11 words render exactly.
</div>
<div class="notebox">
<b>Ali, Liaquat & Masato Kobayashi — Brahui Texts</b> (ILCAA, Tokyo University of Foreign Studies, 2024).
Story titles are glossed by the authors, so those pairings are published; everything else drawn from the
corpus is marked <span class="badge">CORP</span> and still needs a speaker.
</div>
<div class="section-h">Data</div>
<div class="btnrow">
<button class="btn tonal" data-act="export-json">Export JSON</button>
<button class="btn tonal" data-act="export-tsv">Review sheet (TSV)</button>
<button class="btn out" data-act="reset">Reset to seed</button>
</div>
<div class="section-h">Bulk add</div>
<div class="field">
<textarea id="bulk" placeholder="water = دِیر house = urá one = asiŧ"></textarea>
<label>One “meaning = brahui” per line</label>
</div>
<div class="btnrow"><button class="btn" data-act="bulk-add">Add all</button></div>
<div class="section-h">Why the diacritics matter</div>
<div class="notebox">
Urdu text normally omits short-vowel marks, and a TTS engine guesses them from its own Urdu lexicon —
which contains no Brahui words. Every output here is fully vocalized (zabar / zer / pesh / sukun) so the
engine reads exactly what is written and the long–short vowel contrast survives. Feed the engine the
vocalized string, never the bare consonant skeleton.
</div>
</section>
</main>
<button class="fab" data-act="add-open" id="fab">
<svg viewBox="0 0 24 24"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"/></svg>Add
</button>
<!-- ─────────── bottom nav ─────────── -->
<nav class="nav" id="nav">
<button data-nav="words" aria-current="page"><span class="pill">
<svg viewBox="0 0 24 24"><path d="M18 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V4a2 2 0 00-2-2zM8 4h3v7l-1.5-1L8 11V4z"/></svg>
</span>Words</button>
<button data-nav="phrases"><span class="pill">
<svg viewBox="0 0 24 24"><path d="M20 2H4a2 2 0 00-2 2v18l4-4h14a2 2 0 002-2V4a2 2 0 00-2-2zM6 9h12v2H6V9zm8 5H6v-2h8v2zm4-6H6V6h12v2z"/></svg>
</span>Phrases</button>
<button data-nav="sounds"><span class="pill">
<svg viewBox="0 0 24 24"><path d="M7 18h2V6H7v12zm4 4h2V2h-2v20zm-8-8h2v-4H3v4zm12 4h2V6h-2v12zm4-4h2v-4h-2v4z"/></svg>
</span>Sounds</button>
<button data-nav="type"><span class="pill">
<svg viewBox="0 0 24 24"><path d="M20 5H4a2 2 0 00-2 2v10a2 2 0 002 2h16a2 2 0 002-2V7a2 2 0 00-2-2zM11 8h2v2h-2V8zM8 8h2v2H8V8zM5 8h2v2H5V8zm3 5H5v-2h3v2zm8 3H8v-2h8v2zm0-3h-2v-2h2v2zm3 0h-2v-2h2v2zm0-3h-2V8h2v2z"/></svg>
</span>Type</button>
<button data-nav="about"><span class="pill">
<svg viewBox="0 0 24 24"><path d="M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>
</span>Sources</button>
</nav>
<div class="scrim" id="scrim"></div>
<div class="sheet" id="sheet"><div class="grabber"></div><div class="sheet-body" id="sheet-body"></div></div>
<div class="dialog" id="dialog"></div>
<div class="snack" id="snack"></div>
</div>
<script>
/* ============================================================
1. ENGINE — Brahui ⇄ Perso-Arabic, IPA, Devanagari, respelling
Validated against the published Brahui orthography of UDHR
Art. 1 (Brahui Language Board / Omniglot): 11/11 words exact.
Authorities: Brahui alphabet incl. ڷ = /ɬ/ and ں = /ɳ/;
Brolikva romanisation (Brahui Language Board, Univ. of
Balochistan); Krishnamurti 2003 / Elfenbein 1997 inventory.
============================================================ */
const C = {
'b':['ب','b','as in bat'], 'p':['پ','p','as in pat'],
't':['ت','t̪','dental — tongue on the back of the teeth'],
'ŧ':['ٹ','ʈ','retroflex — tongue curled back'],
'd':['د','d̪','dental'], 'đ':['ڈ','ɖ','retroflex'],
'k':['ک','k','as in kit'], 'g':['گ','g','as in go'],
'f':['ف','f','as in fan'], 'v':['و','ʋ','w/v — between want and van'],
's':['س','s','as in sat'], 'z':['ز','z','as in zoo'],
'ş':['ش','ʃ','sh in ship'], 'ź':['ژ','ʒ','s in measure'],
'x':['خ','x','ch in Scottish loch'], 'ģ':['غ','ɣ','voiced throat scrape'],
'h':['ہ','h','as in hat'], 'c':['چ','tʃ','ch in church'],
'j':['ج','dʒ','j in judge'], 'm':['م','m','as in man'],
'n':['ن','n̪','dental'], 'ń':['ں','ɳ','retroflex n — NOT plain n'],
'l':['ل','l','as in let'], 'ļ':['ڷ','ɬ','voiceless lateral fricative — Welsh Ll, unique to Brahui'],
'r':['ر','ɾ','tapped, Spanish pero'], 'ŕ':['ڑ','ɽ','retroflex flap — never word-initial'],
'y':['ی','j','as in yes'], "'":['ع','ʔ','glottal stop — southern dialect for northern h']
};
/* Aspirates are not native phonemes, but ~55% of the lexicon is
Perso-Arabic / Indo-Aryan loan material and the corpus is full
of them (bhallo, khuriyá, phul, jhal, đhaggí, thaŕa). */
const ASPIRATE = {
'bh':['بھ','bʱ'],'ph':['پھ','pʰ'],'th':['تھ','t̪ʰ'],'ŧh':['ٹھ','ʈʰ'],
'dh':['دھ','d̪ʱ'],'đh':['ڈھ','ɖʱ'],'kh':['کھ','kʰ'],'gh':['گھ','gʱ'],
'ch':['چھ','tʃʰ'],'jh':['جھ','dʒʱ'],'ŕh':['ڑھ','ɽʱ']
};
for (const k in ASPIRATE) C[k] = [ASPIRATE[k][0], ASPIRATE[k][1], 'aspirated — loan phoneme'];
/* Brahui has NO short /e o/ (Krishnamurti 2003:118). /ai au/ are phonemic. */
const V = {
'a' :{ini:'اَ' ,mid:'َ' ,fin:'ہ' ,ipa:'ə' ,note:'short — u in cut'},
'i' :{ini:'اِ' ,mid:'ِ' ,fin:'ی' ,ipa:'ɪ' ,note:'short — i in sit'},
'u' :{ini:'اُ' ,mid:'ُ' ,fin:'و' ,ipa:'ʊ' ,note:'short — oo in book'},
'á' :{ini:'آ' ,mid:'َا' ,fin:'ا' ,ipa:'aː',note:'long — a in father'},
'í' :{ini:'اِی',mid:'ِی' ,fin:'ی' ,ipa:'iː',note:'long — ee in see'},
'ú' :{ini:'اُو',mid:'ُو' ,fin:'و' ,ipa:'uː',note:'long — oo in food'},
'e' :{ini:'اے' ,mid:'ے' ,fin:'ے' ,ipa:'eː',note:'long — pure ay, no glide'},
'o' :{ini:'او' ,mid:'و' ,fin:'و' ,ipa:'oː',note:'long — pure o, no glide'},
'ai':{ini:'اَی',mid:'َی' ,fin:'َے' ,ipa:'əɪ̯',note:'diphthong — eye'},
'au':{ini:'اَو',mid:'َو' ,fin:'َو' ,ipa:'əʊ̯',note:'diphthong — how'}
};
const SUKUN='ْ', SHADDA='ّ';
const ALIAS={
'ḍ':'đ','ġ':'ģ','ḷ':'ļ','ż':'ź','ṭ':'ŧ','ṛ':'ŕ','ṇ':'ń','ṣ':'ş',
'ā':'á','ī':'í','ū':'ú','ē':'e','ō':'o',
'lh':'ļ','LH':'ļ','L':'ļ','sh':'ş','SH':'ş','S':'ş','zh':'ź','ZH':'ź','Z':'ź',
'GH':'ģ','G':'ģ','X':'x','T':'ŧ','D':'đ','R':'ŕ','N':'ń',
'aa':'á','ii':'í','uu':'ú','AA':'á','II':'í','UU':'ú','A':'á','I':'í','U':'ú',
'ð':'đ','ţ':'ŧ','w':'v'
};
const KEYS=[...Object.keys(ALIAS),...Object.keys(C),...Object.keys(V)].sort((a,b)=>b.length-a.length);
/* A word-initial capital is ordinary capitalisation (Ná, Ode, Muccá), not an
ASCII shortcut — otherwise "Ná" tokenised as ń-á and came out ںَا. Mid-word
capitals keep their shortcut meaning, so baTTa still gives baŧŧa. */
function decap(word){
return (/^[A-Z]/.test(word) && !/^[A-Z][A-Z]/.test(word))
? word[0].toLowerCase()+word.slice(1) : word;
}
function tokenize(word){
word=decap(word.normalize('NFC'));
const out=[]; let i=0;
while(i<word.length){
let hit=null;
for(const k of KEYS){ if(word.startsWith(k,i)){hit=k;break;} }
if(hit){ out.push(ALIAS[hit]||hit); i+=hit.length; }
else { out.push(word[i]); i++; }
}
return out;
}
/* opts.sukun — true for TTS output, false for stored orthography.
Native Brahui text does not write sukun; Urdu front-ends need it. */
function toUrdu(word,opts){
const sukun = !opts || opts.sukun !== false;
const t=tokenize(word); let s='';
for(let i=0;i<t.length;i++){
const tk=t[i], nx=t[i+1], prev=t[i-1];
if(C[tk]){
if(prev===tk) s+=SHADDA; // geminate = shadda, not letter+sukun
else s+=C[tk][0];
if(nx&&V[nx]){
const atEnd=(i+2>=t.length);
s += (atEnd && V[nx].fin && 'aiu'.includes(nx)) ? V[nx].fin : V[nx].mid;
i++;
} else if(sukun && nx!==tk) s+=SUKUN; // no sukun before a geminate
} else if(V[tk]){
if(s==='') s+=V[tk].ini;
else {
/* Vowel on vowel. If this one opens with a haraka it would stack on the
mark already sitting on the consonant (juán came out جَُان), so write
the hiatus with a carrier letter the way Urdu does: جُوان, مادِیان. */
const stacks = prev && V[prev] && /^[ً-ْ]/.test(V[tk].mid);
if(stacks) s += ({i:'ی',u:'و',a:'ا'})[prev] || '';
s += V[tk].mid;
}
} else s+=tk;
}
return s;
}
function toIPA(word){ return tokenize(word).map(t=>C[t]?C[t][1]:(V[t]?V[t].ipa:t)).join(''); }
const PUNCT={'?':'؟',',':'،',';':'؛'};
function line(txt,opts){
return txt.split(/(\s+|-)/).map(w=>/^[\s-]*$/.test(w)?w:toUrdu(w,opts)).join('')
.replace(/[?,;]/g,ch=>PUNCT[ch]);
}
function lineIPA(txt){ return txt.split(/(\s+|-)/).map(w=>/^[\s-]*$/.test(w)?w:toIPA(w)).join(''); }
/* Azure <phoneme alphabet="ipa"> — plain symbols only, no combining marks. */
const AZIPA={
b:'b',p:'p',t:'t','ŧ':'ʈ',d:'d','đ':'ɖ',k:'k',g:'g',f:'f',v:'ʋ',
s:'s',z:'z','ş':'ʃ','ź':'ʒ',x:'x','ģ':'ɣ',h:'h',c:'tʃ',j:'dʒ',
m:'m',n:'n','ń':'ɳ',l:'l','ļ':'ɬ',r:'ɾ','ŕ':'ɽ',y:'j',"'":'ʔ',
a:'ə','á':'aː',i:'ɪ','í':'iː',u:'ʊ','ú':'uː',e:'eː',o:'oː',ai:'aɪ',au:'aʊ',
bh:'b',ph:'pʰ',th:'tʰ','ŧh':'ʈʰ',dh:'d','đh':'ɖ',kh:'kʰ',gh:'g',ch:'tʃʰ',jh:'dʒ','ŕh':'ɽ'
};
function toAzIPA(word){ return tokenize(word).map(t=>AZIPA[t]||'').join(''); }
function lineAzIPA(txt){ return txt.split(/\s+/).filter(Boolean).map(toAzIPA); }
/* ---------- reverse: Perso-Arabic → Brolikva ---------- */
const RC={
'ب':'b','پ':'p','ت':'t','ٹ':'ŧ','د':'d','ڈ':'đ','ک':'k','ك':'k','گ':'g',
'ف':'f','س':'s','ص':'s','ث':'s','ز':'z','ذ':'z','ض':'z','ظ':'z',
'ش':'ş','ژ':'ź','خ':'x','غ':'ģ','ہ':'h','ح':'h','ه':'h',
'چ':'c','ج':'j','م':'m','ن':'n','ں':'ń','ل':'l','ڷ':'ļ','ر':'r','ڑ':'ŕ',
'ط':'t','ع':"'",'ء':"'",'ق':'k'
};
const RMARK={'َ':'a','ِ':'i','ُ':'u','ْ':'','ٰ':'á'};
const SCRIPT_FIX={'ك':'ک','ي':'ی','ى':'ی',
'ة':'ہ','ه':'ہ','ۃ':'ہ','ؤ':'و','ئ':'ی'};
function normalizeScript(t){
return [...t.normalize('NFC')].map(c=>SCRIPT_FIX[c]||c).join('')
.replace(/[--]/g,'');
}
function fromUrdu(word){
word=normalizeScript(word);
const ch=[...word];
let out=[], guessed=0;
for(let i=0;i<ch.length;i++){
const c=ch[i], nx=ch[i+1], prev=out[out.length-1];
/* word-initial alif is a vowel CARRIER, not a vowel */
if(i===0 && c==='ا'){
if(nx && RMARK[nx]!==undefined){ continue; }
if(nx==='ی'){ out.push('í'); i++; continue; }
if(nx==='و'){ out.push('ú'); i++; continue; }
if(nx==='ے'){ out.push('e'); i++; continue; }
out.push('a'); continue;
}
/* shadda geminates the preceding CONSONANT; NFC sorts damma before
shadda, so walk back past any vowel token first */
if(c===SHADDA){
const vowels=['a','á','i','í','u','ú','e','o','ai','au'];
let k=out.length-1;
while(k>=0 && vowels.includes(out[k])) k--;
if(k>=0) out.splice(k+1,0,out[k]);
continue;
}
if(RMARK[c]!==undefined){
const m=RMARK[c];
if(m==='a'&&nx==='ا'){ out.push('á'); i++; }
else if(m==='a'&&nx==='ی'){ out.push('ai'); i++; }
else if(m==='a'&&nx==='و'){ out.push('au'); i++; }
else if(m==='i'&&nx==='ی'){ out.push('í'); i++; }
else if(m==='u'&&nx==='و'){ out.push('ú'); i++; }
else if(m) out.push(m);
continue;
}
if(c==='ھ'){ if(prev&&C[prev+'h']) out[out.length-1]=prev+'h'; continue; }
if(c==='آ'){ out.push('á'); continue; }
if(c==='ا'){ out.push('á'); continue; }
if(c==='ے'){ out.push('e'); continue; }
if(c==='ی'||c==='ي'){ out.push((out.length===0||'aáiíuúeo'.includes(prev))?'y':'í'); continue; }
if(c==='و'){ out.push((out.length===0||'aáiíuúeo'.includes(prev))?'v':'o'); continue; }
if(RC[c]!==undefined){ if(RC[c]) out.push(RC[c]); continue; }
}
/* only guess missing short vowels when the writer supplied NO aerab */
const HARAKA=/[ً-ْٰ]/;
const vocalized = HARAKA.test(word);
let res='';
const isV=v=>['a','á','i','í','u','ú','e','o','ai','au'].includes(v);
for(let i=0;i<out.length;i++){
const t=out[i], nx=out[i+1];
res+=t;
if(!vocalized && t&&!isV(t)&&nx&&!isV(nx)&&t!==nx){ res+='ₐ'; guessed++; }
}
return {latin:res, guessed};
}
function lineFromUrdu(txt){
let g=0;
const out=txt.split(/(\s+)/).map(w=>{
if(/^\s*$/.test(w)) return w;
const r=fromUrdu(w); g+=r.guessed; return r.latin;
}).join('');
return {latin:out, guessed:g};
}
/* ---------- Devanagari: most browsers ship no Urdu voice, but nearly
all ship Google हिन्दी. Hindi carries the dental/retroflex contrast,
the aspirates and vowel length. Only /ɬ/ is lost. ---------- */
const DC={
b:'ब',p:'प',t:'त','ŧ':'ट',d:'द','đ':'ड',k:'क',g:'ग',f:'फ़',v:'व',
s:'स',z:'ज़','ş':'श','ź':'ज़',x:'ख़','ģ':'ग़',h:'ह',c:'च',j:'ज',
m:'म',n:'न','ń':'ण',l:'ल','ļ':'ल',r:'र','ŕ':'ड़',y:'य',"'":'',
bh:'भ',ph:'फ',th:'थ','ŧh':'ठ',dh:'ध','đh':'ढ',kh:'ख',gh:'घ',ch:'छ',jh:'झ','ŕh':'ढ़'
};
const DV={
a:{ind:'अ',m:''},'á':{ind:'आ',m:'ा'},i:{ind:'इ',m:'ि'},'í':{ind:'ई',m:'ी'},
u:{ind:'उ',m:'ु'},'ú':{ind:'ऊ',m:'ू'},e:{ind:'ए',m:'े'},o:{ind:'ओ',m:'ो'},
ai:{ind:'ऐ',m:'ै'},au:{ind:'औ',m:'ौ'}
};
const VIRAMA='्';
function toDeva(word){
const t=tokenize(word); let s='';
for(let i=0;i<t.length;i++){
const tk=t[i], nx=t[i+1];
if(DC[tk]!==undefined){ s+=DC[tk]; if(nx&&DV[nx]){ s+=DV[nx].m; i++; } else s+=VIRAMA; }
else if(DV[tk]) s+=(s===''?DV[tk].ind:DV[tk].m);
}
return s;
}
function lineDeva(t){ return t.split(/\s+/).filter(Boolean).map(toDeva).join(' '); }
/* English respelling: en-IN is the best host — it realises English t/d
as retroflex, which is what Brahui needs. */
const ENG={
b:'b',p:'p',t:'t','ŧ':'t',d:'d','đ':'d',k:'k',g:'g',f:'f',v:'w',
s:'s',z:'z','ş':'sh','ź':'zh',x:'kh','ģ':'gh',h:'h',c:'ch',j:'j',
m:'m',n:'n','ń':'n',l:'l','ļ':'hl',r:'r','ŕ':'r',y:'y',"'":'',
a:'uh','á':'aa',i:'ih','í':'ee',u:'oo','ú':'ooh',e:'ay',o:'oh',ai:'y',au:'ow',
bh:'bh',ph:'ph',th:'th','ŧh':'th',dh:'dh','đh':'dh',kh:'kh',gh:'gh',ch:'chh',jh:'jh','ŕh':'rh'
};
const ENG_GAPS=['x','ģ','ļ',"'"];
function toEnglish(w){ return tokenize(w).map(t=>ENG[t]!==undefined?ENG[t]:t).join(''); }
function lineEnglish(t){ return t.split(/\s+/).filter(Boolean).map(toEnglish).join(' '); }
/* Diacritic-stripping front ends still honour real letters, so long
vowels survive through mater lectionis. Short vowels stay unwritten. */
const VPLAIN={
'a':{ini:'ا',mid:'',fin:'ہ'}, 'i':{ini:'ا',mid:'',fin:'ی'}, 'u':{ini:'ا',mid:'',fin:'و'},
'á':{ini:'آ',mid:'ا',fin:'ا'},'í':{ini:'ای',mid:'ی',fin:'ی'},'ú':{ini:'او',mid:'و',fin:'و'},
'e':{ini:'اے',mid:'ے',fin:'ے'},'o':{ini:'او',mid:'و',fin:'و'},
'ai':{ini:'اَی',mid:'ی',fin:'ے'},'au':{ini:'اَو',mid:'و',fin:'و'}
};
function toUrduPlain(word){
const t=tokenize(word); let s='';
for(let i=0;i<t.length;i++){
const tk=t[i];
if(C[tk]) s+=C[tk][0];
else if(VPLAIN[tk]){ const v=VPLAIN[tk]; s+=(s===''?v.ini:(i===t.length-1?v.fin:v.mid)); }
}
return s||word;
}
function linePlain(t){ return t.split(/\s+/).filter(Boolean).map(toUrduPlain).join(' '); }
function stripMarks(s){ return s.replace(/[ً-ْ]/g,''); }
const HARAKA_SET='ًٌٍَُِّْٰ';
function validateAerab(t){
const out=[];
for(const w of normalizeScript(t).split(/\s+/).filter(Boolean)){
const ch=[...w]; let marked=0,cons=0;
for(let i=0;i<ch.length;i++){
const c=ch[i], prev=ch[i-1];
if(HARAKA_SET.includes(c)){
marked++;
if(i===0) out.push(w+': a vowel mark opens the word — it must follow a letter');
else if(HARAKA_SET.includes(prev)&&prev!=='ّ') out.push(w+': two vowel marks in a row');
} else if(RC[c]!==undefined||'اآوی ےں'.includes(c)) cons++;
}
if(cons>1&&marked===0) out.push(w+': no aerab at all — short vowels unrecoverable');
}
return out;
}
/* ============================================================
2. LEXICON
Every entry carries a source tag. Nothing here is invented.
LSI Grierson, Linguistic Survey of India IV (1906),
Standard List of Words and Phrases, Brahui of Kalat
(items 1–241, pp. 646–681). `ref` is the item number,
`lsi` the romanisation as printed on the page.
BRAY Bray, The Brahui Language, Part I (1909)
UDHR UDHR Art. 1, Brahui Language Board parallel text
TOC Ali & Kobayashi 2024, Brahui Texts — author glosses
GRAM published grammatical description
CORP ILCAA corpus, meaning inferred from context —
NEEDS SPEAKER CONFIRMATION
MINE added by you
`br` is Brolikva Latin and is the source of truth: script,
IPA, Devanagari and respelling are regenerated from it.
`check:true` marks a reading or gloss a speaker should confirm.
============================================================ */
const SEED = [
/* ---- pronouns & deixis ---- */
{br:'ii',en:'I',src:'GRAM'},
{br:'nan',en:'we',src:'GRAM'},
{br:'nii',en:'you (singular)',src:'GRAM'},
{br:'num',en:'you (plural)',src:'GRAM'},
{br:'o',en:'he, she, it; that',src:'GRAM'},
{br:'daa',en:'this',src:'GRAM'},
{br:'ten',en:'self, own',src:'GRAM'},
{br:'ant',en:'what',src:'GRAM'},
{br:'amar',en:'how',src:'GRAM'},
{br:'araa',en:'where',src:'CORP',check:true},
{br:'har.kas',en:'everyone',src:'CORP',check:true},
/* ---- numerals: 1–3 Dravidian, 4+ Iranian loans ---- */
{br:'asiŧ',en:'one',src:'GRAM'},
{br:'iraŧ',en:'two',src:'GRAM'},
{br:'musiŧ',en:'three',src:'GRAM'},
{br:'cár',en:'four',src:'GRAM'},
{br:'panc',en:'five',src:'GRAM'},
{br:'şaş',en:'six',src:'GRAM'},
{br:'haft',en:'seven',src:'GRAM'},
{br:'haşt',en:'eight',src:'GRAM'},
{br:'bíst',en:'twenty',src:'CORP',check:true},
{br:'panjá',en:'fifty',src:'CORP',check:true},
{br:'sad',en:'hundred',src:'CORP',check:true},
/* ---- the verb “to be” ---- */
{br:'uŧ',en:'I am',src:'GRAM'},
{br:'un',en:'we are',src:'GRAM'},
{br:'us',en:'you are',src:'GRAM'},
{br:'e',en:'is',src:'GRAM'},
{br:'as',en:'was',src:'GRAM'},
{br:'assuŧ',en:'I was',src:'GRAM'},
{br:'affaŧ',en:'I am not',src:'GRAM'},
{br:'aff',en:'is not',src:'GRAM'},
/* ---- core verbs ---- */
{br:'bar',en:'to come',src:'GRAM'},
{br:'bassuŧ',en:'I came',src:'GRAM'},
{br:'hin',en:'to go',src:'CORP',check:true},
{br:'kun',en:'to eat, to drink',src:'CORP',check:true},
{br:'xan',en:'to see',src:'CORP',check:true},
{br:'pár',en:'to say',src:'CORP',check:true},
{br:'hal',en:'to take',src:'CORP',check:true},
{br:'tis',en:'gave',src:'CORP',check:true},
{br:'mas',en:'became',src:'CORP',check:true},
{br:'kar',en:'to do, to make',src:'CORP',check:true},
{br:'hur',en:'to look, to think',src:'CORP',check:true},
{br:'tuus',en:'to sit',src:'CORP',check:true},
{br:'xácing',en:'to sleep, to lie down',src:'CORP',check:true},
{br:'xuáf',en:'to graze, to tend',src:'CORP',check:true},
{br:'harf',en:'to carry, to take away',src:'CORP',check:true},
{br:'tamm',en:'to fall, to happen',src:'CORP',check:true},
{br:'kaşş',en:'to pull out, to draw',src:'CORP',check:true},
{br:'biŧ',en:'to throw',src:'CORP',check:true},
{br:'vadí',en:'born',src:'UDHR'},
{br:'massuno',en:'they became',src:'UDHR'},
/* ---- people & kinship ---- */
{br:'bandaģ',en:'man, person',src:'TOC'},
{br:'insán',en:'human being',src:'UDHR'},
{br:'musáfir',en:'traveller',src:'TOC'},
{br:'şohán',en:'shepherd',src:'TOC'},
{br:'khuriyá',en:'goatherd',src:'TOC'},
{br:'ģaríb',en:'poor man',src:'TOC'},
{br:'kaedí',en:'prisoner',src:'TOC'},
{br:'kumakkár',en:'protector',src:'TOC'},
{br:'buzurg',en:'elder, holy man',src:'TOC'},
{br:'baadşá',en:'king',src:'CORP',check:true},
{br:'maar',en:'son, child',src:'CORP',check:true},
{br:'masiŕ',en:'daughter',src:'CORP',check:true},
{br:'zaaífa',en:'wife, woman',src:'CORP',check:true},
{br:'bíbí',en:'lady, wife',src:'CORP',check:true},
{br:'lumma',en:'mother',src:'CORP',check:true},
{br:'báva',en:'father',src:'CORP',check:true},
{br:'ílum',en:'friend, brother',src:'CORP',check:true},
{br:'ílumí',en:'brotherhood, friendship',src:'UDHR'},
{br:'iilumk',en:'friends, brothers',src:'CORP',check:true},
{br:'vazír',en:'minister',src:'CORP',check:true},
{br:'kaazí',en:'judge',src:'CORP',check:true},
{br:'baxxál',en:'merchant, shopkeeper',src:'CORP',check:true},
{br:'maxlúk',en:'people, crowd',src:'CORP',check:true},
/* ---- animals ---- */
{br:'xazm',en:'deer',src:'TOC'},
{br:'xáxo',en:'crow',src:'TOC'},
{br:'şok',en:'fox',src:'TOC'},
{br:'bođ',en:'louse',src:'TOC'},
{br:'hullí',en:'horse',src:'TOC'},
{br:'meļ',en:'sheep, goats',src:'CORP',check:true},
{br:'khur',en:'flock',src:'CORP',check:true},
{br:'đhaggí',en:'cow',src:'CORP',check:true},
{br:'dúşa',en:'snake',src:'CORP',check:true},
{br:'nariyán',en:'stallion',src:'CORP',check:true},
/* ---- body ---- */
{br:'ust',en:'heart, mind',src:'GRAM'},
{br:'kaaŧum',en:'head',src:'CORP'},
{br:'xan',en:'eye',src:'CORP'},
{br:'bá',en:'mouth',src:'GRAM'},
{br:'mon',en:'face, front',src:'CORP'},
{br:'nat',en:'ear',src:'CORP',check:true,
note:'LSI IV No. 33 gives nat “foot” and No. 38 xaf “ear”. This corpus-inferred gloss is probably a mis-reading — see the LSI entries.'},
{br:'rán',en:'thigh, leg',src:'CORP',check:true},
{br:'suu',en:'meat, flesh',src:'CORP',check:true},
{br:'jaan',en:'body, life',src:'CORP',check:true},
/* ---- world & things ---- */
{br:'diir',en:'water',src:'CORP'},
{br:'urá',en:'house',src:'CORP'},
{br:'şár',en:'town, city',src:'CORP',check:true},
{br:'mulk',en:'country',src:'CORP',check:true},
{br:'jangal',en:'forest',src:'CORP',check:true},
{br:'draxt',en:'tree',src:'CORP',check:true},
{br:'buuc',en:'mountain',src:'CORP',check:true},
{br:'daryáb',en:'river, sea',src:'CORP',check:true},
{br:'baaģ',en:'garden',src:'CORP',check:true},
{br:'xolum',en:'wheat',src:'TOC'},
{br:'kaŕo',en:'grain',src:'TOC'},
{br:'iraģ',en:'food, bread',src:'CORP'},
{br:'puc',en:'clothes',src:'CORP',check:true},
{br:'xíisun',en:'gold',src:'CORP'},
{br:'píihun',en:'silver',src:'CORP',check:true},
{br:'ruppai',en:'rupee',src:'CORP'},
{br:'kaldár',en:'coin, rupee',src:'CORP',check:true},
{br:'giŕá',en:'thing',src:'CORP'},
{br:'thaŕa',en:'porch',src:'TOC'},
/* ---- time ---- */
{br:'de',en:'day',src:'CORP'},
{br:'sob',en:'morning',src:'CORP',check:true},
{br:'şám',en:'evening',src:'CORP',check:true},
{br:'nan',en:'night',src:'CORP',check:true},
{br:'pagga',en:'tomorrow',src:'CORP'},
{br:'tuu',en:'month',src:'CORP',check:true},
{br:'saal',en:'year',src:'CORP'},
{br:'vaxt',en:'time',src:'CORP'},
{br:'must',en:'before, formerly',src:'CORP',check:true},
{br:'aeno',en:'now',src:'CORP',check:true},
/* ---- qualities & abstractions ---- */
{br:'muccá',en:'all',src:'UDHR'},
{br:'ájo',en:'free',src:'UDHR'},
{br:'izzat',en:'dignity, honour',src:'UDHR'},
{br:'rid',en:'right, way',src:'UDHR'},
{br:'barebar',en:'equal',src:'UDHR'},
{br:'puhí',en:'reason, understanding',src:'UDHR'},
{br:'dalíl',en:'conscience, argument',src:'UDHR'},
{br:'juán',en:'good',src:'CORP'},
{br:'bhallo',en:'big, great',src:'CORP'},
{br:'cunk',en:'small',src:'CORP'},
{br:'baaz',en:'much, many',src:'CORP'},
{br:'kam',en:'little, few',src:'CORP'},
{br:'xuş',en:'happy',src:'CORP'},
{br:'tuģ',en:'dream',src:'TOC'},
{br:'bahá',en:'price',src:'TOC'},
{br:'mehr',en:'love',src:'TOC'},
{br:'baxt',en:'luck, fortune',src:'TOC'},
{br:'bevas',en:'powerless, helpless',src:'TOC'},
{br:'rág',en:'tune, drama',src:'TOC'},
{br:'kissa',en:'story',src:'CORP'},
{br:'havál',en:'news, account',src:'CORP'},
/* ---- particles & function words ---- */
{br:'ná',en:'of (genitive)',src:'UDHR'},
{br:'aŧ',en:'in, at',src:'UDHR'},
{br:'ton',en:'with',src:'UDHR'},
{br:'elo',en:'other, another',src:'UDHR'},