echogarden 2.7.0 → 2.8.0

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.
Files changed (110) hide show
  1. package/data/lexicons/heteronyms.en.json +6 -2
  2. package/data/lexicons/words.en.json +379 -19
  3. package/dist/alignment/SemanticTextAlignment.js +6 -7
  4. package/dist/alignment/SemanticTextAlignment.js.map +1 -1
  5. package/dist/api/Alignment.js +2 -2
  6. package/dist/api/Alignment.js.map +1 -1
  7. package/dist/api/Recognition.js +2 -2
  8. package/dist/api/Recognition.js.map +1 -1
  9. package/dist/api/SpeechTranslation.js +2 -2
  10. package/dist/api/SpeechTranslation.js.map +1 -1
  11. package/dist/api/Synthesis.js +7 -7
  12. package/dist/api/Synthesis.js.map +1 -1
  13. package/dist/api/TimelineTranslationAlignment.js +2 -2
  14. package/dist/api/TimelineTranslationAlignment.js.map +1 -1
  15. package/dist/api/TranslationAlignment.js +2 -2
  16. package/dist/api/TranslationAlignment.js.map +1 -1
  17. package/dist/audio/AudioPlayer.js +2 -2
  18. package/dist/audio/AudioPlayer.js.map +1 -1
  19. package/dist/audio/AudioUtilities.d.ts +1 -1
  20. package/dist/cli/CLI.js +4 -4
  21. package/dist/cli/CLI.js.map +1 -1
  22. package/dist/denoising/RNNoise.js +5 -5
  23. package/dist/denoising/RNNoise.js.map +1 -1
  24. package/dist/dsp/FFT.js +13 -19
  25. package/dist/dsp/FFT.js.map +1 -1
  26. package/dist/dsp/Rubberband.js +5 -5
  27. package/dist/dsp/Rubberband.js.map +1 -1
  28. package/dist/dsp/Sonic.js +6 -6
  29. package/dist/dsp/Sonic.js.map +1 -1
  30. package/dist/dsp/SpeexResampler.js +11 -11
  31. package/dist/dsp/SpeexResampler.js.map +1 -1
  32. package/dist/nlp/EspeakPhonemizer.js +1 -1
  33. package/dist/nlp/EspeakPhonemizer.js.map +1 -1
  34. package/dist/nlp/Segmentation.d.ts +13 -10
  35. package/dist/nlp/Segmentation.js +129 -106
  36. package/dist/nlp/Segmentation.js.map +1 -1
  37. package/dist/nlp/TextNormalizer.js +74 -42
  38. package/dist/nlp/TextNormalizer.js.map +1 -1
  39. package/dist/recognition/AmazonTranscribeSTT.js +2 -2
  40. package/dist/recognition/AmazonTranscribeSTT.js.map +1 -1
  41. package/dist/recognition/SileroSTT.js +2 -2
  42. package/dist/recognition/SileroSTT.js.map +1 -1
  43. package/dist/recognition/WhisperSTT.js +4 -16
  44. package/dist/recognition/WhisperSTT.js.map +1 -1
  45. package/dist/subtitles/Subtitles.js +52 -7
  46. package/dist/subtitles/Subtitles.js.map +1 -1
  47. package/dist/synthesis/ElevenLabsTTS.js +11 -10
  48. package/dist/synthesis/ElevenLabsTTS.js.map +1 -1
  49. package/dist/synthesis/EspeakTTS.js +8 -8
  50. package/dist/synthesis/EspeakTTS.js.map +1 -1
  51. package/dist/synthesis/KokoroTTS.js +21 -10
  52. package/dist/synthesis/KokoroTTS.js.map +1 -1
  53. package/dist/synthesis/SvoxPicoTTS.js +24 -23
  54. package/dist/synthesis/SvoxPicoTTS.js.map +1 -1
  55. package/dist/text-translation/DeepLTextTranslation.js +4 -3
  56. package/dist/text-translation/DeepLTextTranslation.js.map +1 -1
  57. package/dist/text-translation/NLLBTextTranslation.js +7 -6
  58. package/dist/text-translation/NLLBTextTranslation.js.map +1 -1
  59. package/dist/utilities/StringUtilities.d.ts +1 -1
  60. package/dist/utilities/StringUtilities.js +5 -5
  61. package/dist/utilities/StringUtilities.js.map +1 -1
  62. package/dist/utilities/Timeline.d.ts +2 -3
  63. package/dist/utilities/Timeline.js +96 -147
  64. package/dist/utilities/Timeline.js.map +1 -1
  65. package/dist/utilities/WikipediaReader.js +3 -3
  66. package/dist/utilities/WikipediaReader.js.map +1 -1
  67. package/dist/voice-activity-detection/WebRtcVAD.js +4 -4
  68. package/dist/voice-activity-detection/WebRtcVAD.js.map +1 -1
  69. package/docs/Tasklist.md +1 -6
  70. package/package.json +13 -11
  71. package/src/alignment/SemanticTextAlignment.ts +6 -7
  72. package/src/api/Alignment.ts +2 -2
  73. package/src/api/Recognition.ts +2 -2
  74. package/src/api/SpeechTranslation.ts +2 -2
  75. package/src/api/Synthesis.ts +7 -7
  76. package/src/api/TimelineTranslationAlignment.ts +2 -2
  77. package/src/api/TranslationAlignment.ts +2 -2
  78. package/src/audio/AudioPlayer.ts +2 -2
  79. package/src/cli/CLI.ts +4 -4
  80. package/src/denoising/RNNoise.ts +5 -5
  81. package/src/dsp/FFT.ts +22 -19
  82. package/src/dsp/Rubberband.ts +5 -5
  83. package/src/dsp/Sonic.ts +6 -6
  84. package/src/dsp/SpeexResampler.ts +11 -11
  85. package/src/nlp/EspeakPhonemizer.ts +1 -1
  86. package/src/nlp/Segmentation.ts +146 -111
  87. package/src/nlp/TextNormalizer.ts +94 -52
  88. package/src/recognition/AmazonTranscribeSTT.ts +2 -2
  89. package/src/recognition/SileroSTT.ts +2 -2
  90. package/src/recognition/WhisperSTT.ts +4 -18
  91. package/src/subtitles/Subtitles.ts +69 -8
  92. package/src/synthesis/ElevenLabsTTS.ts +12 -11
  93. package/src/synthesis/EspeakTTS.ts +9 -8
  94. package/src/synthesis/KokoroTTS.ts +24 -12
  95. package/src/synthesis/SvoxPicoTTS.ts +26 -23
  96. package/src/text-translation/DeepLTextTranslation.ts +4 -3
  97. package/src/text-translation/NLLBTextTranslation.ts +8 -6
  98. package/src/typings/Fillers.d.ts +0 -16
  99. package/src/utilities/StringUtilities.ts +5 -6
  100. package/src/utilities/Timeline.ts +100 -170
  101. package/src/utilities/WikipediaReader.ts +3 -3
  102. package/src/voice-activity-detection/WebRtcVAD.ts +5 -4
  103. package/dist/nlp/CompromiseNLP.d.ts +0 -15
  104. package/dist/nlp/CompromiseNLP.js +0 -79
  105. package/dist/nlp/CompromiseNLP.js.map +0 -1
  106. package/dist/utilities/WasmMemoryManager.d.ts +0 -153
  107. package/dist/utilities/WasmMemoryManager.js +0 -440
  108. package/dist/utilities/WasmMemoryManager.js.map +0 -1
  109. package/src/nlp/CompromiseNLP.ts +0 -119
  110. package/src/utilities/WasmMemoryManager.ts +0 -566
@@ -1,440 +0,0 @@
1
- import { decodeUtf8, encodeUtf8 } from "../encodings/Utf8.js";
2
- import { concatUint8Arrays } from "./Utilities.js";
3
- export class WasmMemoryManager {
4
- wasmModule;
5
- wasmAlloc;
6
- wasmFree;
7
- allocatedReferences = new Set();
8
- constructor(wasmModule, options) {
9
- options = options ?? {};
10
- this.wasmModule = wasmModule;
11
- if (options.wasmAlloc) {
12
- this.wasmAlloc = options.wasmAlloc;
13
- }
14
- else {
15
- if (!wasmModule._malloc) {
16
- throw new Error(`Couldn't find a '_malloc' function in the module and no custom 'wasmAlloc' was provided in the options`);
17
- }
18
- this.wasmAlloc = wasmModule._malloc;
19
- }
20
- if (options.wasmFree) {
21
- this.wasmFree = options.wasmFree;
22
- }
23
- else {
24
- if (!wasmModule._free) {
25
- throw new Error(`Couldn't find a '_malloc' function in the module and no custom 'wasmFree' was provided in the options`);
26
- }
27
- this.wasmFree = wasmModule._free;
28
- }
29
- }
30
- allocInt8() {
31
- const address = this.alloc(1);
32
- return this.wrapInt8(address).clear();
33
- }
34
- wrapInt8(address) {
35
- const ref = new Int8Ref(address, this);
36
- this.allocatedReferences.add(ref);
37
- return ref;
38
- }
39
- allocUint8() {
40
- const address = this.alloc(1);
41
- return this.wrapUint8(address).clear();
42
- }
43
- wrapUint8(address) {
44
- const ref = new Uint8Ref(address, this);
45
- this.allocatedReferences.add(ref);
46
- return ref;
47
- }
48
- allocInt16() {
49
- const address = this.alloc(2);
50
- return this.wrapInt16(address).clear();
51
- }
52
- wrapInt16(address) {
53
- const ref = new Int16Ref(address, this);
54
- this.allocatedReferences.add(ref);
55
- return ref;
56
- }
57
- allocUint16() {
58
- const address = this.alloc(2);
59
- return this.wrapUint16(address).clear();
60
- }
61
- wrapUint16(address) {
62
- const ref = new Uint16Ref(address, this);
63
- this.allocatedReferences.add(ref);
64
- return ref;
65
- }
66
- allocInt32() {
67
- const address = this.alloc(4);
68
- return this.wrapInt32(address).clear();
69
- }
70
- wrapInt32(address) {
71
- const ref = new Int32Ref(address, this);
72
- this.allocatedReferences.add(ref);
73
- return ref;
74
- }
75
- allocUint32() {
76
- const address = this.alloc(4);
77
- return this.wrapUint32(address).clear();
78
- }
79
- wrapUint32(address) {
80
- const ref = new Uint32Ref(address, this);
81
- this.allocatedReferences.add(ref);
82
- return ref;
83
- }
84
- allocPointer() {
85
- const address = this.alloc(4);
86
- return this.wrapPointer(address).clear();
87
- }
88
- wrapPointer(address) {
89
- const ref = new PointerRef(address, this);
90
- this.allocatedReferences.add(ref);
91
- return ref;
92
- }
93
- allocFloat32() {
94
- const address = this.alloc(4);
95
- return this.wrapFloat64(address).clear();
96
- }
97
- wrapFloat32(address) {
98
- const ref = new Float32Ref(address, this);
99
- this.allocatedReferences.add(ref);
100
- return ref;
101
- }
102
- allocFloat64() {
103
- const address = this.alloc(8);
104
- return this.wrapFloat64(address).clear();
105
- }
106
- wrapFloat64(address) {
107
- const ref = new Float64Ref(address, this);
108
- this.allocatedReferences.add(ref);
109
- return ref;
110
- }
111
- // Allocate or wrap arrays
112
- allocInt8Array(length) {
113
- const address = this.alloc(length << 0);
114
- return this.wrapInt8Array(address, length).clear();
115
- }
116
- wrapInt8Array(address, length) {
117
- const ref = new Int8ArrayRef(address, length, this);
118
- this.allocatedReferences.add(ref);
119
- return ref;
120
- }
121
- allocUint8Array(length) {
122
- const address = this.alloc(length << 0);
123
- return this.wrapUint8Array(address, length).clear();
124
- }
125
- wrapUint8Array(address, length) {
126
- const ref = new Uint8ArrayRef(address, length, this);
127
- this.allocatedReferences.add(ref);
128
- return ref;
129
- }
130
- allocInt16Array(length) {
131
- const address = this.alloc(length << 1);
132
- return this.wrapInt16Array(address, length).clear();
133
- }
134
- wrapInt16Array(address, length) {
135
- const ref = new Int16ArrayRef(address, length, this);
136
- this.allocatedReferences.add(ref);
137
- return ref;
138
- }
139
- allocUint16Array(length) {
140
- const address = this.alloc(length << 1);
141
- return this.wrapUint16Array(address, length).clear();
142
- }
143
- wrapUint16Array(address, length) {
144
- const ref = new Uint16ArrayRef(address, length, this);
145
- this.allocatedReferences.add(ref);
146
- return ref;
147
- }
148
- allocInt32Array(length) {
149
- const address = this.alloc(length << 2);
150
- return this.wrapInt32Array(address, length).clear();
151
- }
152
- wrapInt32Array(address, length) {
153
- const ref = new Int32ArrayRef(address, length, this);
154
- this.allocatedReferences.add(ref);
155
- return ref;
156
- }
157
- allocUint32Array(length) {
158
- const address = this.alloc(length << 2);
159
- return this.wrapUint32Array(address, length).clear();
160
- }
161
- wrapUint32Array(address, length) {
162
- const ref = new Uint32ArrayRef(address, length, this);
163
- this.allocatedReferences.add(ref);
164
- return ref;
165
- }
166
- allocFloat32Array(length) {
167
- const address = this.alloc(length << 2);
168
- return this.wrapFloat32Array(address, length).clear();
169
- }
170
- wrapFloat32Array(address, length) {
171
- const ref = new Float32ArrayRef(address, length, this);
172
- this.allocatedReferences.add(ref);
173
- return ref;
174
- }
175
- allocFloat64Array(length) {
176
- const address = this.alloc(length << 3);
177
- return this.wrapFloat64Array(address, length).clear();
178
- }
179
- wrapFloat64Array(address, length) {
180
- const ref = new Float64ArrayRef(address, length, this);
181
- this.allocatedReferences.add(ref);
182
- return ref;
183
- }
184
- allocNullTerminatedUtf8String(str) {
185
- const strBuffer = concatUint8Arrays([encodeUtf8(str), new Uint8Array(1)]);
186
- const ref = this.allocUint8Array(strBuffer.length);
187
- ref.view.set(strBuffer);
188
- return ref;
189
- }
190
- wrapNullTerminatedUtf8String(address) {
191
- const ref = new NullTerminatedUtf8StringRef(address, this);
192
- this.allocatedReferences.add(ref);
193
- return ref;
194
- }
195
- alloc(size) {
196
- const ptr = this.wasmAlloc(size);
197
- return ptr;
198
- }
199
- free(wasmReference) {
200
- if (wasmReference.isFreed) {
201
- return;
202
- }
203
- this.wasmFree(wasmReference.address);
204
- this.allocatedReferences.delete(wasmReference);
205
- wasmReference.clearAddress();
206
- }
207
- freeAll() {
208
- for (const wasmReference of this.allocatedReferences) {
209
- this.free(wasmReference);
210
- }
211
- }
212
- detach(wasmReference) {
213
- this.allocatedReferences.delete(wasmReference);
214
- return wasmReference;
215
- }
216
- }
217
- class ValueRef {
218
- ptr;
219
- manager;
220
- get module() { return this.manager.wasmModule; }
221
- constructor(ptr, manager) {
222
- this.ptr = ptr;
223
- this.manager = manager;
224
- }
225
- get value() {
226
- this.assertNotFreed();
227
- return this.getValue();
228
- }
229
- set value(newValue) {
230
- this.assertNotFreed();
231
- this.setValue(newValue);
232
- }
233
- get address() {
234
- this.assertNotFreed();
235
- return this.ptr;
236
- }
237
- clear() {
238
- this.assertNotFreed();
239
- if (typeof this.value == 'number') {
240
- this.value = 0;
241
- }
242
- else if (typeof this.value == 'string') {
243
- throw new Error('Unimplemented');
244
- }
245
- return this;
246
- }
247
- free() {
248
- this.manager.free(this);
249
- }
250
- detach() {
251
- return this.manager.detach(this);
252
- }
253
- clearAddress() {
254
- this.ptr = 0;
255
- }
256
- get isFreed() { return this.ptr == 0; }
257
- assertNotFreed() {
258
- if (this.isFreed) {
259
- throw new Error('Attempt to read a freed WASM value reference.');
260
- }
261
- }
262
- }
263
- export class Int8Ref extends ValueRef {
264
- getValue() {
265
- return this.module.HEAP8[this.ptr >>> 0];
266
- }
267
- setValue(newValue) {
268
- this.module.HEAP8[this.ptr >>> 0] = newValue;
269
- }
270
- }
271
- export class Uint8Ref extends ValueRef {
272
- getValue() {
273
- return this.module.HEAPU8[this.ptr >>> 0];
274
- }
275
- setValue(newValue) {
276
- this.module.HEAPU8[this.ptr >>> 0] = newValue;
277
- }
278
- }
279
- export class Int16Ref extends ValueRef {
280
- getValue() {
281
- return this.module.HEAP16[this.ptr >>> 1];
282
- }
283
- setValue(newValue) {
284
- this.module.HEAP16[this.ptr >>> 1] = newValue;
285
- }
286
- }
287
- export class Uint16Ref extends ValueRef {
288
- getValue() {
289
- return this.module.HEAPU16[this.ptr >>> 1];
290
- }
291
- setValue(newValue) {
292
- this.module.HEAPU16[this.ptr >>> 1] = newValue;
293
- }
294
- }
295
- export class Int32Ref extends ValueRef {
296
- getValue() {
297
- return this.module.HEAP32[this.ptr >>> 2];
298
- }
299
- setValue(newValue) {
300
- this.module.HEAP32[this.ptr >>> 2] = newValue;
301
- }
302
- }
303
- export class Uint32Ref extends ValueRef {
304
- getValue() {
305
- return this.module.HEAPU32[this.ptr >>> 2];
306
- }
307
- setValue(newValue) {
308
- this.module.HEAPU32[this.ptr >>> 2] = newValue;
309
- }
310
- }
311
- export class PointerRef extends Uint32Ref {
312
- }
313
- export class Float32Ref extends ValueRef {
314
- getValue() {
315
- return this.module.HEAPF32[this.ptr >>> 2];
316
- }
317
- setValue(newValue) {
318
- this.module.HEAPF32[this.ptr >>> 2] = newValue;
319
- }
320
- }
321
- export class Float64Ref extends ValueRef {
322
- getValue() {
323
- return this.module.HEAPF64[this.ptr >>> 3];
324
- }
325
- setValue(newValue) {
326
- this.module.HEAPF64[this.ptr >>> 3] = newValue;
327
- }
328
- }
329
- export class NullTerminatedUtf8StringRef extends ValueRef {
330
- getValue() {
331
- const ptr = this.ptr >>> 0;
332
- const heapU8 = this.module.HEAPU8;
333
- const endByteOffset = heapU8.subarray(ptr).indexOf(0);
334
- const strBytes = heapU8.subarray(ptr, ptr + endByteOffset);
335
- const str = decodeUtf8(strBytes);
336
- return str;
337
- }
338
- setValue(newValue) {
339
- throw new Error('Unimplemented');
340
- }
341
- }
342
- class TypedArrayRef {
343
- ptr;
344
- length;
345
- manager;
346
- get module() { return this.manager.wasmModule; }
347
- constructor(ptr, length, manager) {
348
- this.ptr = ptr;
349
- this.length = length;
350
- this.manager = manager;
351
- }
352
- get view() {
353
- this.assertNotFreed();
354
- return this.getView();
355
- }
356
- slice(start, end) {
357
- return this.view.slice(start, end);
358
- }
359
- get address() {
360
- this.assertNotFreed();
361
- return this.ptr;
362
- }
363
- clear() {
364
- this.view.fill(0);
365
- return this;
366
- }
367
- free() {
368
- this.manager.free(this);
369
- }
370
- clearAddress() {
371
- this.ptr = 0;
372
- }
373
- detach() {
374
- return this.manager.detach(this);
375
- }
376
- get isFreed() { return this.ptr == 0; }
377
- assertNotFreed() {
378
- if (this.isFreed) {
379
- throw new Error('Attempt to read a freed WASM typed array reference.');
380
- }
381
- }
382
- }
383
- export class Int8ArrayRef extends TypedArrayRef {
384
- getView() {
385
- const startIndex = this.ptr >>> 0;
386
- return this.module.HEAP8.subarray(startIndex, startIndex + this.length);
387
- }
388
- }
389
- export class Uint8ArrayRef extends TypedArrayRef {
390
- getView() {
391
- const startIndex = this.ptr >>> 0;
392
- return this.module.HEAPU8.subarray(startIndex, startIndex + this.length);
393
- }
394
- readAsNullTerminatedUtf8String() {
395
- let strBytes = this.view;
396
- const indexOfFirstZero = strBytes.indexOf(0);
397
- if (indexOfFirstZero >= 0) {
398
- strBytes = strBytes.subarray(0, indexOfFirstZero);
399
- }
400
- const str = decodeUtf8(strBytes);
401
- return str;
402
- }
403
- }
404
- export class Int16ArrayRef extends TypedArrayRef {
405
- getView() {
406
- const startIndex = this.ptr >>> 1;
407
- return this.module.HEAP16.subarray(startIndex, startIndex + this.length);
408
- }
409
- }
410
- export class Uint16ArrayRef extends TypedArrayRef {
411
- getView() {
412
- const startIndex = this.ptr >>> 1;
413
- return this.module.HEAPU16.subarray(startIndex, startIndex + this.length);
414
- }
415
- }
416
- export class Int32ArrayRef extends TypedArrayRef {
417
- getView() {
418
- const startIndex = this.ptr >>> 2;
419
- return this.module.HEAP32.subarray(startIndex, startIndex + this.length);
420
- }
421
- }
422
- export class Uint32ArrayRef extends TypedArrayRef {
423
- getView() {
424
- const startIndex = this.ptr >>> 2;
425
- return this.module.HEAPU32.subarray(startIndex, startIndex + this.length);
426
- }
427
- }
428
- export class Float32ArrayRef extends TypedArrayRef {
429
- getView() {
430
- const startIndex = this.ptr >>> 2;
431
- return this.module.HEAPF32.subarray(startIndex, startIndex + this.length);
432
- }
433
- }
434
- export class Float64ArrayRef extends TypedArrayRef {
435
- getView() {
436
- const startIndex = this.ptr >>> 3;
437
- return this.module.HEAPF64.subarray(startIndex, startIndex + this.length);
438
- }
439
- }
440
- //# sourceMappingURL=WasmMemoryManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WasmMemoryManager.js","sourceRoot":"","sources":["../../src/utilities/WasmMemoryManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAE7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAElD,MAAM,OAAO,iBAAiB;IAC7B,UAAU,CAAK;IAEP,SAAS,CAAiB;IAC1B,QAAQ,CAAgB;IAExB,mBAAmB,GAAG,IAAI,GAAG,EAAW,CAAA;IAEhD,YAAY,UAAe,EAAE,OAAkC;QAC9D,OAAO,GAAG,OAAO,IAAI,EAAE,CAAA;QAEvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;YACvB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAA;QACnC,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;gBACzB,MAAM,IAAI,KAAK,CAAC,wGAAwG,CAAC,CAAA;YAC1H,CAAC;YAED,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,OAAO,CAAA;QACpC,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;QACjC,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,uGAAuG,CAAC,CAAA;YACzH,CAAC;YAED,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAA;QACjC,CAAC;IACF,CAAC;IAED,SAAS;QACR,MAAM,OAAO,GAAG,IAAI,C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CAAC;CACD;AAED,MAAM,OAAO,cAAe,SAAQ,aAA0B;IAC7D,OAAO;QACN,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,CAAA;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC,MAAM,CAAgB,CAAA;IACzF,CAAC;CACD;AAED,MAAM,OAAO,eAAgB,SAAQ,aAA2B;IAC/D,OAAO;QACN,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,CAAA;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC,MAAM,CAAiB,CAAA;IAC1F,CAAC;CACD;AAED,MAAM,OAAO,eAAgB,SAAQ,aAA2B;IAC/D,OAAO;QACN,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,CAAA;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC,MAAM,CAAiB,CAAA;IAC1F,CAAC;CACD"}
@@ -1,119 +0,0 @@
1
- import { getShortLanguageCode } from '../utilities/Locale.js'
2
- import { logToStderr } from '../utilities/Utilities.js'
3
- import { Lexicon } from './Lexicon.js'
4
-
5
- const log = logToStderr
6
-
7
- export async function parse(text: string): Promise<CompromiseParsedDocument> {
8
- const { default: nlp } = await import('compromise')
9
-
10
- const doc = nlp(text)
11
-
12
- doc.compute('penn')
13
-
14
- const jsonDoc: any[] = doc.json({ offset: true })
15
-
16
- //log(jsonDoc)
17
-
18
- const result: CompromiseParsedDocument = jsonDoc.map(sentence => {
19
- const terms = sentence.terms
20
- const parsedSentence: CompromiseParsedSentence = []
21
-
22
- for (let termIndex = 0; termIndex < terms.length; termIndex++) {
23
- const term = terms[termIndex]
24
-
25
- const parsedTerm: CompromiseParsedTerm = {
26
- text: term.text,
27
- pos: term.penn,
28
- tags: term.tags,
29
- preText: term.pre,
30
- postText: term.post,
31
- startOffset: term.offset.start,
32
- endOffset: term.offset.start + term.offset.length
33
- }
34
-
35
- if (parsedTerm.text == '') {
36
- if (parsedSentence.length > 0) {
37
- parsedSentence[parsedSentence.length - 1].postText += parsedTerm.preText + parsedTerm.postText
38
- }
39
- } else if (parsedTerm.tags.includes('Abbreviation') && parsedTerm.postText.startsWith('.')) {
40
- parsedTerm.text += '.'
41
- parsedTerm.endOffset += 1
42
- parsedSentence.push(parsedTerm)
43
- } else {
44
- parsedSentence.push(parsedTerm)
45
- }
46
- }
47
-
48
- return parsedSentence
49
- })
50
-
51
- //log(result)
52
-
53
- return result
54
- }
55
-
56
- export function tryMatchInLexicons(term: CompromiseParsedTerm, lexicons: Lexicon[], espeakVoice: string) {
57
- const reversedLexicons = [...lexicons].reverse() // Give precedence to later lexicons
58
-
59
- for (const lexicon of reversedLexicons) {
60
- const match = tryMatchInLexicon(term, lexicon, espeakVoice)
61
-
62
- if (match) {
63
- return match
64
- }
65
- }
66
-
67
- return undefined
68
- }
69
-
70
- export function tryMatchInLexicon(term: CompromiseParsedTerm, lexicon: Lexicon, espeakVoice: string) {
71
- const shortLanguageCode = getShortLanguageCode(espeakVoice)
72
-
73
- const lexiconForLanguage = lexicon[shortLanguageCode]
74
-
75
- if (!lexiconForLanguage) {
76
- return undefined
77
- }
78
-
79
- const termText = term.text
80
- const lowerCaseTermText = termText.toLocaleLowerCase()
81
-
82
- let entry = lexiconForLanguage[lowerCaseTermText]
83
-
84
- if (!entry) {
85
- return undefined
86
- }
87
-
88
- if (!Array.isArray(entry)) {
89
- entry = [entry]
90
- }
91
-
92
- for (const substitutionEntry of entry) {
93
- if (!substitutionEntry.pos || substitutionEntry.pos.includes(term.pos)) {
94
- const substitutionPhonemesText = substitutionEntry?.pronunciation?.espeak?.[espeakVoice]
95
-
96
- if (substitutionPhonemesText) {
97
- const substitutionPhonemes = substitutionPhonemesText.split(/ +/g)
98
-
99
- return substitutionPhonemes
100
- }
101
- }
102
- }
103
-
104
- return undefined
105
- }
106
-
107
- export type CompromiseParsedDocument = CompromiseParsedSentence[]
108
-
109
- export type CompromiseParsedSentence = CompromiseParsedTerm[]
110
-
111
- export type CompromiseParsedTerm = {
112
- text: string
113
- pos: string
114
- tags: string[]
115
- preText: string,
116
- postText: string,
117
- startOffset: number,
118
- endOffset: number
119
- }