@patterkit/model 0.26.0 → 0.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -25,20 +25,22 @@ __export(index_exports, {
25
25
  DEFAULT_CAPTION_CHARACTER: () => DEFAULT_CAPTION_CHARACTER,
26
26
  DEFAULT_CAPTION_DELIMITERS: () => DEFAULT_CAPTION_DELIMITERS,
27
27
  DEFAULT_DOCUMENTATION_CLASSES: () => DEFAULT_DOCUMENTATION_CLASSES,
28
- DEFAULT_ESTIMATE_SYLLABLES_PER_SECOND: () => DEFAULT_ESTIMATE_SYLLABLES_PER_SECOND,
28
+ DEFAULT_ESTIMATE_SPEED: () => DEFAULT_ESTIMATE_SPEED,
29
29
  DEFAULT_LAYOUT: () => DEFAULT_LAYOUT,
30
30
  DEFAULT_PAD_AFTER: () => DEFAULT_PAD_AFTER,
31
31
  DEFAULT_QUALIFIERS: () => DEFAULT_QUALIFIERS,
32
32
  DEFAULT_RECORDING_STATUSES: () => DEFAULT_RECORDING_STATUSES,
33
33
  DEFAULT_SPEAKER_PATTERN: () => DEFAULT_SPEAKER_PATTERN,
34
34
  DEFAULT_WRITING_STATUSES: () => DEFAULT_WRITING_STATUSES,
35
- ESTIMATE_SYLLABLES_PER_SECOND_MAX: () => ESTIMATE_SYLLABLES_PER_SECOND_MAX,
36
- ESTIMATE_SYLLABLES_PER_SECOND_MIN: () => ESTIMATE_SYLLABLES_PER_SECOND_MIN,
35
+ ESTIMATE_SPEED_MAX: () => ESTIMATE_SPEED_MAX,
36
+ ESTIMATE_SPEED_MIN: () => ESTIMATE_SPEED_MIN,
37
37
  EXTENSIONS_DIR: () => EXTENSIONS_DIR,
38
38
  EXTENSION_SCHEMA: () => EXTENSION_SCHEMA,
39
39
  EXTENSION_SHARD: () => EXTENSION_SHARD,
40
40
  FLOW_SCHEMA: () => FLOW_SCHEMA,
41
41
  HANDOFF_SCHEMA: () => HANDOFF_SCHEMA,
42
+ LINE_CHARS_PER_SECOND: () => LINE_CHARS_PER_SECOND,
43
+ LINE_CHAR_WEIGHTS: () => LINE_CHAR_WEIGHTS,
42
44
  LINE_DURATION_MAX: () => LINE_DURATION_MAX,
43
45
  LINE_DURATION_MIN: () => LINE_DURATION_MIN,
44
46
  MANIFEST_EXTENSION: () => MANIFEST_EXTENSION,
@@ -53,15 +55,10 @@ __export(index_exports, {
53
55
  SAVE_SCHEMA: () => SAVE_SCHEMA,
54
56
  SAVE_VERSION: () => SAVE_VERSION,
55
57
  SPEAKER_PATTERN_KEY: () => SPEAKER_PATTERN_KEY,
56
- SPEECH_DIGIT_WEIGHT: () => SPEECH_DIGIT_WEIGHT,
57
- SPEECH_KANJI_WEIGHT: () => SPEECH_KANJI_WEIGHT,
58
- SPEECH_PAUSE_LONG_WEIGHT: () => SPEECH_PAUSE_LONG_WEIGHT,
59
- SPEECH_PAUSE_SHORT_WEIGHT: () => SPEECH_PAUSE_SHORT_WEIGHT,
60
58
  STRINGS_SCHEMA: () => STRINGS_SCHEMA,
61
59
  SUBTITLE_READING_MIN: () => SUBTITLE_READING_MIN,
62
60
  UNRESOLVED_KEY: () => UNRESOLVED_KEY,
63
61
  castStringKey: () => castStringKey,
64
- countSyllables: () => countSyllables,
65
62
  deriveRecordingFolders: () => deriveRecordingFolders,
66
63
  effectiveGameId: () => effectiveGameId,
67
64
  estimateLineDuration: () => estimateLineDuration,
@@ -72,6 +69,7 @@ __export(index_exports, {
72
69
  isDialogueScene: () => isDialogueScene,
73
70
  isValidGameId: () => import_toolkit.isValidGameId,
74
71
  isValidPropertyName: () => import_expr.isValidPropertyName,
72
+ normaliseEstimateSpeed: () => normaliseEstimateSpeed,
75
73
  projectLayout: () => projectLayout,
76
74
  projectQualifiers: () => projectQualifiers,
77
75
  propertyNameify: () => import_expr.propertyNameify,
@@ -81,7 +79,6 @@ __export(index_exports, {
81
79
  sceneFolderLayout: () => sceneFolderLayout,
82
80
  sceneFolderPath: () => sceneFolderPath,
83
81
  speakerLabelKey: () => speakerLabelKey,
84
- speechUnits: () => speechUnits,
85
82
  textIsAction: () => textIsAction,
86
83
  usedQualifiers: () => usedQualifiers,
87
84
  usedSpeakerPairs: () => usedSpeakerPairs,
@@ -89,3056 +86,6 @@ __export(index_exports, {
89
86
  });
90
87
  module.exports = __toCommonJS(index_exports);
91
88
  var import_toolkit = require("@wildwinter/toolkit");
92
-
93
- // src/speech-table.ts
94
- var SpeechClass = {
95
- NONE: 0,
96
- LATIN_VOWEL: 1,
97
- LATIN_LETTER: 2,
98
- CYRILLIC_VOWEL: 3,
99
- CYRILLIC_LETTER: 4,
100
- HAN: 5,
101
- KANA: 6,
102
- KANA_SMALL: 7,
103
- KANA_SOKUON: 8,
104
- KANA_LONG: 9,
105
- HANGUL: 10,
106
- ARABIC_LETTER: 11,
107
- ARABIC_VOWEL: 12,
108
- THAI_CONSONANT: 13,
109
- THAI_LEAD: 14,
110
- THAI_VOWEL: 15,
111
- MARK: 16,
112
- OTHER_LETTER: 17,
113
- DIGIT: 18,
114
- PAUSE_SHORT: 19,
115
- PAUSE_LONG: 20,
116
- JOINER: 21,
117
- SPACE: 22
118
- };
119
- var SPEECH_RANGES = [
120
- 9,
121
- 13,
122
- 22,
123
- 32,
124
- 32,
125
- 22,
126
- 33,
127
- 33,
128
- 20,
129
- 39,
130
- 39,
131
- 21,
132
- 44,
133
- 44,
134
- 19,
135
- 46,
136
- 46,
137
- 20,
138
- 48,
139
- 57,
140
- 18,
141
- 58,
142
- 59,
143
- 19,
144
- 63,
145
- 63,
146
- 20,
147
- 65,
148
- 65,
149
- 1,
150
- 66,
151
- 68,
152
- 2,
153
- 69,
154
- 69,
155
- 1,
156
- 70,
157
- 72,
158
- 2,
159
- 73,
160
- 73,
161
- 1,
162
- 74,
163
- 78,
164
- 2,
165
- 79,
166
- 79,
167
- 1,
168
- 80,
169
- 84,
170
- 2,
171
- 85,
172
- 85,
173
- 1,
174
- 86,
175
- 88,
176
- 2,
177
- 89,
178
- 89,
179
- 1,
180
- 90,
181
- 90,
182
- 2,
183
- 97,
184
- 97,
185
- 1,
186
- 98,
187
- 100,
188
- 2,
189
- 101,
190
- 101,
191
- 1,
192
- 102,
193
- 104,
194
- 2,
195
- 105,
196
- 105,
197
- 1,
198
- 106,
199
- 110,
200
- 2,
201
- 111,
202
- 111,
203
- 1,
204
- 112,
205
- 116,
206
- 2,
207
- 117,
208
- 117,
209
- 1,
210
- 118,
211
- 120,
212
- 2,
213
- 121,
214
- 121,
215
- 1,
216
- 122,
217
- 122,
218
- 2,
219
- 133,
220
- 133,
221
- 22,
222
- 160,
223
- 160,
224
- 22,
225
- 170,
226
- 170,
227
- 2,
228
- 173,
229
- 173,
230
- 21,
231
- 181,
232
- 181,
233
- 17,
234
- 186,
235
- 186,
236
- 2,
237
- 192,
238
- 198,
239
- 1,
240
- 199,
241
- 199,
242
- 2,
243
- 200,
244
- 207,
245
- 1,
246
- 208,
247
- 209,
248
- 2,
249
- 210,
250
- 214,
251
- 1,
252
- 216,
253
- 221,
254
- 1,
255
- 222,
256
- 223,
257
- 2,
258
- 224,
259
- 230,
260
- 1,
261
- 231,
262
- 231,
263
- 2,
264
- 232,
265
- 239,
266
- 1,
267
- 240,
268
- 241,
269
- 2,
270
- 242,
271
- 246,
272
- 1,
273
- 248,
274
- 253,
275
- 1,
276
- 254,
277
- 254,
278
- 2,
279
- 255,
280
- 261,
281
- 1,
282
- 262,
283
- 273,
284
- 2,
285
- 274,
286
- 283,
287
- 1,
288
- 284,
289
- 295,
290
- 2,
291
- 296,
292
- 305,
293
- 1,
294
- 306,
295
- 331,
296
- 2,
297
- 332,
298
- 339,
299
- 1,
300
- 340,
301
- 359,
302
- 2,
303
- 360,
304
- 371,
305
- 1,
306
- 372,
307
- 373,
308
- 2,
309
- 374,
310
- 376,
311
- 1,
312
- 377,
313
- 415,
314
- 2,
315
- 416,
316
- 417,
317
- 1,
318
- 418,
319
- 430,
320
- 2,
321
- 431,
322
- 432,
323
- 1,
324
- 433,
325
- 460,
326
- 2,
327
- 461,
328
- 476,
329
- 1,
330
- 477,
331
- 477,
332
- 2,
333
- 478,
334
- 483,
335
- 1,
336
- 484,
337
- 489,
338
- 2,
339
- 490,
340
- 493,
341
- 1,
342
- 494,
343
- 505,
344
- 2,
345
- 506,
346
- 527,
347
- 1,
348
- 528,
349
- 531,
350
- 2,
351
- 532,
352
- 535,
353
- 1,
354
- 536,
355
- 549,
356
- 2,
357
- 550,
358
- 563,
359
- 1,
360
- 564,
361
- 696,
362
- 2,
363
- 697,
364
- 699,
365
- 17,
366
- 700,
367
- 700,
368
- 21,
369
- 701,
370
- 705,
371
- 17,
372
- 710,
373
- 721,
374
- 17,
375
- 736,
376
- 740,
377
- 2,
378
- 748,
379
- 748,
380
- 17,
381
- 750,
382
- 750,
383
- 17,
384
- 768,
385
- 879,
386
- 16,
387
- 880,
388
- 884,
389
- 17,
390
- 886,
391
- 893,
392
- 17,
393
- 895,
394
- 895,
395
- 17,
396
- 902,
397
- 902,
398
- 17,
399
- 904,
400
- 1013,
401
- 17,
402
- 1015,
403
- 1023,
404
- 17,
405
- 1024,
406
- 1025,
407
- 3,
408
- 1026,
409
- 1027,
410
- 4,
411
- 1028,
412
- 1028,
413
- 3,
414
- 1029,
415
- 1029,
416
- 4,
417
- 1030,
418
- 1031,
419
- 3,
420
- 1032,
421
- 1036,
422
- 4,
423
- 1037,
424
- 1038,
425
- 3,
426
- 1039,
427
- 1039,
428
- 4,
429
- 1040,
430
- 1040,
431
- 3,
432
- 1041,
433
- 1044,
434
- 4,
435
- 1045,
436
- 1045,
437
- 3,
438
- 1046,
439
- 1047,
440
- 4,
441
- 1048,
442
- 1048,
443
- 3,
444
- 1049,
445
- 1053,
446
- 4,
447
- 1054,
448
- 1054,
449
- 3,
450
- 1055,
451
- 1058,
452
- 4,
453
- 1059,
454
- 1059,
455
- 3,
456
- 1060,
457
- 1066,
458
- 4,
459
- 1067,
460
- 1067,
461
- 3,
462
- 1068,
463
- 1068,
464
- 4,
465
- 1069,
466
- 1072,
467
- 3,
468
- 1073,
469
- 1076,
470
- 4,
471
- 1077,
472
- 1077,
473
- 3,
474
- 1078,
475
- 1079,
476
- 4,
477
- 1080,
478
- 1080,
479
- 3,
480
- 1081,
481
- 1085,
482
- 4,
483
- 1086,
484
- 1086,
485
- 3,
486
- 1087,
487
- 1090,
488
- 4,
489
- 1091,
490
- 1091,
491
- 3,
492
- 1092,
493
- 1098,
494
- 4,
495
- 1099,
496
- 1099,
497
- 3,
498
- 1100,
499
- 1100,
500
- 4,
501
- 1101,
502
- 1105,
503
- 3,
504
- 1106,
505
- 1107,
506
- 4,
507
- 1108,
508
- 1108,
509
- 3,
510
- 1109,
511
- 1109,
512
- 4,
513
- 1110,
514
- 1111,
515
- 3,
516
- 1112,
517
- 1116,
518
- 4,
519
- 1117,
520
- 1118,
521
- 3,
522
- 1119,
523
- 1153,
524
- 4,
525
- 1155,
526
- 1161,
527
- 16,
528
- 1162,
529
- 1231,
530
- 4,
531
- 1232,
532
- 1235,
533
- 3,
534
- 1236,
535
- 1237,
536
- 4,
537
- 1238,
538
- 1239,
539
- 3,
540
- 1240,
541
- 1249,
542
- 4,
543
- 1250,
544
- 1255,
545
- 3,
546
- 1256,
547
- 1259,
548
- 4,
549
- 1260,
550
- 1267,
551
- 3,
552
- 1268,
553
- 1271,
554
- 4,
555
- 1272,
556
- 1273,
557
- 3,
558
- 1274,
559
- 1327,
560
- 4,
561
- 1329,
562
- 1369,
563
- 17,
564
- 1376,
565
- 1416,
566
- 17,
567
- 1425,
568
- 1469,
569
- 17,
570
- 1471,
571
- 1471,
572
- 17,
573
- 1473,
574
- 1474,
575
- 17,
576
- 1476,
577
- 1477,
578
- 17,
579
- 1479,
580
- 1522,
581
- 17,
582
- 1548,
583
- 1548,
584
- 19,
585
- 1552,
586
- 1562,
587
- 16,
588
- 1563,
589
- 1563,
590
- 19,
591
- 1567,
592
- 1567,
593
- 20,
594
- 1568,
595
- 1599,
596
- 11,
597
- 1600,
598
- 1600,
599
- 16,
600
- 1601,
601
- 1610,
602
- 11,
603
- 1611,
604
- 1616,
605
- 12,
606
- 1617,
607
- 1631,
608
- 16,
609
- 1632,
610
- 1641,
611
- 18,
612
- 1646,
613
- 1647,
614
- 11,
615
- 1648,
616
- 1648,
617
- 12,
618
- 1649,
619
- 1747,
620
- 11,
621
- 1748,
622
- 1748,
623
- 20,
624
- 1749,
625
- 1749,
626
- 11,
627
- 1750,
628
- 1756,
629
- 16,
630
- 1759,
631
- 1764,
632
- 16,
633
- 1765,
634
- 1766,
635
- 11,
636
- 1767,
637
- 1768,
638
- 16,
639
- 1770,
640
- 1773,
641
- 16,
642
- 1774,
643
- 1775,
644
- 11,
645
- 1776,
646
- 1785,
647
- 18,
648
- 1786,
649
- 1788,
650
- 11,
651
- 1791,
652
- 1791,
653
- 11,
654
- 1808,
655
- 1871,
656
- 17,
657
- 1872,
658
- 1919,
659
- 11,
660
- 1920,
661
- 2037,
662
- 17,
663
- 2042,
664
- 2045,
665
- 17,
666
- 2048,
667
- 2093,
668
- 17,
669
- 2112,
670
- 2139,
671
- 17,
672
- 2144,
673
- 2154,
674
- 17,
675
- 2160,
676
- 2183,
677
- 11,
678
- 2185,
679
- 2191,
680
- 11,
681
- 2199,
682
- 2207,
683
- 16,
684
- 2208,
685
- 2249,
686
- 11,
687
- 2250,
688
- 2273,
689
- 16,
690
- 2275,
691
- 2303,
692
- 16,
693
- 2304,
694
- 2384,
695
- 17,
696
- 2385,
697
- 2388,
698
- 16,
699
- 2389,
700
- 2403,
701
- 17,
702
- 2404,
703
- 2405,
704
- 20,
705
- 2406,
706
- 2415,
707
- 17,
708
- 2417,
709
- 2545,
710
- 17,
711
- 2556,
712
- 2556,
713
- 17,
714
- 2558,
715
- 2677,
716
- 17,
717
- 2689,
718
- 2799,
719
- 17,
720
- 2809,
721
- 2927,
722
- 17,
723
- 2929,
724
- 2929,
725
- 17,
726
- 2946,
727
- 3055,
728
- 17,
729
- 3072,
730
- 3183,
731
- 17,
732
- 3200,
733
- 3203,
734
- 17,
735
- 3205,
736
- 3406,
737
- 17,
738
- 3412,
739
- 3415,
740
- 17,
741
- 3423,
742
- 3439,
743
- 17,
744
- 3450,
745
- 3571,
746
- 17,
747
- 3585,
748
- 3630,
749
- 13,
750
- 3631,
751
- 3631,
752
- 16,
753
- 3632,
754
- 3641,
755
- 15,
756
- 3642,
757
- 3642,
758
- 16,
759
- 3648,
760
- 3652,
761
- 14,
762
- 3653,
763
- 3654,
764
- 16,
765
- 3655,
766
- 3655,
767
- 15,
768
- 3656,
769
- 3660,
770
- 16,
771
- 3661,
772
- 3661,
773
- 15,
774
- 3662,
775
- 3662,
776
- 16,
777
- 3664,
778
- 3673,
779
- 18,
780
- 3713,
781
- 3840,
782
- 17,
783
- 3864,
784
- 3865,
785
- 17,
786
- 3872,
787
- 3881,
788
- 17,
789
- 3893,
790
- 3893,
791
- 17,
792
- 3895,
793
- 3895,
794
- 17,
795
- 3897,
796
- 3897,
797
- 17,
798
- 3902,
799
- 3972,
800
- 17,
801
- 3974,
802
- 4028,
803
- 17,
804
- 4038,
805
- 4038,
806
- 17,
807
- 4096,
808
- 4169,
809
- 17,
810
- 4176,
811
- 4253,
812
- 17,
813
- 4256,
814
- 4346,
815
- 17,
816
- 4348,
817
- 4959,
818
- 17,
819
- 4992,
820
- 5007,
821
- 17,
822
- 5024,
823
- 5117,
824
- 17,
825
- 5121,
826
- 5740,
827
- 17,
828
- 5743,
829
- 5759,
830
- 17,
831
- 5760,
832
- 5760,
833
- 22,
834
- 5761,
835
- 5786,
836
- 17,
837
- 5792,
838
- 5866,
839
- 17,
840
- 5873,
841
- 5940,
842
- 17,
843
- 5952,
844
- 6099,
845
- 17,
846
- 6103,
847
- 6103,
848
- 17,
849
- 6108,
850
- 6121,
851
- 17,
852
- 6155,
853
- 6157,
854
- 17,
855
- 6159,
856
- 6459,
857
- 17,
858
- 6470,
859
- 6617,
860
- 17,
861
- 6656,
862
- 6683,
863
- 17,
864
- 6688,
865
- 6809,
866
- 17,
867
- 6823,
868
- 6823,
869
- 17,
870
- 6832,
871
- 6891,
872
- 16,
873
- 6912,
874
- 6988,
875
- 17,
876
- 6992,
877
- 7001,
878
- 17,
879
- 7019,
880
- 7027,
881
- 17,
882
- 7040,
883
- 7155,
884
- 17,
885
- 7168,
886
- 7223,
887
- 17,
888
- 7232,
889
- 7293,
890
- 17,
891
- 7296,
892
- 7306,
893
- 4,
894
- 7312,
895
- 7359,
896
- 17,
897
- 7376,
898
- 7378,
899
- 16,
900
- 7380,
901
- 7392,
902
- 16,
903
- 7393,
904
- 7393,
905
- 17,
906
- 7394,
907
- 7400,
908
- 16,
909
- 7401,
910
- 7404,
911
- 17,
912
- 7405,
913
- 7405,
914
- 16,
915
- 7406,
916
- 7411,
917
- 17,
918
- 7412,
919
- 7412,
920
- 16,
921
- 7413,
922
- 7415,
923
- 17,
924
- 7416,
925
- 7417,
926
- 16,
927
- 7418,
928
- 7418,
929
- 17,
930
- 7424,
931
- 7461,
932
- 2,
933
- 7462,
934
- 7466,
935
- 17,
936
- 7467,
937
- 7467,
938
- 4,
939
- 7468,
940
- 7516,
941
- 2,
942
- 7517,
943
- 7521,
944
- 17,
945
- 7522,
946
- 7525,
947
- 2,
948
- 7526,
949
- 7530,
950
- 17,
951
- 7531,
952
- 7543,
953
- 2,
954
- 7544,
955
- 7544,
956
- 4,
957
- 7545,
958
- 7614,
959
- 2,
960
- 7615,
961
- 7615,
962
- 17,
963
- 7616,
964
- 7679,
965
- 16,
966
- 7680,
967
- 7681,
968
- 1,
969
- 7682,
970
- 7699,
971
- 2,
972
- 7700,
973
- 7709,
974
- 1,
975
- 7710,
976
- 7723,
977
- 2,
978
- 7724,
979
- 7727,
980
- 1,
981
- 7728,
982
- 7755,
983
- 2,
984
- 7756,
985
- 7763,
986
- 1,
987
- 7764,
988
- 7793,
989
- 2,
990
- 7794,
991
- 7803,
992
- 1,
993
- 7804,
994
- 7821,
995
- 2,
996
- 7822,
997
- 7823,
998
- 1,
999
- 7824,
1000
- 7832,
1001
- 2,
1002
- 7833,
1003
- 7833,
1004
- 1,
1005
- 7834,
1006
- 7839,
1007
- 2,
1008
- 7840,
1009
- 7929,
1010
- 1,
1011
- 7930,
1012
- 7935,
1013
- 2,
1014
- 7936,
1015
- 8124,
1016
- 17,
1017
- 8126,
1018
- 8126,
1019
- 17,
1020
- 8130,
1021
- 8140,
1022
- 17,
1023
- 8144,
1024
- 8155,
1025
- 17,
1026
- 8160,
1027
- 8172,
1028
- 17,
1029
- 8178,
1030
- 8188,
1031
- 17,
1032
- 8192,
1033
- 8202,
1034
- 22,
1035
- 8204,
1036
- 8205,
1037
- 21,
1038
- 8211,
1039
- 8212,
1040
- 19,
1041
- 8217,
1042
- 8217,
1043
- 21,
1044
- 8230,
1045
- 8230,
1046
- 20,
1047
- 8232,
1048
- 8233,
1049
- 22,
1050
- 8239,
1051
- 8239,
1052
- 22,
1053
- 8253,
1054
- 8253,
1055
- 20,
1056
- 8263,
1057
- 8265,
1058
- 20,
1059
- 8287,
1060
- 8287,
1061
- 22,
1062
- 8305,
1063
- 8305,
1064
- 2,
1065
- 8319,
1066
- 8319,
1067
- 2,
1068
- 8336,
1069
- 8348,
1070
- 2,
1071
- 8400,
1072
- 8432,
1073
- 16,
1074
- 8450,
1075
- 8450,
1076
- 17,
1077
- 8455,
1078
- 8455,
1079
- 17,
1080
- 8458,
1081
- 8467,
1082
- 17,
1083
- 8469,
1084
- 8469,
1085
- 17,
1086
- 8473,
1087
- 8477,
1088
- 17,
1089
- 8484,
1090
- 8484,
1091
- 17,
1092
- 8486,
1093
- 8486,
1094
- 17,
1095
- 8488,
1096
- 8488,
1097
- 17,
1098
- 8490,
1099
- 8490,
1100
- 2,
1101
- 8491,
1102
- 8491,
1103
- 1,
1104
- 8492,
1105
- 8493,
1106
- 17,
1107
- 8495,
1108
- 8497,
1109
- 17,
1110
- 8498,
1111
- 8498,
1112
- 2,
1113
- 8499,
1114
- 8505,
1115
- 17,
1116
- 8508,
1117
- 8511,
1118
- 17,
1119
- 8517,
1120
- 8521,
1121
- 17,
1122
- 8526,
1123
- 8526,
1124
- 2,
1125
- 8579,
1126
- 8580,
1127
- 2,
1128
- 11264,
1129
- 11359,
1130
- 17,
1131
- 11360,
1132
- 11391,
1133
- 2,
1134
- 11392,
1135
- 11492,
1136
- 17,
1137
- 11499,
1138
- 11507,
1139
- 17,
1140
- 11520,
1141
- 11631,
1142
- 17,
1143
- 11647,
1144
- 11742,
1145
- 17,
1146
- 11744,
1147
- 11775,
1148
- 16,
1149
- 11823,
1150
- 11823,
1151
- 17,
1152
- 12288,
1153
- 12288,
1154
- 22,
1155
- 12289,
1156
- 12289,
1157
- 19,
1158
- 12290,
1159
- 12290,
1160
- 20,
1161
- 12293,
1162
- 12293,
1163
- 5,
1164
- 12294,
1165
- 12294,
1166
- 17,
1167
- 12330,
1168
- 12335,
1169
- 16,
1170
- 12337,
1171
- 12341,
1172
- 17,
1173
- 12347,
1174
- 12347,
1175
- 5,
1176
- 12348,
1177
- 12348,
1178
- 17,
1179
- 12353,
1180
- 12353,
1181
- 7,
1182
- 12354,
1183
- 12354,
1184
- 6,
1185
- 12355,
1186
- 12355,
1187
- 7,
1188
- 12356,
1189
- 12356,
1190
- 6,
1191
- 12357,
1192
- 12357,
1193
- 7,
1194
- 12358,
1195
- 12358,
1196
- 6,
1197
- 12359,
1198
- 12359,
1199
- 7,
1200
- 12360,
1201
- 12360,
1202
- 6,
1203
- 12361,
1204
- 12361,
1205
- 7,
1206
- 12362,
1207
- 12386,
1208
- 6,
1209
- 12387,
1210
- 12387,
1211
- 8,
1212
- 12388,
1213
- 12418,
1214
- 6,
1215
- 12419,
1216
- 12419,
1217
- 7,
1218
- 12420,
1219
- 12420,
1220
- 6,
1221
- 12421,
1222
- 12421,
1223
- 7,
1224
- 12422,
1225
- 12422,
1226
- 6,
1227
- 12423,
1228
- 12423,
1229
- 7,
1230
- 12424,
1231
- 12429,
1232
- 6,
1233
- 12430,
1234
- 12430,
1235
- 7,
1236
- 12431,
1237
- 12436,
1238
- 6,
1239
- 12437,
1240
- 12438,
1241
- 7,
1242
- 12441,
1243
- 12444,
1244
- 16,
1245
- 12445,
1246
- 12447,
1247
- 6,
1248
- 12449,
1249
- 12449,
1250
- 7,
1251
- 12450,
1252
- 12450,
1253
- 6,
1254
- 12451,
1255
- 12451,
1256
- 7,
1257
- 12452,
1258
- 12452,
1259
- 6,
1260
- 12453,
1261
- 12453,
1262
- 7,
1263
- 12454,
1264
- 12454,
1265
- 6,
1266
- 12455,
1267
- 12455,
1268
- 7,
1269
- 12456,
1270
- 12456,
1271
- 6,
1272
- 12457,
1273
- 12457,
1274
- 7,
1275
- 12458,
1276
- 12482,
1277
- 6,
1278
- 12483,
1279
- 12483,
1280
- 8,
1281
- 12484,
1282
- 12514,
1283
- 6,
1284
- 12515,
1285
- 12515,
1286
- 7,
1287
- 12516,
1288
- 12516,
1289
- 6,
1290
- 12517,
1291
- 12517,
1292
- 7,
1293
- 12518,
1294
- 12518,
1295
- 6,
1296
- 12519,
1297
- 12519,
1298
- 7,
1299
- 12520,
1300
- 12525,
1301
- 6,
1302
- 12526,
1303
- 12526,
1304
- 7,
1305
- 12527,
1306
- 12538,
1307
- 6,
1308
- 12540,
1309
- 12540,
1310
- 9,
1311
- 12541,
1312
- 12543,
1313
- 6,
1314
- 12549,
1315
- 12686,
1316
- 17,
1317
- 12704,
1318
- 12735,
1319
- 17,
1320
- 12784,
1321
- 12799,
1322
- 7,
1323
- 13312,
1324
- 19903,
1325
- 5,
1326
- 19968,
1327
- 40959,
1328
- 5,
1329
- 40960,
1330
- 42124,
1331
- 17,
1332
- 42192,
1333
- 42237,
1334
- 17,
1335
- 42240,
1336
- 42508,
1337
- 17,
1338
- 42512,
1339
- 42539,
1340
- 17,
1341
- 42560,
1342
- 42606,
1343
- 4,
1344
- 42607,
1345
- 42610,
1346
- 16,
1347
- 42612,
1348
- 42621,
1349
- 16,
1350
- 42623,
1351
- 42653,
1352
- 4,
1353
- 42654,
1354
- 42655,
1355
- 16,
1356
- 42656,
1357
- 42725,
1358
- 17,
1359
- 42736,
1360
- 42737,
1361
- 17,
1362
- 42775,
1363
- 42783,
1364
- 17,
1365
- 42786,
1366
- 42887,
1367
- 2,
1368
- 42888,
1369
- 42888,
1370
- 17,
1371
- 42891,
1372
- 43007,
1373
- 2,
1374
- 43008,
1375
- 43047,
1376
- 17,
1377
- 43052,
1378
- 43052,
1379
- 17,
1380
- 43072,
1381
- 43123,
1382
- 17,
1383
- 43136,
1384
- 43205,
1385
- 17,
1386
- 43216,
1387
- 43255,
1388
- 17,
1389
- 43259,
1390
- 43259,
1391
- 17,
1392
- 43261,
1393
- 43309,
1394
- 17,
1395
- 43312,
1396
- 43347,
1397
- 17,
1398
- 43360,
1399
- 43456,
1400
- 17,
1401
- 43471,
1402
- 43481,
1403
- 17,
1404
- 43488,
1405
- 43609,
1406
- 17,
1407
- 43616,
1408
- 43638,
1409
- 17,
1410
- 43642,
1411
- 43741,
1412
- 17,
1413
- 43744,
1414
- 43759,
1415
- 17,
1416
- 43762,
1417
- 43822,
1418
- 17,
1419
- 43824,
1420
- 43866,
1421
- 2,
1422
- 43868,
1423
- 43876,
1424
- 2,
1425
- 43877,
1426
- 43877,
1427
- 17,
1428
- 43878,
1429
- 43881,
1430
- 2,
1431
- 43888,
1432
- 44010,
1433
- 17,
1434
- 44012,
1435
- 44025,
1436
- 17,
1437
- 44032,
1438
- 55203,
1439
- 10,
1440
- 55216,
1441
- 55291,
1442
- 17,
1443
- 63744,
1444
- 64217,
1445
- 5,
1446
- 64256,
1447
- 64262,
1448
- 2,
1449
- 64275,
1450
- 64296,
1451
- 17,
1452
- 64298,
1453
- 64335,
1454
- 17,
1455
- 64336,
1456
- 64433,
1457
- 11,
1458
- 64467,
1459
- 64829,
1460
- 11,
1461
- 64848,
1462
- 64911,
1463
- 11,
1464
- 64914,
1465
- 64967,
1466
- 11,
1467
- 65008,
1468
- 65019,
1469
- 11,
1470
- 65024,
1471
- 65039,
1472
- 16,
1473
- 65056,
1474
- 65071,
1475
- 16,
1476
- 65104,
1477
- 65105,
1478
- 19,
1479
- 65136,
1480
- 65276,
1481
- 11,
1482
- 65281,
1483
- 65281,
1484
- 20,
1485
- 65292,
1486
- 65292,
1487
- 19,
1488
- 65294,
1489
- 65294,
1490
- 20,
1491
- 65296,
1492
- 65305,
1493
- 18,
1494
- 65306,
1495
- 65307,
1496
- 19,
1497
- 65311,
1498
- 65311,
1499
- 20,
1500
- 65313,
1501
- 65338,
1502
- 2,
1503
- 65345,
1504
- 65370,
1505
- 2,
1506
- 65377,
1507
- 65377,
1508
- 20,
1509
- 65380,
1510
- 65380,
1511
- 19,
1512
- 65382,
1513
- 65382,
1514
- 6,
1515
- 65383,
1516
- 65390,
1517
- 7,
1518
- 65391,
1519
- 65391,
1520
- 8,
1521
- 65392,
1522
- 65392,
1523
- 9,
1524
- 65393,
1525
- 65437,
1526
- 6,
1527
- 65438,
1528
- 65439,
1529
- 16,
1530
- 65440,
1531
- 65500,
1532
- 17,
1533
- 65536,
1534
- 65786,
1535
- 17,
1536
- 66045,
1537
- 66045,
1538
- 16,
1539
- 66176,
1540
- 66256,
1541
- 17,
1542
- 66272,
1543
- 66272,
1544
- 16,
1545
- 66304,
1546
- 66335,
1547
- 17,
1548
- 66349,
1549
- 66368,
1550
- 17,
1551
- 66370,
1552
- 66377,
1553
- 17,
1554
- 66384,
1555
- 66461,
1556
- 17,
1557
- 66464,
1558
- 66511,
1559
- 17,
1560
- 66560,
1561
- 66915,
1562
- 17,
1563
- 66928,
1564
- 67431,
1565
- 17,
1566
- 67456,
1567
- 67514,
1568
- 2,
1569
- 67584,
1570
- 67669,
1571
- 17,
1572
- 67680,
1573
- 67702,
1574
- 17,
1575
- 67712,
1576
- 67742,
1577
- 17,
1578
- 67808,
1579
- 67829,
1580
- 17,
1581
- 67840,
1582
- 67861,
1583
- 17,
1584
- 67872,
1585
- 67897,
1586
- 17,
1587
- 67904,
1588
- 68023,
1589
- 17,
1590
- 68030,
1591
- 68031,
1592
- 17,
1593
- 68096,
1594
- 68159,
1595
- 17,
1596
- 68192,
1597
- 68220,
1598
- 17,
1599
- 68224,
1600
- 68252,
1601
- 17,
1602
- 68288,
1603
- 68295,
1604
- 17,
1605
- 68297,
1606
- 68326,
1607
- 17,
1608
- 68352,
1609
- 68405,
1610
- 17,
1611
- 68416,
1612
- 68437,
1613
- 17,
1614
- 68448,
1615
- 68466,
1616
- 17,
1617
- 68480,
1618
- 68497,
1619
- 17,
1620
- 68608,
1621
- 68850,
1622
- 17,
1623
- 68864,
1624
- 68973,
1625
- 17,
1626
- 68975,
1627
- 68997,
1628
- 17,
1629
- 69248,
1630
- 69292,
1631
- 17,
1632
- 69296,
1633
- 69297,
1634
- 17,
1635
- 69314,
1636
- 69319,
1637
- 11,
1638
- 69370,
1639
- 69375,
1640
- 16,
1641
- 69376,
1642
- 69404,
1643
- 17,
1644
- 69415,
1645
- 69456,
1646
- 17,
1647
- 69488,
1648
- 69509,
1649
- 17,
1650
- 69552,
1651
- 69572,
1652
- 17,
1653
- 69600,
1654
- 69702,
1655
- 17,
1656
- 69734,
1657
- 69818,
1658
- 17,
1659
- 69826,
1660
- 69826,
1661
- 17,
1662
- 69840,
1663
- 69951,
1664
- 17,
1665
- 69956,
1666
- 70003,
1667
- 17,
1668
- 70006,
1669
- 70084,
1670
- 17,
1671
- 70089,
1672
- 70092,
1673
- 17,
1674
- 70094,
1675
- 70106,
1676
- 17,
1677
- 70108,
1678
- 70108,
1679
- 17,
1680
- 70144,
1681
- 70199,
1682
- 17,
1683
- 70206,
1684
- 70312,
1685
- 17,
1686
- 70320,
1687
- 70457,
1688
- 17,
1689
- 70459,
1690
- 70459,
1691
- 16,
1692
- 70460,
1693
- 70611,
1694
- 17,
1695
- 70625,
1696
- 70730,
1697
- 17,
1698
- 70736,
1699
- 70745,
1700
- 17,
1701
- 70750,
1702
- 70853,
1703
- 17,
1704
- 70855,
1705
- 71104,
1706
- 17,
1707
- 71128,
1708
- 71232,
1709
- 17,
1710
- 71236,
1711
- 71257,
1712
- 17,
1713
- 71296,
1714
- 71352,
1715
- 17,
1716
- 71360,
1717
- 71481,
1718
- 17,
1719
- 71488,
1720
- 71738,
1721
- 17,
1722
- 71840,
1723
- 71913,
1724
- 17,
1725
- 71935,
1726
- 72003,
1727
- 17,
1728
- 72016,
1729
- 72161,
1730
- 17,
1731
- 72163,
1732
- 72254,
1733
- 17,
1734
- 72263,
1735
- 72345,
1736
- 17,
1737
- 72349,
1738
- 72349,
1739
- 17,
1740
- 72368,
1741
- 72440,
1742
- 17,
1743
- 72544,
1744
- 72672,
1745
- 17,
1746
- 72688,
1747
- 72768,
1748
- 17,
1749
- 72784,
1750
- 72793,
1751
- 17,
1752
- 72818,
1753
- 73462,
1754
- 17,
1755
- 73472,
1756
- 73538,
1757
- 17,
1758
- 73552,
1759
- 73648,
1760
- 17,
1761
- 73728,
1762
- 74649,
1763
- 17,
1764
- 74880,
1765
- 77808,
1766
- 17,
1767
- 77824,
1768
- 78895,
1769
- 17,
1770
- 78912,
1771
- 92777,
1772
- 17,
1773
- 92784,
1774
- 92916,
1775
- 17,
1776
- 92928,
1777
- 92982,
1778
- 17,
1779
- 92992,
1780
- 92995,
1781
- 17,
1782
- 93008,
1783
- 93017,
1784
- 17,
1785
- 93027,
1786
- 93548,
1787
- 17,
1788
- 93552,
1789
- 93823,
1790
- 17,
1791
- 93856,
1792
- 94177,
1793
- 17,
1794
- 94179,
1795
- 94179,
1796
- 5,
1797
- 94180,
1798
- 94180,
1799
- 17,
1800
- 94192,
1801
- 94193,
1802
- 16,
1803
- 94194,
1804
- 94195,
1805
- 5,
1806
- 94208,
1807
- 101874,
1808
- 17,
1809
- 110576,
1810
- 110951,
1811
- 6,
1812
- 110960,
1813
- 113817,
1814
- 17,
1815
- 113821,
1816
- 113822,
1817
- 17,
1818
- 118e3,
1819
- 118009,
1820
- 17,
1821
- 118528,
1822
- 118598,
1823
- 16,
1824
- 119141,
1825
- 119142,
1826
- 17,
1827
- 119143,
1828
- 119145,
1829
- 16,
1830
- 119149,
1831
- 119154,
1832
- 17,
1833
- 119163,
1834
- 119170,
1835
- 16,
1836
- 119173,
1837
- 119179,
1838
- 16,
1839
- 119210,
1840
- 119213,
1841
- 16,
1842
- 119362,
1843
- 119364,
1844
- 17,
1845
- 119808,
1846
- 120512,
1847
- 17,
1848
- 120514,
1849
- 120538,
1850
- 17,
1851
- 120540,
1852
- 120570,
1853
- 17,
1854
- 120572,
1855
- 120596,
1856
- 17,
1857
- 120598,
1858
- 120628,
1859
- 17,
1860
- 120630,
1861
- 120654,
1862
- 17,
1863
- 120656,
1864
- 120686,
1865
- 17,
1866
- 120688,
1867
- 120712,
1868
- 17,
1869
- 120714,
1870
- 120744,
1871
- 17,
1872
- 120746,
1873
- 120770,
1874
- 17,
1875
- 120772,
1876
- 120831,
1877
- 17,
1878
- 121344,
1879
- 121398,
1880
- 17,
1881
- 121403,
1882
- 121452,
1883
- 17,
1884
- 121461,
1885
- 121461,
1886
- 17,
1887
- 121476,
1888
- 121476,
1889
- 17,
1890
- 121499,
1891
- 121519,
1892
- 17,
1893
- 122624,
1894
- 122666,
1895
- 2,
1896
- 122880,
1897
- 122922,
1898
- 17,
1899
- 122928,
1900
- 122989,
1901
- 4,
1902
- 123023,
1903
- 123023,
1904
- 16,
1905
- 123136,
1906
- 123214,
1907
- 17,
1908
- 123536,
1909
- 123641,
1910
- 17,
1911
- 124112,
1912
- 124410,
1913
- 17,
1914
- 124608,
1915
- 125124,
1916
- 17,
1917
- 125136,
1918
- 125273,
1919
- 17,
1920
- 126464,
1921
- 126651,
1922
- 11,
1923
- 130032,
1924
- 130041,
1925
- 17,
1926
- 131072,
1927
- 210041,
1928
- 5,
1929
- 917760,
1930
- 917999,
1931
- 16
1932
- ];
1933
- var SPEECH_VOWELS = ["", "a", "e", "i", "o", "u", "\u0259"];
1934
- var SPEECH_VOWEL_WEAK = 8;
1935
- var SPEECH_VOWEL_RANGES = [
1936
- 65,
1937
- 65,
1938
- 1,
1939
- 69,
1940
- 69,
1941
- 2,
1942
- 73,
1943
- 73,
1944
- 3,
1945
- 79,
1946
- 79,
1947
- 4,
1948
- 85,
1949
- 85,
1950
- 5,
1951
- 89,
1952
- 89,
1953
- 11,
1954
- 97,
1955
- 97,
1956
- 1,
1957
- 101,
1958
- 101,
1959
- 2,
1960
- 105,
1961
- 105,
1962
- 3,
1963
- 111,
1964
- 111,
1965
- 4,
1966
- 117,
1967
- 117,
1968
- 5,
1969
- 121,
1970
- 121,
1971
- 11,
1972
- 192,
1973
- 197,
1974
- 1,
1975
- 198,
1976
- 198,
1977
- 2,
1978
- 200,
1979
- 203,
1980
- 2,
1981
- 204,
1982
- 207,
1983
- 3,
1984
- 210,
1985
- 214,
1986
- 4,
1987
- 216,
1988
- 216,
1989
- 4,
1990
- 217,
1991
- 220,
1992
- 5,
1993
- 221,
1994
- 221,
1995
- 11,
1996
- 224,
1997
- 229,
1998
- 1,
1999
- 230,
2000
- 230,
2001
- 2,
2002
- 232,
2003
- 235,
2004
- 2,
2005
- 236,
2006
- 239,
2007
- 3,
2008
- 242,
2009
- 246,
2010
- 4,
2011
- 248,
2012
- 248,
2013
- 4,
2014
- 249,
2015
- 252,
2016
- 5,
2017
- 253,
2018
- 253,
2019
- 11,
2020
- 255,
2021
- 255,
2022
- 11,
2023
- 256,
2024
- 261,
2025
- 1,
2026
- 274,
2027
- 283,
2028
- 2,
2029
- 296,
2030
- 305,
2031
- 3,
2032
- 332,
2033
- 337,
2034
- 4,
2035
- 338,
2036
- 339,
2037
- 2,
2038
- 360,
2039
- 371,
2040
- 5,
2041
- 374,
2042
- 376,
2043
- 11,
2044
- 416,
2045
- 417,
2046
- 4,
2047
- 431,
2048
- 432,
2049
- 5,
2050
- 461,
2051
- 462,
2052
- 1,
2053
- 463,
2054
- 464,
2055
- 3,
2056
- 465,
2057
- 466,
2058
- 4,
2059
- 467,
2060
- 476,
2061
- 5,
2062
- 478,
2063
- 481,
2064
- 1,
2065
- 482,
2066
- 483,
2067
- 2,
2068
- 490,
2069
- 493,
2070
- 4,
2071
- 506,
2072
- 507,
2073
- 1,
2074
- 508,
2075
- 509,
2076
- 2,
2077
- 510,
2078
- 511,
2079
- 4,
2080
- 512,
2081
- 515,
2082
- 1,
2083
- 516,
2084
- 519,
2085
- 2,
2086
- 520,
2087
- 523,
2088
- 3,
2089
- 524,
2090
- 527,
2091
- 4,
2092
- 532,
2093
- 535,
2094
- 5,
2095
- 550,
2096
- 551,
2097
- 1,
2098
- 552,
2099
- 553,
2100
- 2,
2101
- 554,
2102
- 561,
2103
- 4,
2104
- 562,
2105
- 563,
2106
- 11,
2107
- 1024,
2108
- 1024,
2109
- 2,
2110
- 1025,
2111
- 1025,
2112
- 4,
2113
- 1028,
2114
- 1028,
2115
- 2,
2116
- 1030,
2117
- 1031,
2118
- 3,
2119
- 1037,
2120
- 1037,
2121
- 3,
2122
- 1038,
2123
- 1038,
2124
- 5,
2125
- 1040,
2126
- 1040,
2127
- 1,
2128
- 1045,
2129
- 1045,
2130
- 2,
2131
- 1048,
2132
- 1048,
2133
- 3,
2134
- 1054,
2135
- 1054,
2136
- 4,
2137
- 1059,
2138
- 1059,
2139
- 5,
2140
- 1067,
2141
- 1067,
2142
- 3,
2143
- 1069,
2144
- 1069,
2145
- 2,
2146
- 1070,
2147
- 1070,
2148
- 5,
2149
- 1071,
2150
- 1072,
2151
- 1,
2152
- 1077,
2153
- 1077,
2154
- 2,
2155
- 1080,
2156
- 1080,
2157
- 3,
2158
- 1086,
2159
- 1086,
2160
- 4,
2161
- 1091,
2162
- 1091,
2163
- 5,
2164
- 1099,
2165
- 1099,
2166
- 3,
2167
- 1101,
2168
- 1101,
2169
- 2,
2170
- 1102,
2171
- 1102,
2172
- 5,
2173
- 1103,
2174
- 1103,
2175
- 1,
2176
- 1104,
2177
- 1104,
2178
- 2,
2179
- 1105,
2180
- 1105,
2181
- 4,
2182
- 1108,
2183
- 1108,
2184
- 2,
2185
- 1110,
2186
- 1111,
2187
- 3,
2188
- 1117,
2189
- 1117,
2190
- 3,
2191
- 1118,
2192
- 1118,
2193
- 5,
2194
- 1232,
2195
- 1235,
2196
- 1,
2197
- 1238,
2198
- 1239,
2199
- 2,
2200
- 1250,
2201
- 1253,
2202
- 3,
2203
- 1254,
2204
- 1255,
2205
- 4,
2206
- 1260,
2207
- 1261,
2208
- 2,
2209
- 1262,
2210
- 1267,
2211
- 5,
2212
- 1272,
2213
- 1273,
2214
- 3,
2215
- 1611,
2216
- 1611,
2217
- 1,
2218
- 1612,
2219
- 1612,
2220
- 5,
2221
- 1613,
2222
- 1613,
2223
- 3,
2224
- 1614,
2225
- 1614,
2226
- 1,
2227
- 1615,
2228
- 1615,
2229
- 5,
2230
- 1616,
2231
- 1616,
2232
- 3,
2233
- 1648,
2234
- 1648,
2235
- 1,
2236
- 3632,
2237
- 3633,
2238
- 9,
2239
- 3634,
2240
- 3634,
2241
- 1,
2242
- 3635,
2243
- 3635,
2244
- 9,
2245
- 3636,
2246
- 3639,
2247
- 3,
2248
- 3640,
2249
- 3641,
2250
- 5,
2251
- 3648,
2252
- 3649,
2253
- 10,
2254
- 3650,
2255
- 3650,
2256
- 12,
2257
- 3651,
2258
- 3652,
2259
- 9,
2260
- 7680,
2261
- 7681,
2262
- 1,
2263
- 7700,
2264
- 7709,
2265
- 2,
2266
- 7724,
2267
- 7727,
2268
- 3,
2269
- 7756,
2270
- 7763,
2271
- 4,
2272
- 7794,
2273
- 7803,
2274
- 5,
2275
- 7822,
2276
- 7823,
2277
- 11,
2278
- 7833,
2279
- 7833,
2280
- 11,
2281
- 7840,
2282
- 7863,
2283
- 1,
2284
- 7864,
2285
- 7879,
2286
- 2,
2287
- 7880,
2288
- 7883,
2289
- 3,
2290
- 7884,
2291
- 7907,
2292
- 4,
2293
- 7908,
2294
- 7921,
2295
- 5,
2296
- 7922,
2297
- 7929,
2298
- 11,
2299
- 8491,
2300
- 8491,
2301
- 1,
2302
- 12353,
2303
- 12353,
2304
- 1,
2305
- 12354,
2306
- 12354,
2307
- 9,
2308
- 12355,
2309
- 12355,
2310
- 3,
2311
- 12356,
2312
- 12356,
2313
- 11,
2314
- 12357,
2315
- 12357,
2316
- 5,
2317
- 12358,
2318
- 12358,
2319
- 13,
2320
- 12359,
2321
- 12359,
2322
- 2,
2323
- 12360,
2324
- 12360,
2325
- 10,
2326
- 12361,
2327
- 12361,
2328
- 4,
2329
- 12362,
2330
- 12362,
2331
- 12,
2332
- 12363,
2333
- 12364,
2334
- 9,
2335
- 12365,
2336
- 12366,
2337
- 11,
2338
- 12367,
2339
- 12368,
2340
- 13,
2341
- 12369,
2342
- 12370,
2343
- 10,
2344
- 12371,
2345
- 12372,
2346
- 12,
2347
- 12373,
2348
- 12374,
2349
- 9,
2350
- 12375,
2351
- 12376,
2352
- 11,
2353
- 12377,
2354
- 12378,
2355
- 13,
2356
- 12379,
2357
- 12380,
2358
- 10,
2359
- 12381,
2360
- 12382,
2361
- 12,
2362
- 12383,
2363
- 12384,
2364
- 9,
2365
- 12385,
2366
- 12386,
2367
- 11,
2368
- 12388,
2369
- 12389,
2370
- 13,
2371
- 12390,
2372
- 12391,
2373
- 10,
2374
- 12392,
2375
- 12393,
2376
- 12,
2377
- 12394,
2378
- 12394,
2379
- 9,
2380
- 12395,
2381
- 12395,
2382
- 11,
2383
- 12396,
2384
- 12396,
2385
- 13,
2386
- 12397,
2387
- 12397,
2388
- 10,
2389
- 12398,
2390
- 12398,
2391
- 12,
2392
- 12399,
2393
- 12401,
2394
- 9,
2395
- 12402,
2396
- 12404,
2397
- 11,
2398
- 12405,
2399
- 12407,
2400
- 13,
2401
- 12408,
2402
- 12410,
2403
- 10,
2404
- 12411,
2405
- 12413,
2406
- 12,
2407
- 12414,
2408
- 12414,
2409
- 9,
2410
- 12415,
2411
- 12415,
2412
- 11,
2413
- 12416,
2414
- 12416,
2415
- 13,
2416
- 12417,
2417
- 12417,
2418
- 10,
2419
- 12418,
2420
- 12418,
2421
- 12,
2422
- 12419,
2423
- 12419,
2424
- 1,
2425
- 12420,
2426
- 12420,
2427
- 9,
2428
- 12421,
2429
- 12421,
2430
- 5,
2431
- 12422,
2432
- 12422,
2433
- 13,
2434
- 12423,
2435
- 12423,
2436
- 4,
2437
- 12424,
2438
- 12424,
2439
- 12,
2440
- 12425,
2441
- 12425,
2442
- 9,
2443
- 12426,
2444
- 12426,
2445
- 11,
2446
- 12427,
2447
- 12427,
2448
- 13,
2449
- 12428,
2450
- 12428,
2451
- 10,
2452
- 12429,
2453
- 12429,
2454
- 12,
2455
- 12430,
2456
- 12430,
2457
- 1,
2458
- 12431,
2459
- 12431,
2460
- 9,
2461
- 12432,
2462
- 12432,
2463
- 11,
2464
- 12433,
2465
- 12433,
2466
- 10,
2467
- 12434,
2468
- 12434,
2469
- 12,
2470
- 12436,
2471
- 12436,
2472
- 13,
2473
- 12437,
2474
- 12437,
2475
- 1,
2476
- 12438,
2477
- 12438,
2478
- 2,
2479
- 12447,
2480
- 12447,
2481
- 12,
2482
- 12449,
2483
- 12449,
2484
- 1,
2485
- 12450,
2486
- 12450,
2487
- 9,
2488
- 12451,
2489
- 12451,
2490
- 3,
2491
- 12452,
2492
- 12452,
2493
- 11,
2494
- 12453,
2495
- 12453,
2496
- 5,
2497
- 12454,
2498
- 12454,
2499
- 13,
2500
- 12455,
2501
- 12455,
2502
- 2,
2503
- 12456,
2504
- 12456,
2505
- 10,
2506
- 12457,
2507
- 12457,
2508
- 4,
2509
- 12458,
2510
- 12458,
2511
- 12,
2512
- 12459,
2513
- 12460,
2514
- 9,
2515
- 12461,
2516
- 12462,
2517
- 11,
2518
- 12463,
2519
- 12464,
2520
- 13,
2521
- 12465,
2522
- 12466,
2523
- 10,
2524
- 12467,
2525
- 12468,
2526
- 12,
2527
- 12469,
2528
- 12470,
2529
- 9,
2530
- 12471,
2531
- 12472,
2532
- 11,
2533
- 12473,
2534
- 12474,
2535
- 13,
2536
- 12475,
2537
- 12476,
2538
- 10,
2539
- 12477,
2540
- 12478,
2541
- 12,
2542
- 12479,
2543
- 12480,
2544
- 9,
2545
- 12481,
2546
- 12482,
2547
- 11,
2548
- 12484,
2549
- 12485,
2550
- 13,
2551
- 12486,
2552
- 12487,
2553
- 10,
2554
- 12488,
2555
- 12489,
2556
- 12,
2557
- 12490,
2558
- 12490,
2559
- 9,
2560
- 12491,
2561
- 12491,
2562
- 11,
2563
- 12492,
2564
- 12492,
2565
- 13,
2566
- 12493,
2567
- 12493,
2568
- 10,
2569
- 12494,
2570
- 12494,
2571
- 12,
2572
- 12495,
2573
- 12497,
2574
- 9,
2575
- 12498,
2576
- 12500,
2577
- 11,
2578
- 12501,
2579
- 12503,
2580
- 13,
2581
- 12504,
2582
- 12506,
2583
- 10,
2584
- 12507,
2585
- 12509,
2586
- 12,
2587
- 12510,
2588
- 12510,
2589
- 9,
2590
- 12511,
2591
- 12511,
2592
- 11,
2593
- 12512,
2594
- 12512,
2595
- 13,
2596
- 12513,
2597
- 12513,
2598
- 10,
2599
- 12514,
2600
- 12514,
2601
- 12,
2602
- 12515,
2603
- 12515,
2604
- 1,
2605
- 12516,
2606
- 12516,
2607
- 9,
2608
- 12517,
2609
- 12517,
2610
- 5,
2611
- 12518,
2612
- 12518,
2613
- 13,
2614
- 12519,
2615
- 12519,
2616
- 4,
2617
- 12520,
2618
- 12520,
2619
- 12,
2620
- 12521,
2621
- 12521,
2622
- 9,
2623
- 12522,
2624
- 12522,
2625
- 11,
2626
- 12523,
2627
- 12523,
2628
- 13,
2629
- 12524,
2630
- 12524,
2631
- 10,
2632
- 12525,
2633
- 12525,
2634
- 12,
2635
- 12526,
2636
- 12526,
2637
- 1,
2638
- 12527,
2639
- 12527,
2640
- 9,
2641
- 12528,
2642
- 12528,
2643
- 11,
2644
- 12529,
2645
- 12529,
2646
- 10,
2647
- 12530,
2648
- 12530,
2649
- 12,
2650
- 12532,
2651
- 12532,
2652
- 13,
2653
- 12533,
2654
- 12533,
2655
- 9,
2656
- 12534,
2657
- 12534,
2658
- 10,
2659
- 12535,
2660
- 12535,
2661
- 9,
2662
- 12536,
2663
- 12536,
2664
- 11,
2665
- 12537,
2666
- 12537,
2667
- 10,
2668
- 12538,
2669
- 12538,
2670
- 12,
2671
- 12543,
2672
- 12543,
2673
- 12,
2674
- 12784,
2675
- 12784,
2676
- 5,
2677
- 12785,
2678
- 12785,
2679
- 3,
2680
- 12786,
2681
- 12786,
2682
- 5,
2683
- 12787,
2684
- 12787,
2685
- 4,
2686
- 12788,
2687
- 12788,
2688
- 5,
2689
- 12789,
2690
- 12789,
2691
- 1,
2692
- 12790,
2693
- 12790,
2694
- 3,
2695
- 12791,
2696
- 12791,
2697
- 5,
2698
- 12792,
2699
- 12792,
2700
- 2,
2701
- 12793,
2702
- 12793,
2703
- 4,
2704
- 12794,
2705
- 12794,
2706
- 5,
2707
- 12795,
2708
- 12795,
2709
- 1,
2710
- 12796,
2711
- 12796,
2712
- 3,
2713
- 12797,
2714
- 12797,
2715
- 5,
2716
- 12798,
2717
- 12798,
2718
- 2,
2719
- 12799,
2720
- 12799,
2721
- 4,
2722
- 65382,
2723
- 65382,
2724
- 12,
2725
- 65383,
2726
- 65383,
2727
- 1,
2728
- 65384,
2729
- 65384,
2730
- 3,
2731
- 65385,
2732
- 65385,
2733
- 5,
2734
- 65386,
2735
- 65386,
2736
- 2,
2737
- 65387,
2738
- 65387,
2739
- 4,
2740
- 65388,
2741
- 65388,
2742
- 1,
2743
- 65389,
2744
- 65389,
2745
- 5,
2746
- 65390,
2747
- 65390,
2748
- 4,
2749
- 65393,
2750
- 65393,
2751
- 9,
2752
- 65394,
2753
- 65394,
2754
- 11,
2755
- 65395,
2756
- 65395,
2757
- 13,
2758
- 65396,
2759
- 65396,
2760
- 10,
2761
- 65397,
2762
- 65397,
2763
- 12,
2764
- 65398,
2765
- 65398,
2766
- 9,
2767
- 65399,
2768
- 65399,
2769
- 11,
2770
- 65400,
2771
- 65400,
2772
- 13,
2773
- 65401,
2774
- 65401,
2775
- 10,
2776
- 65402,
2777
- 65402,
2778
- 12,
2779
- 65403,
2780
- 65403,
2781
- 9,
2782
- 65404,
2783
- 65404,
2784
- 11,
2785
- 65405,
2786
- 65405,
2787
- 13,
2788
- 65406,
2789
- 65406,
2790
- 10,
2791
- 65407,
2792
- 65407,
2793
- 12,
2794
- 65408,
2795
- 65408,
2796
- 9,
2797
- 65409,
2798
- 65409,
2799
- 11,
2800
- 65410,
2801
- 65410,
2802
- 13,
2803
- 65411,
2804
- 65411,
2805
- 10,
2806
- 65412,
2807
- 65412,
2808
- 12,
2809
- 65413,
2810
- 65413,
2811
- 9,
2812
- 65414,
2813
- 65414,
2814
- 11,
2815
- 65415,
2816
- 65415,
2817
- 13,
2818
- 65416,
2819
- 65416,
2820
- 10,
2821
- 65417,
2822
- 65417,
2823
- 12,
2824
- 65418,
2825
- 65418,
2826
- 9,
2827
- 65419,
2828
- 65419,
2829
- 11,
2830
- 65420,
2831
- 65420,
2832
- 13,
2833
- 65421,
2834
- 65421,
2835
- 10,
2836
- 65422,
2837
- 65422,
2838
- 12,
2839
- 65423,
2840
- 65423,
2841
- 9,
2842
- 65424,
2843
- 65424,
2844
- 11,
2845
- 65425,
2846
- 65425,
2847
- 13,
2848
- 65426,
2849
- 65426,
2850
- 10,
2851
- 65427,
2852
- 65427,
2853
- 12,
2854
- 65428,
2855
- 65428,
2856
- 9,
2857
- 65429,
2858
- 65429,
2859
- 13,
2860
- 65430,
2861
- 65430,
2862
- 12,
2863
- 65431,
2864
- 65431,
2865
- 9,
2866
- 65432,
2867
- 65432,
2868
- 11,
2869
- 65433,
2870
- 65433,
2871
- 13,
2872
- 65434,
2873
- 65434,
2874
- 10,
2875
- 65435,
2876
- 65435,
2877
- 12,
2878
- 65436,
2879
- 65436,
2880
- 9
2881
- ];
2882
- var SPEECH_HANGUL_VOWELS = [1, 2, 1, 2, 6, 2, 6, 2, 4, 1, 2, 2, 4, 5, 6, 2, 3, 5, 3, 3, 3];
2883
-
2884
- // src/speech.ts
2885
- var SPEECH_DIGIT_WEIGHT = 1.5;
2886
- var SPEECH_KANJI_WEIGHT = 2;
2887
- var SPEECH_PAUSE_SHORT_WEIGHT = 1;
2888
- var SPEECH_PAUSE_LONG_WEIGHT = 2;
2889
- var at = (a, j) => a[j] ?? -1;
2890
- function classOf(cp) {
2891
- let lo = 0, hi = SPEECH_RANGES.length / 3 - 1;
2892
- while (lo <= hi) {
2893
- const mid = lo + hi >> 1;
2894
- if (cp < at(SPEECH_RANGES, mid * 3)) hi = mid - 1;
2895
- else if (cp > at(SPEECH_RANGES, mid * 3 + 1)) lo = mid + 1;
2896
- else return at(SPEECH_RANGES, mid * 3 + 2);
2897
- }
2898
- return SpeechClass.NONE;
2899
- }
2900
- function vowelCodeOf(cp) {
2901
- if (cp >= 44032 && cp <= 55203) return at(SPEECH_HANGUL_VOWELS, Math.floor((cp - 44032) / 28) % 21);
2902
- let lo = 0, hi = SPEECH_VOWEL_RANGES.length / 3 - 1;
2903
- while (lo <= hi) {
2904
- const mid = lo + hi >> 1;
2905
- if (cp < at(SPEECH_VOWEL_RANGES, mid * 3)) hi = mid - 1;
2906
- else if (cp > at(SPEECH_VOWEL_RANGES, mid * 3 + 1)) lo = mid + 1;
2907
- else return at(SPEECH_VOWEL_RANGES, mid * 3 + 2);
2908
- }
2909
- return 0;
2910
- }
2911
- function vowelIn(cps, start, end) {
2912
- let weak = 0;
2913
- for (let j = start; j < end; j++) {
2914
- let code = vowelCodeOf(at(cps, j));
2915
- if (code === 0) continue;
2916
- if ((at(cps, j) === 117 || at(cps, j) === 85) && j > start && (at(cps, j - 1) === 113 || at(cps, j - 1) === 81)) code |= SPEECH_VOWEL_WEAK;
2917
- if ((code & SPEECH_VOWEL_WEAK) === 0) return SPEECH_VOWELS[code];
2918
- if (weak === 0) weak = code & ~SPEECH_VOWEL_WEAK;
2919
- }
2920
- return weak === 0 ? void 0 : SPEECH_VOWELS[weak];
2921
- }
2922
- function languageOf(locale) {
2923
- return ((locale ?? "").split(/[-_]/)[0] ?? "").toLowerCase();
2924
- }
2925
- var isAsciiLetter = (cp) => cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122;
2926
- var isAsciiDigit = (cp) => cp >= 48 && cp <= 57;
2927
- function markupEnd(cps, i) {
2928
- const cp = (j) => at(cps, j);
2929
- if (cp(i) === 60) {
2930
- let j = i + 1;
2931
- if (cp(j) === 47) j++;
2932
- const from = j;
2933
- while (isAsciiLetter(cp(j))) j++;
2934
- return j > from && cp(j) === 62 ? j + 1 : i;
2935
- }
2936
- if (cp(i) === 38) {
2937
- let j = i + 1;
2938
- const numeric = cp(j) === 35;
2939
- if (numeric) j++;
2940
- const from = j;
2941
- while (numeric ? isAsciiDigit(cp(j)) : isAsciiLetter(cp(j))) j++;
2942
- return j > from && cp(j) === 59 ? j + 1 : i;
2943
- }
2944
- return i;
2945
- }
2946
- var LATIN = /* @__PURE__ */ new Set([SpeechClass.LATIN_VOWEL, SpeechClass.LATIN_LETTER]);
2947
- var CYRILLIC = /* @__PURE__ */ new Set([SpeechClass.CYRILLIC_VOWEL, SpeechClass.CYRILLIC_LETTER]);
2948
- var ARABIC = /* @__PURE__ */ new Set([SpeechClass.ARABIC_LETTER, SpeechClass.ARABIC_VOWEL]);
2949
- var THAI = /* @__PURE__ */ new Set([SpeechClass.THAI_CONSONANT, SpeechClass.THAI_LEAD, SpeechClass.THAI_VOWEL]);
2950
- var OTHER = /* @__PURE__ */ new Set([SpeechClass.OTHER_LETTER]);
2951
- var KANA_CLASSES = /* @__PURE__ */ new Set([SpeechClass.KANA, SpeechClass.KANA_SMALL, SpeechClass.KANA_SOKUON, SpeechClass.KANA_LONG]);
2952
- function speechUnits(text, locale) {
2953
- const cps = Array.from(text ?? "", (ch) => ch.codePointAt(0));
2954
- const cls = cps.map(classOf);
2955
- const n = cps.length;
2956
- const lang = languageOf(locale);
2957
- const japanese = lang === "ja" || cls.some((k) => KANA_CLASSES.has(k));
2958
- const units = [];
2959
- const syllable = (start, end, weight = 1) => {
2960
- units.push({ kind: "syllable", weight, start, end });
2961
- };
2962
- const classAt = (j) => j >= 0 && j < n ? at(cls, j) : SpeechClass.NONE;
2963
- const marksEnd = (j) => {
2964
- while (j < n && at(cls, j) === SpeechClass.MARK) j++;
2965
- return j;
2966
- };
2967
- const wordEnd = (i2, family) => {
2968
- let j = i2 + 1;
2969
- while (j < n && (family.has(at(cls, j)) || at(cls, j) === SpeechClass.MARK || at(cls, j) === SpeechClass.JOINER && family.has(classAt(j + 1)))) j++;
2970
- return j;
2971
- };
2972
- const fromAnchors = (start, end, anchors) => {
2973
- const sorted = [...new Set(anchors.map((a) => Math.min(marksEnd(a + 1), end) - 1))].sort((a, b) => a - b);
2974
- sorted.forEach((a, j) => syllable(j === 0 ? start : at(sorted, j - 1) + 1, j === sorted.length - 1 ? end : a + 1));
2975
- };
2976
- const spread = (letters, count, step) => Array.from({ length: count }, (_, j) => at(letters, Math.min(step * j + step - 1, letters.length - 1)));
2977
- let i = 0;
2978
- while (i < n) {
2979
- const k = at(cls, i);
2980
- const skip = markupEnd(cps, i);
2981
- if (skip > i) {
2982
- i = skip;
2983
- continue;
2984
- }
2985
- if (LATIN.has(k)) {
2986
- const end = wordEnd(i, LATIN);
2987
- const lasts = [], sizes = [];
2988
- let inGroup = false;
2989
- for (let j = i; j < end; j++) {
2990
- if (at(cls, j) === SpeechClass.LATIN_VOWEL) {
2991
- if (inGroup) {
2992
- lasts[lasts.length - 1] = j;
2993
- sizes[sizes.length - 1] = at(sizes, sizes.length - 1) + 1;
2994
- } else {
2995
- lasts.push(j);
2996
- sizes.push(1);
2997
- }
2998
- inGroup = true;
2999
- } else if (at(cls, j) !== SpeechClass.MARK) inGroup = false;
3000
- }
3001
- if (lasts.length >= 2 && at(sizes, sizes.length - 1) === 1 && silentE(cps, cls, i, end, at(lasts, lasts.length - 1), lang)) lasts.pop();
3002
- fromAnchors(i, end, lasts.length ? lasts : [end - 1]);
3003
- i = end;
3004
- } else if (CYRILLIC.has(k)) {
3005
- const end = wordEnd(i, CYRILLIC);
3006
- const vowels = [];
3007
- for (let j = i; j < end; j++) if (at(cls, j) === SpeechClass.CYRILLIC_VOWEL) vowels.push(j);
3008
- fromAnchors(i, end, vowels.length ? vowels : [end - 1]);
3009
- i = end;
3010
- } else if (ARABIC.has(k)) {
3011
- const end = wordEnd(i, ARABIC);
3012
- const vowels = [], letters = [];
3013
- for (let j = i; j < end; j++) {
3014
- if (at(cls, j) === SpeechClass.ARABIC_VOWEL) vowels.push(j);
3015
- else if (at(cls, j) === SpeechClass.ARABIC_LETTER) letters.push(j);
3016
- }
3017
- fromAnchors(i, end, vowels.length ? vowels : spread(letters, Math.max(1, Math.ceil(letters.length / 2)), 2));
3018
- i = end;
3019
- } else if (THAI.has(k)) {
3020
- const end = wordEnd(i, THAI);
3021
- fromAnchors(i, end, thaiAnchors(cls, i, end));
3022
- i = end;
3023
- } else if (OTHER.has(k)) {
3024
- const end = wordEnd(i, OTHER);
3025
- const letters = [];
3026
- for (let j = i; j < end; j++) if (at(cls, j) === SpeechClass.OTHER_LETTER) letters.push(j);
3027
- fromAnchors(i, end, spread(letters, Math.max(1, Math.ceil(letters.length / 3)), 3));
3028
- i = end;
3029
- } else if (k === SpeechClass.HAN) {
3030
- const end = marksEnd(i + 1);
3031
- syllable(i, end, japanese ? SPEECH_KANJI_WEIGHT : 1);
3032
- i = end;
3033
- } else if (k === SpeechClass.KANA || k === SpeechClass.HANGUL) {
3034
- const end = marksEnd(i + 1);
3035
- syllable(i, end);
3036
- i = end;
3037
- } else if (k === SpeechClass.KANA_SMALL || k === SpeechClass.KANA_LONG) {
3038
- const end = marksEnd(i + 1);
3039
- const last = units[units.length - 1];
3040
- if (last && last.kind === "syllable" && last.end === i) {
3041
- last.end = end;
3042
- if (k === SpeechClass.KANA_LONG) last.weight += 1;
3043
- } else if (k === SpeechClass.KANA_SMALL) syllable(i, end);
3044
- i = end;
3045
- } else if (k === SpeechClass.KANA_SOKUON) {
3046
- const end = marksEnd(i + 1);
3047
- units.push({ kind: "closed", weight: 1, start: i, end });
3048
- i = end;
3049
- } else if (k === SpeechClass.DIGIT) {
3050
- const end = marksEnd(i + 1);
3051
- syllable(i, end, SPEECH_DIGIT_WEIGHT);
3052
- i = end;
3053
- } else if (k === SpeechClass.PAUSE_SHORT || k === SpeechClass.PAUSE_LONG) {
3054
- const inNumber = (at(cps, i) === 46 || at(cps, i) === 44) && classAt(i - 1) === SpeechClass.DIGIT && classAt(i + 1) === SpeechClass.DIGIT;
3055
- if (!inNumber) units.push({ kind: "pause", weight: k === SpeechClass.PAUSE_LONG ? SPEECH_PAUSE_LONG_WEIGHT : SPEECH_PAUSE_SHORT_WEIGHT, start: i, end: i + 1 });
3056
- i++;
3057
- } else if (k === SpeechClass.SPACE) {
3058
- let end = i + 1;
3059
- while (end < n && at(cls, end) === SpeechClass.SPACE) end++;
3060
- if (thaiBefore(cls, i - 1) && THAI.has(classAt(end))) units.push({ kind: "pause", weight: SPEECH_PAUSE_SHORT_WEIGHT, start: i, end });
3061
- i = end;
3062
- } else {
3063
- i++;
3064
- }
3065
- }
3066
- const out = tidyPauses(units);
3067
- for (const u of out) {
3068
- if (u.kind !== "syllable") continue;
3069
- const vowel = vowelIn(cps, u.start, u.end);
3070
- if (vowel !== void 0) u.vowel = vowel;
3071
- }
3072
- return out;
3073
- }
3074
- function thaiBefore(cls, j) {
3075
- while (j >= 0 && at(cls, j) === SpeechClass.MARK) j--;
3076
- return j >= 0 && THAI.has(at(cls, j));
3077
- }
3078
- function silentE(cps, cls, start, end, e, lang) {
3079
- if (lang !== "en" && lang !== "fr") return false;
3080
- if (at(cps, e) !== 101 && at(cps, e) !== 69) return false;
3081
- let after = e + 1;
3082
- if (after < end && at(cls, after) === SpeechClass.MARK) return false;
3083
- if (lang === "fr" && after < end && (at(cps, after) === 115 || at(cps, after) === 83)) after++;
3084
- if (after !== end) return false;
3085
- if (lang === "en" && e - 2 >= start && (at(cps, e - 1) === 108 || at(cps, e - 1) === 76) && at(cls, e - 2) === SpeechClass.LATIN_LETTER) return false;
3086
- return true;
3087
- }
3088
- function thaiAnchors(cls, start, end) {
3089
- const anchors = [];
3090
- let consonants = [];
3091
- let leadOpen = false;
3092
- const implicit = () => {
3093
- for (let j = 0; j < Math.floor((consonants.length - 1) / 2); j++) anchors.push(at(consonants, 2 * j + 1));
3094
- };
3095
- for (let p = start; p < end; p++) {
3096
- const k = at(cls, p);
3097
- if (k === SpeechClass.THAI_CONSONANT) consonants.push(p);
3098
- else if (k === SpeechClass.THAI_LEAD) {
3099
- implicit();
3100
- anchors.push(p + 1 < end && at(cls, p + 1) === SpeechClass.THAI_CONSONANT ? p + 1 : p);
3101
- consonants = [];
3102
- leadOpen = true;
3103
- } else if (k === SpeechClass.THAI_VOWEL) {
3104
- if (consonants.length === 0) continue;
3105
- if (leadOpen && consonants.length <= 2) {
3106
- leadOpen = false;
3107
- consonants = [];
3108
- continue;
3109
- }
3110
- implicit();
3111
- anchors.push(p);
3112
- consonants = [];
3113
- leadOpen = false;
3114
- }
3115
- }
3116
- if (anchors.length === 0) {
3117
- const count = Math.max(1, Math.ceil(consonants.length / 2));
3118
- for (let j = 0; j < count; j++) anchors.push(consonants.length ? at(consonants, Math.min(2 * j + 1, consonants.length - 1)) : end - 1);
3119
- } else implicit();
3120
- return anchors;
3121
- }
3122
- function tidyPauses(units) {
3123
- const out = [];
3124
- for (const u of units) {
3125
- const last = out[out.length - 1];
3126
- if (u.kind === "pause" && last?.kind === "pause") {
3127
- last.weight = Math.max(last.weight, u.weight);
3128
- last.end = u.end;
3129
- } else out.push({ ...u });
3130
- }
3131
- while (out[0]?.kind === "pause") out.shift();
3132
- while (out[out.length - 1]?.kind === "pause") out.pop();
3133
- return out;
3134
- }
3135
- function countSyllables(text, locale) {
3136
- let total = 0;
3137
- for (const u of speechUnits(text, locale)) if (u.kind !== "pause") total += u.weight;
3138
- return total;
3139
- }
3140
-
3141
- // src/index.ts
3142
89
  var import_expr = require("@wildwinter/expr");
3143
90
  function walkNodes(nodes, visit) {
3144
91
  for (const node of nodes) {
@@ -3237,17 +184,49 @@ function textIsAction(project, scene) {
3237
184
  var DEFAULT_PAD_AFTER = 0.6;
3238
185
  var PAD_AFTER_MIN = -10;
3239
186
  var PAD_AFTER_MAX = 60;
3240
- var DEFAULT_ESTIMATE_SYLLABLES_PER_SECOND = 4;
3241
- var ESTIMATE_SYLLABLES_PER_SECOND_MIN = 2;
3242
- var ESTIMATE_SYLLABLES_PER_SECOND_MAX = 10;
187
+ var DEFAULT_ESTIMATE_SPEED = 1;
188
+ var ESTIMATE_SPEED_MIN = 0.5;
189
+ var ESTIMATE_SPEED_MAX = 2.5;
190
+ var LINE_CHARS_PER_SECOND = 14;
3243
191
  var LINE_DURATION_MIN = 0.5;
3244
192
  var LINE_DURATION_MAX = 18;
3245
193
  var SUBTITLE_READING_MIN = 1.5;
3246
- function estimateLineDuration(text, locale, syllablesPerSecond) {
3247
- const rate = typeof syllablesPerSecond === "number" && Number.isFinite(syllablesPerSecond) && syllablesPerSecond > 0 ? syllablesPerSecond : DEFAULT_ESTIMATE_SYLLABLES_PER_SECOND;
194
+ function normaliseEstimateSpeed(project) {
195
+ const obj = project;
196
+ if (!("estimateSyllablesPerSecond" in obj)) return project;
197
+ const old = obj["estimateSyllablesPerSecond"];
198
+ delete obj["estimateSyllablesPerSecond"];
199
+ if (obj["estimateSpeed"] === void 0 && old !== void 0) obj["estimateSpeed"] = typeof old === "number" ? old / 4 : old;
200
+ return project;
201
+ }
202
+ var LINE_CHAR_WEIGHTS = [
203
+ [173, 173, 0],
204
+ [12352, 12543, 2],
205
+ [12784, 12799, 2],
206
+ [13312, 19903, 3],
207
+ [19968, 40959, 3],
208
+ [44032, 55203, 2.5],
209
+ [63744, 64255, 3],
210
+ [65382, 65439, 2],
211
+ [131072, 201551, 3]
212
+ ];
213
+ function estimateLineDuration(text, locale, speed) {
214
+ void locale;
215
+ const s = typeof speed === "number" && Number.isFinite(speed) && speed > 0 ? speed : DEFAULT_ESTIMATE_SPEED;
3248
216
  let weight = 0;
3249
- for (const u of speechUnits(text ?? "", locale)) weight += u.weight;
3250
- return Math.min(Math.max(weight / rate, LINE_DURATION_MIN), LINE_DURATION_MAX);
217
+ for (const ch of text ?? "") {
218
+ const cp = ch.codePointAt(0);
219
+ let w = 1;
220
+ for (const [lo, hi, cw] of LINE_CHAR_WEIGHTS) {
221
+ if (cp < lo) break;
222
+ if (cp <= hi) {
223
+ w = cw;
224
+ break;
225
+ }
226
+ }
227
+ weight += w;
228
+ }
229
+ return Math.min(Math.max(weight / (LINE_CHARS_PER_SECOND * s), LINE_DURATION_MIN), LINE_DURATION_MAX);
3251
230
  }
3252
231
  var DEFAULT_WRITING_STATUSES = [
3253
232
  { name: "stub", colour: 0 },
@@ -3296,13 +275,13 @@ function sceneFolderLayout(project, sceneIds) {
3296
275
  const folderParent = /* @__PURE__ */ new Map();
3297
276
  for (const f of folders) folderParent.set(f.id, f.parent !== void 0 && known.has(f.parent) && f.parent !== f.id ? f.parent : void 0);
3298
277
  for (const f of folders) {
3299
- let at2 = folderParent.get(f.id);
3300
- for (let steps = 0; at2 !== void 0 && steps <= folders.length; steps++) {
3301
- if (at2 === f.id) {
278
+ let at = folderParent.get(f.id);
279
+ for (let steps = 0; at !== void 0 && steps <= folders.length; steps++) {
280
+ if (at === f.id) {
3302
281
  folderParent.set(f.id, void 0);
3303
282
  break;
3304
283
  }
3305
- at2 = folderParent.get(at2);
284
+ at = folderParent.get(at);
3306
285
  }
3307
286
  }
3308
287
  const sceneFolder = /* @__PURE__ */ new Map();
@@ -3341,7 +320,7 @@ function sceneFolderLayout(project, sceneIds) {
3341
320
  function sceneFolderPath(project, layout, sceneId) {
3342
321
  const names = new Map((project.sceneFolders ?? []).map((f) => [f.id, f.name]));
3343
322
  const parts = [];
3344
- for (let at2 = layout.sceneFolder.get(sceneId), n = 0; at2 !== void 0 && n <= names.size; at2 = layout.folderParent.get(at2), n++) parts.unshift(names.get(at2) ?? "");
323
+ for (let at = layout.sceneFolder.get(sceneId), n = 0; at !== void 0 && n <= names.size; at = layout.folderParent.get(at), n++) parts.unshift(names.get(at) ?? "");
3345
324
  return parts.join(" / ");
3346
325
  }
3347
326
  var PROJECT_LOCALE_SCENE = "@project";
@@ -3385,20 +364,22 @@ var UNRESOLVED_KEY = "unresolved";
3385
364
  DEFAULT_CAPTION_CHARACTER,
3386
365
  DEFAULT_CAPTION_DELIMITERS,
3387
366
  DEFAULT_DOCUMENTATION_CLASSES,
3388
- DEFAULT_ESTIMATE_SYLLABLES_PER_SECOND,
367
+ DEFAULT_ESTIMATE_SPEED,
3389
368
  DEFAULT_LAYOUT,
3390
369
  DEFAULT_PAD_AFTER,
3391
370
  DEFAULT_QUALIFIERS,
3392
371
  DEFAULT_RECORDING_STATUSES,
3393
372
  DEFAULT_SPEAKER_PATTERN,
3394
373
  DEFAULT_WRITING_STATUSES,
3395
- ESTIMATE_SYLLABLES_PER_SECOND_MAX,
3396
- ESTIMATE_SYLLABLES_PER_SECOND_MIN,
374
+ ESTIMATE_SPEED_MAX,
375
+ ESTIMATE_SPEED_MIN,
3397
376
  EXTENSIONS_DIR,
3398
377
  EXTENSION_SCHEMA,
3399
378
  EXTENSION_SHARD,
3400
379
  FLOW_SCHEMA,
3401
380
  HANDOFF_SCHEMA,
381
+ LINE_CHARS_PER_SECOND,
382
+ LINE_CHAR_WEIGHTS,
3402
383
  LINE_DURATION_MAX,
3403
384
  LINE_DURATION_MIN,
3404
385
  MANIFEST_EXTENSION,
@@ -3413,15 +394,10 @@ var UNRESOLVED_KEY = "unresolved";
3413
394
  SAVE_SCHEMA,
3414
395
  SAVE_VERSION,
3415
396
  SPEAKER_PATTERN_KEY,
3416
- SPEECH_DIGIT_WEIGHT,
3417
- SPEECH_KANJI_WEIGHT,
3418
- SPEECH_PAUSE_LONG_WEIGHT,
3419
- SPEECH_PAUSE_SHORT_WEIGHT,
3420
397
  STRINGS_SCHEMA,
3421
398
  SUBTITLE_READING_MIN,
3422
399
  UNRESOLVED_KEY,
3423
400
  castStringKey,
3424
- countSyllables,
3425
401
  deriveRecordingFolders,
3426
402
  effectiveGameId,
3427
403
  estimateLineDuration,
@@ -3432,6 +408,7 @@ var UNRESOLVED_KEY = "unresolved";
3432
408
  isDialogueScene,
3433
409
  isValidGameId,
3434
410
  isValidPropertyName,
411
+ normaliseEstimateSpeed,
3435
412
  projectLayout,
3436
413
  projectQualifiers,
3437
414
  propertyNameify,
@@ -3441,7 +418,6 @@ var UNRESOLVED_KEY = "unresolved";
3441
418
  sceneFolderLayout,
3442
419
  sceneFolderPath,
3443
420
  speakerLabelKey,
3444
- speechUnits,
3445
421
  textIsAction,
3446
422
  usedQualifiers,
3447
423
  usedSpeakerPairs,