@sc-voice/tools 1.4.0 → 2.0.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.
@@ -1,353 +0,0 @@
1
- import * as deepl from 'deepl-node';
2
- import { DBG } from '../defines.mjs';
3
- import { MockDeepL } from './mock-deepl.mjs';
4
-
5
- const EMPTY_TEXT = '911911911';
6
- const TRANSLATE_OPTS = {
7
- tag_handling: 'xml',
8
- formality: 'more',
9
- };
10
- const DST_AUTHOR = 'no-author';
11
-
12
- let mockApi = DBG.MOCK_DEEPL;
13
-
14
- export class DeepLAdapter {
15
- #authKey;
16
-
17
- constructor(opts = {}) {
18
- let {
19
- authKey,
20
- glossary,
21
- glossaryName,
22
- initialized,
23
- sourceLang, // deepl lang
24
- targetLang, // deepl lang
25
- translateOpts,
26
- translator,
27
- dstLang,
28
- dstLang2, // bilara-data lang
29
- srcLang2, // bilara-data lang
30
- srcLang,
31
- } = DeepLAdapter.srcDstLangs(opts);
32
-
33
- let emsg = 'use DeepLAdapter.create()';
34
- let check = 1;
35
- if (null == authKey) throw new Error(`${emsg} ${check}`);
36
- check++;
37
- if (null == dstLang2) throw new Error(`${emsg} ${check}`);
38
- check++;
39
- if (null == glossaryName) throw new Error(`${emsg} ${check}`);
40
- check++;
41
- if (null == initialized) throw new Error(`${emsg} ${check}`);
42
- check++;
43
- if (null == sourceLang) throw new Error(`${emsg} ${check}`);
44
- check++;
45
- if (null == targetLang) throw new Error(`${emsg} ${check}`);
46
- check++;
47
- if (null == srcLang2) throw new Error(`${emsg} ${check}`);
48
- check++;
49
- if (null == translateOpts) throw new Error(`${emsg} ${check}`);
50
- check++;
51
- if (null == translator) throw new Error(`${emsg} ${check}`);
52
- check++;
53
-
54
- this.#authKey = authKey;
55
-
56
- Object.assign(this, {
57
- dstLang,
58
- dstLang2,
59
- glossary,
60
- glossaryName,
61
- initialized,
62
- srcLang,
63
- srcLang2,
64
- sourceLang,
65
- targetLang,
66
- translateOpts: JSON.parse(JSON.stringify(translateOpts)),
67
- translator,
68
- });
69
- }
70
-
71
- static srcDstLangs(opts = {}) {
72
- let { srcLang = 'en', dstLang = 'pt-pt' } = opts;
73
- srcLang = srcLang.toLowerCase();
74
- let srcLang2 = srcLang.split('-')[0];
75
- dstLang = dstLang.toLowerCase();
76
- let dstLang2 = dstLang.split('-')[0];
77
-
78
- return Object.assign({}, opts, {
79
- srcLang,
80
- srcLang2,
81
- dstLang,
82
- dstLang2,
83
- });
84
- }
85
-
86
- static deeplLang(lang) {
87
- switch (lang) {
88
- case 'pt':
89
- return 'pt-PT';
90
- default:
91
- return lang;
92
- }
93
- }
94
-
95
- static glossaryName(opts = {}) {
96
- const msg = 'D10r.glossaryName()';
97
- const dbg = DBG.GLOSSARY;
98
- let { dstAuthor = DST_AUTHOR } = opts;
99
- let {
100
- dstLang,
101
- dstLang2, // bilara-data lang
102
- srcLang2, // bilara-data lang
103
- srcLang,
104
- } = DeepLAdapter.srcDstLangs(opts);
105
- let name =
106
- `D10r_${srcLang2}_${dstLang2}_${dstAuthor}`.toLowerCase();
107
- dbg && console.log(msg, name);
108
- return name;
109
- }
110
-
111
- static async create(opts = {}) {
112
- const msg = 'D10r.create()';
113
- const dbg = DBG.GLOSSARY;
114
- let {
115
- authKey,
116
- srcLang,
117
- srcLang2,
118
- dstLang,
119
- dstLang2,
120
- dstAuthor = DST_AUTHOR,
121
- sourceLang,
122
- targetLang,
123
- translateOpts = TRANSLATE_OPTS,
124
- updateGlossary = false,
125
- translator,
126
- } = DeepLAdapter.srcDstLangs(opts);
127
- dbg && console.log(msg, '[1]opts', opts);
128
- if (authKey == null) {
129
- throw new Error(`${msg} authKey?`);
130
- }
131
- sourceLang = sourceLang || DeepLAdapter.deeplLang(srcLang);
132
- targetLang = targetLang || DeepLAdapter.deeplLang(dstLang);
133
- if (translator == null) {
134
- dbg && console.log(msg, '[2]new deepl.Translator()');
135
- let deeplOpts = {};
136
- translator = mockApi
137
- ? new MockDeepL.Translator(authKey)
138
- : new deepl.Translator(authKey);
139
- }
140
-
141
- let glossaryName = DeepLAdapter.glossaryName({
142
- srcLang,
143
- dstLang,
144
- dstAuthor,
145
- });
146
- let glossaries = await translator.listGlossaries();
147
- let glossary = glossaries.reduce((a, g) => {
148
- return g.name === glossaryName ? g : a;
149
- }, null);
150
- if (updateGlossary) {
151
- console.warn(msg, '[3]updateGlossary', glossaryName);
152
- dbg && console.log(msg, '[4]uploadGlossary');
153
- glossary = await DeepLAdapter.uploadGlossary({
154
- srcLang,
155
- dstLang,
156
- dstAuthor,
157
- translator,
158
- glossaries,
159
- });
160
- }
161
- if (glossary) {
162
- let { glossaryId, name } = glossary;
163
- dbg &&
164
- console.warn(
165
- msg,
166
- '[5]using glossary',
167
- name,
168
- glossaryId && glossaryId.substring(0, 8),
169
- );
170
- } else {
171
- let dbg = DBG.GLOSSARY;
172
- dbg && console.log(msg, '[6]no glossary');
173
- }
174
- translateOpts = translateOpts
175
- ? JSON.parse(JSON.stringify(translateOpts))
176
- : TRANSLATE_OPTS;
177
- if (glossary) {
178
- translateOpts.glossary = glossary;
179
- }
180
- let initialized = true;
181
-
182
- let ctorOpts = {
183
- authKey,
184
- dstLang,
185
- dstLang2,
186
- glossary,
187
- glossaryName,
188
- initialized,
189
- srcLang,
190
- srcLang2,
191
- sourceLang,
192
- targetLang,
193
- translateOpts,
194
- translator,
195
- };
196
- dbg &&
197
- console.log(msg, '[7]ctor', {
198
- sourceLang,
199
- targetLang,
200
- glossaryName,
201
- });
202
- return new DeepLAdapter(ctorOpts);
203
- }
204
-
205
- static setMockApi(value) {
206
- mockApi = value;
207
- }
208
-
209
- static asGlossaryEntries(strObj) {
210
- const msg = 'd12r.asToGlossaryEntries:';
211
- let dbg = DBG.KVG_TO_GLOSSARY_ENTRIES;
212
-
213
- if (strObj instanceof deepl.GlossaryEntries) {
214
- return strObj;
215
- }
216
- let nEntries = 0;
217
- let entries;
218
-
219
- if (typeof strObj === 'string') {
220
- // assume kvg string
221
- entries = strObj.split('\n').reduce((a, kv) => {
222
- let [key, value] = kv.split(/\|/);
223
- if (key && !value) {
224
- throw new Error(`${msg} [1]no value for key:${key}`);
225
- } else if (!key && value) {
226
- throw new Error(`${msg} [2]no key for value:${value}`);
227
- } else if (!key && !value) {
228
- // ignore
229
- } else {
230
- key = key.trim();
231
- value = value.trim();
232
- a[key] = value;
233
- dbg > 1 && console.log(msg, '[3]', { key, value });
234
- nEntries++;
235
- }
236
- return a;
237
- }, []);
238
- } else if (typeof strObj === 'object') {
239
- entries = strObj;
240
- } else {
241
- throw new Error(`${msg} string or object?`);
242
- }
243
-
244
- return new deepl.GlossaryEntries({ entries });
245
- }
246
-
247
- static async uploadGlossary(opts = {}) {
248
- const msg = 'D10r.uploadGlossary()';
249
- const dbg = DBG.GLOSSARY;
250
- const dbgv = DBG.VERBOSE && dbg;
251
- let {
252
- srcLang,
253
- srcLang2,
254
- dstLang,
255
- dstLang2,
256
- dstAuthor,
257
- translator,
258
- glossaries,
259
- glossaryEntries,
260
- } = DeepLAdapter.srcDstLangs(opts);
261
- if (glossaryEntries == null) {
262
- throw new Error(`${msg} glossaryEntries?`);
263
- }
264
- let nEntries = Object.keys(glossaryEntries).length;
265
- let glossaryName = DeepLAdapter.glossaryName({
266
- srcLang,
267
- dstLang,
268
- dstAuthor,
269
- });
270
- let glossary;
271
-
272
- if (glossaries == null) {
273
- glossaries = await translator.listGlossaries();
274
- }
275
- for (let i = 0; i < glossaries.length; i++) {
276
- let g = glossaries[i];
277
- if (g.name === glossaryName) {
278
- dbg && console.log(msg, '[1]deleting', g.glossaryId);
279
- await translator.deleteGlossary(g.glossaryId);
280
- }
281
- }
282
-
283
- let sourceLang = DeepLAdapter.deeplLang(srcLang);
284
- let targetLang = DeepLAdapter.deeplLang(dstLang);
285
- glossary = await translator.createGlossary(
286
- glossaryName,
287
- sourceLang,
288
- targetLang,
289
- glossaryEntries,
290
- );
291
- let { glossaryId } = glossary;
292
- dbg &&
293
- console.log(msg, '[6]createGlossary', {
294
- fName,
295
- glossaryName,
296
- sourceLang,
297
- targetLang,
298
- glossaryId,
299
- nEntries,
300
- });
301
-
302
- return glossary;
303
- }
304
-
305
- async deleteGlossary(id) {
306
- const msg = 'd12r.deleteGlossary:';
307
- let { translator } = this;
308
- dbg && console.log(msg, '[1]deleting', id);
309
- await translator.deleteGlossary(id);
310
- dbg > 1 && console.log(msg, '[2]deleted', id);
311
- }
312
-
313
- async listGlossaries() {
314
- let { translator } = this;
315
-
316
- let glossaries = await translator.listGlossaries();
317
- return glossaries;
318
- }
319
-
320
- async translate(texts) {
321
- const msg = 'D10r.translate()';
322
- const dbg = DBG.DEEPL_XLT;
323
- const dbgv = dbg && DBG.VERBOSE;
324
- let { translator, srcLang, dstLang, translateOpts } = this;
325
-
326
- let sourceLang = DeepLAdapter.deeplLang(srcLang);
327
- let targetLang = DeepLAdapter.deeplLang(dstLang);
328
- texts = texts.map((t) => t || EMPTY_TEXT);
329
- dbgv && console.log(msg, '[1]translateOpts', translateOpts);
330
- let results = await translator.translateText(
331
- texts,
332
- sourceLang,
333
- targetLang,
334
- translateOpts,
335
- );
336
- if (dbg) {
337
- results.forEach((result, i) => {
338
- console.log(
339
- msg,
340
- `\n[${i}<] `,
341
- `${texts[i]}$`,
342
- `\n[${i}>] `,
343
- `${results[i]?.text}$`,
344
- );
345
- });
346
- }
347
- results = results.map((r) =>
348
- r.text === EMPTY_TEXT ? '' : r.text,
349
- );
350
-
351
- return results;
352
- }
353
- } // DeepLAdapter
@@ -1,17 +0,0 @@
1
- export class DpdTransformer {
2
- constructor(opts = {}) {
3
- const msg = 'D14r.ctor:';
4
- let { dictionary } = opts;
5
- if (dictionary == null) {
6
- throw new Error(`${msg} dictionary?`);
7
- }
8
-
9
- Object.assign(this, {
10
- dictionary,
11
- });
12
- }
13
-
14
- transform(text) {
15
- return text;
16
- }
17
- }
@@ -1,351 +0,0 @@
1
- import { DBG } from '../defines.mjs';
2
-
3
- import { QuoteParser } from './quote-parser.mjs';
4
-
5
- const {
6
- LQ1,
7
- LQ2,
8
- LQ3,
9
- LQ4,
10
- RQ1,
11
- RQ2,
12
- RQ3,
13
- RQ4,
14
- ELLIPSIS,
15
- ELL,
16
- APOS,
17
- LDQUOT,
18
- RDQUOT,
19
- LSQUOT,
20
- RSQUOT,
21
- } = QuoteParser;
22
-
23
- const lQuote = LQ1;
24
- const rQuote = RQ1;
25
-
26
- export class MockGlossary {
27
- constructor(args) {
28
- const msg = 'MockGlossary.ctor()';
29
- const dbg = DBG.VERBOSE;
30
- let [name, sourceLang, targetLang, glossaryEntries] = args;
31
- targetLang = targetLang.replace(/-[a-z]+/i, '');
32
- Object.assign(this, {
33
- name,
34
- ready: true,
35
- sourceLang,
36
- targetLang,
37
- glossaryEntries,
38
- });
39
- dbg && console.log(msg, this);
40
- }
41
- }
42
-
43
- const qp_en_deepl = new QuoteParser({ lang: 'en-deepl' });
44
- const qp_fr_deepl = new QuoteParser({ lang: 'fr-deepl' });
45
-
46
- function compare(a, b) {
47
- const msg = 'MockDeepL.compare()';
48
- let len = Math.max(a.length, b.length);
49
- let ok = true;
50
- for (let i = 0; i < len; i++) {
51
- let ai = a.charAt(i);
52
- let bi = b.charAt(i);
53
- if (ai !== bi) {
54
- ok = false;
55
- console.log(msg, { i, ai, bi });
56
- }
57
- }
58
- console.log(msg, ok);
59
- return ok;
60
- }
61
-
62
- export class MockTranslator {
63
- constructor(authKey) {
64
- const msg = 'MockTranslator.ctor()';
65
- const dbg = DBG.VERBOSE;
66
- dbg && console.log(msg, `authKey: ${authKey.substring(0, 4)}...`);
67
- }
68
-
69
- async listGlossaries() {
70
- return [];
71
- }
72
-
73
- async createGlossary(...args) {
74
- return new MockGlossary(args);
75
- }
76
-
77
- async translateText(texts, sourceLang, targetLang, translateOpts) {
78
- const msg = 'MockTranslator.translateText()';
79
- const dbg = DBG.DEEPL_MOCK_XLT;
80
- const dbgv = dbg && DBG.VERBOSE;
81
-
82
- return texts.map((text) => {
83
- dbg && console.log(msg, `"${text}"`);
84
-
85
- if (DBG.TRANSLATE_TEXT) {
86
- // use this to debug
87
- let expected = `when warned by the DEVA1s' messengers: `;
88
- console.log(msg, { text, expected });
89
- compare(text, expected);
90
- }
91
-
92
- text =
93
- text &&
94
- text
95
- .replace(
96
- `${LQ1}Bhikkhus, I do not see a single thing that is so ` +
97
- 'very blameworthy as wrong view.',
98
- `${LQ1}Bhikkhus, eu não vejo uma única coisa que seja ` +
99
- 'tão culpável como uma visão incorreta. ',
100
- )
101
- .replace(/\baus Anteilnahme an. /g, 'por compaixão.')
102
- .replace(/\bBei welchen drei\? /g, 'Quais são os três? ')
103
- .replace(/\bDas ist ein Moench, /g, 'Este é um bhikkhu ')
104
- .replace(/\bman einen Moench, /g, 'chama um bhikkhu ')
105
- .replace(/, Moenche, /, 'bhikkhus,')
106
- .replace(/\bthe dart of craving/g, 'o dardo do anseio')
107
- .replace(/\bUpaka/g, 'UPAKA')
108
- .replace(
109
- `I say, ‘You say, “I said UK!”?’.`,
110
- `Eu digo: "Está a dizer: "Eu disse Reino Unido!"?`,
111
- )
112
- .replace(
113
- `${LQ1}${LQ2}I say, ${LQ3}You say, ${LQ4}I said PT!${RQ4}?${RQ3}.${RQ2}${RQ1}`,
114
- `${LQ1}${LQ2}Eu digo, ${LQ3}Você diz, ${LQ4}Eu disse PT!${RQ4}?${RQ3}.${RQ2}${RQ1}`,
115
- )
116
- .replace(`Der Pfeil des Verlangens`, 'O dardo do anseio')
117
- .replace(
118
- '„Moench, du sammelst Almosen, bevor du isst;',
119
- '"Bhikkhu, você esmola comida antes de comer;',
120
- )
121
- .replace(
122
- '“Bhikkhu, you seek alms before you eat;',
123
- '"Bhikkhu, você procura esmola comida antes de comer;',
124
- //).replace(
125
- //`${LQ1}${LQ2}I say, ${LQ3}You say, ${LQ4}I said FR!${RQ4}?${RQ3}.${RQ2}${RQ1}`,
126
- //`${LQ1}${LQ2}Je dis, ${LQ3}Vous dites, ${LQ4}Je dis FR!${RQ4}?${RQ3}.${RQ2}${RQ1}`
127
- )
128
- .replace(
129
- `${LQ2}I say, ${LQ3}You say, ${LQ4}I said FR!${RQ4}?${RQ3}.${RQ2}${RQ1}`,
130
- `${LQ2}Je dis, ${LQ3}Vous dites, ${LQ4}Je dis FR!${RQ4}?${RQ3}.${RQ2}${RQ1}.`,
131
- )
132
- .replace(
133
- `${LQ2}I say, ${LQ3}You say, ${LQ4}I said PT!${RQ4}?${RQ3}.${RQ2}${RQ1}`,
134
- `${LQ2}Eu digo, ${LQ3}Você diz, ${LQ4}Eu disse PT!${RQ4}?${RQ3}.${RQ2}${RQ1}`,
135
- )
136
- .replace(
137
- `${LQ2}I say, ${LQ3}You say, ${LQ4}I said PT!${RQ4}?${RQ3}.${RQ2}${RQ1}`,
138
- `${LQ2}Eu digo, ${LQ3}Você diz, ${LQ4}Eu disse PT!${RQ4}?${RQ3}.${RQ2}${RQ1}`,
139
- )
140
- .replace(
141
- qp_fr_deepl.testcaseFeelingsEN('French'),
142
- 'comment échapper à ce sentiment français ? ',
143
- )
144
- .replace(
145
- qp_fr_deepl.testcaseRebirthEN('FR'),
146
- `${LQ2} Je comprends : ${LQ3}La renaissance est terminée ` +
147
- `en FR${RQ3}${RQ2}?${RQ1}.`,
148
- )
149
- .replace(
150
- qp_fr_deepl.testcasePleasuresEN('French'),
151
- "comprendre la gratification, l'inconvénient et " +
152
- 'la fuite des plaisirs français',
153
- )
154
- .replace(
155
- "craving aggregates' origin",
156
- "l'origine des agrégats de l'envie",
157
- )
158
- .replace(
159
- "The French child's toy",
160
- "Le jouet de l'enfant français",
161
- )
162
- .replace('Springtime', 'Primavera')
163
- .replace(
164
- '“Bhikkhu, that is incorrect view;',
165
- '"Bhikkhu, essa visão é incorrecta;',
166
- )
167
- .replace(
168
- 'are these things skillful or unskillful?',
169
- 'estas coisas são hábeis ou inábeis? ',
170
- )
171
- .replace(
172
- 'succeed in the system of skillful teaching.',
173
- 'tenha sucesso no sistema de ensino hábil. ',
174
- )
175
- .replace(
176
- 'so the skillful person ',
177
- 'por isso, a pessoa hábil ',
178
- )
179
- .replace(
180
- 'They are entirely a heap of the skillful. "',
181
- 'São inteiramente um amontoado de hábeis. " ',
182
- )
183
- .replace(
184
- 'He gives up the unskillful and develops the skillful.',
185
- 'Abandona o inábil e desenvolve o hábil. ',
186
- )
187
- .replace(
188
- 'Whatever qualities are skillful, part of the skillful, all are rooted.',
189
- 'Quaisquer que sejam as qualidades hábeis, parte do hábil, todas estão enraizadas. ',
190
- )
191
- .replace(
192
- 'One who desires merit, grounded in the skillful, ',
193
- 'Aquele que deseja o mérito, baseado no hábil, ',
194
- )
195
- .replace(
196
- 'There Sāriputta addressed the bhikkhus',
197
- 'Aí Sāriputta dirigiu-se aos monges ',
198
- )
199
- .replace(
200
- 'There the Blessed One is now staying',
201
- 'Lá o Abençoado está agora a ficar ',
202
- )
203
- .replace('There exists, brahmin.', 'Existe, brâmane. ')
204
- .replace('2. endeavor', '2. esforzarse ')
205
- .replace(
206
- '2. Endeavor',
207
- '2. Endeavor ', // WHY!?
208
- )
209
- .replace('2. padhānasutta', '2. padhānasutta ')
210
- .replace('2. Padhānasutta', '2. Padhānasutta ')
211
- .replace(
212
- QuoteParser.testcaseThinking_EN('SPAN'),
213
- [
214
- `Pensando, `,
215
- `${LQ1}He hecho cosas SPAN por medio `,
216
- `del cuerpo, la palabra y la mente${RQ1}, `,
217
- `se mortifican.`,
218
- ].join(''),
219
- )
220
- .replace('springtime', 'Primavera')
221
- .replace(
222
- QuoteParser.testcaseEllipsisEN('PT', {
223
- prefix: 'They understand: ',
224
- lQuote,
225
- rQuote,
226
- ellipsis: ELL,
227
- }),
228
- `Eles compreendem: ${LQ1}Isto é PT${RQ1}<ell/>${LQ1}Isto é sofrimento${RQ1}<ell/>${LQ1}Isto é a origem${RQ1}.`,
229
- )
230
- .replace(
231
- QuoteParser.testcaseEllipsisEN('ES', {
232
- lQuote,
233
- rQuote,
234
- ellipsis: ELL,
235
- }),
236
- [
237
- `Comprenden: `,
238
- `${LQ1}Esto es ES${RQ1}`,
239
- ELL,
240
- `${LQ1}Esto es sufrimiento${RQ1}`,
241
- ELL,
242
- `${LQ1}Este es el origen${RQ1}`,
243
- `.`,
244
- ].join(''),
245
- )
246
- .replace(
247
- 'And what are dark and bright deeds?',
248
- 'E o que são actos sombrios e luminosos?',
249
- )
250
- .replace(
251
- 'On the side of dark and bright',
252
- 'Do lado do sombrio e do luminoso',
253
- )
254
- .replace(
255
- 'That is why I sleep at ease. ',
256
- `É por isso que durmo tranquilo. `,
257
- )
258
- .replace(
259
- QuoteParser.testcaseQuotesEN({ lang: 'mind/PT', lQuote }),
260
- `${LQ1}Ouça e aplique bem a sua mente/PT, eu falarei.`,
261
- )
262
- .replace(
263
- QuoteParser.testcaseQuotesEN({ lang: 'mind/PT', rQuote }),
264
- `Ouça e aplique bem a sua mente/PT, eu falarei.${RQ1}`,
265
- )
266
- .replace(
267
- QuoteParser.testcaseQuotesEN({
268
- lang: 'mind/PT',
269
- lQuote,
270
- rQuote,
271
- }),
272
- `${LQ1}Ouça e aplique bem a sua mente/PT, eu falarei.${RQ1}`,
273
- )
274
- .replace(
275
- QuoteParser.testcaseDonationEN({
276
- lang: 'religious-PT',
277
- rQuote: QuoteParser.RQ1,
278
- people: 'people',
279
- }),
280
- `Estas são duas pessoas no mundo que são dignas de um donativo religioso-PT, e é aí que deve dar um presente.${RQ1} `,
281
- )
282
- .replace(
283
- QuoteParser.testcaseMisterEN({
284
- lang: 'messenger/PT',
285
- lQuote: QuoteParser.LQ3,
286
- rQuote: QuoteParser.RQ3,
287
- gods: 'DEVA1s',
288
- }),
289
- `‘Senhor, você não viu o primeiro mensageiro/PT dos devas que apareceu entre os seres humanos?’ `,
290
- )
291
- .replace(
292
- `These are two people in the world who are worthy of a religious-PT donation.${RQ1}`,
293
- `Estas são duas pessoas no mundo que são dignas de um donativo religioso-PT.${RQ1}`,
294
- )
295
- .replace(
296
- QuoteParser.testcaseMisterEN({
297
- lang: 'messenger/PT',
298
- lQuote: QuoteParser.LQ2,
299
- rQuote: QuoteParser.RQ2,
300
- gods: 'DEVA1s',
301
- }),
302
- `${LQ2}Senhor, não viu o primeiro mensageiro/PT dos DEVA1s que apareceu entre os seres humanos?${RQ2}`,
303
- )
304
- .replace(
305
- QuoteParser.testcaseElderlyEN({
306
- lQuote: LQ2,
307
- rQuote: RQ2,
308
- lang: ' PT',
309
- }),
310
- LQ2 +
311
- `Senhor PT, não viu entre os seres humanos ` +
312
- `uma mulher ou um homem idoso - com oitenta, ` +
313
- `noventa ou cem anos - dobrado, torto, apoiado ` +
314
- `num bordão, a tremer ao andar, doente, fora de moda, ` +
315
- `com os dentes partidos, o cabelo grisalho e escasso ` +
316
- `ou calvo, a pele enrugada e os membros manchados?` +
317
- RQ2,
318
- )
319
- .replace(
320
- QuoteParser.testcaseSickEN({
321
- lQuote1: LQ3,
322
- rQuote1: RQ3,
323
- rQuote2: RQ2,
324
- lang: 'PT sickness',
325
- apos: APOS,
326
- }),
327
- LQ3 +
328
- 'Eu também estou sujeito a ficar doente. ' +
329
- 'Não estou isento da doença de PT. É melhor fazer o ' +
330
- 'bem através do corpo, da fala e da mente' +
331
- RQ3 +
332
- '?' +
333
- RQ2,
334
- )
335
- .replace(
336
- `when warned by the DEVA1s' messengers: `,
337
- `quando avisados pelos mensageiros dos devas: `,
338
- );
339
- return {
340
- text,
341
- };
342
- });
343
- }
344
- }
345
-
346
- export class MockDeepL {
347
- constructor() {}
348
- static get Translator() {
349
- return MockTranslator;
350
- }
351
- }