@lokascript/domain-learn 2.1.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 (44) hide show
  1. package/dist/generators/gloss-generator.d.ts +18 -0
  2. package/dist/generators/learn-renderer.d.ts +13 -0
  3. package/dist/generators/sentence-generator.d.ts +34 -0
  4. package/dist/index.cjs +6116 -0
  5. package/dist/index.cjs.map +1 -0
  6. package/dist/index.d.cts +441 -0
  7. package/dist/index.d.ts +55 -0
  8. package/dist/index.js +6056 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/profiles/ar.d.ts +2 -0
  11. package/dist/profiles/de.d.ts +2 -0
  12. package/dist/profiles/en.d.ts +2 -0
  13. package/dist/profiles/es.d.ts +2 -0
  14. package/dist/profiles/fr.d.ts +2 -0
  15. package/dist/profiles/index.d.ts +20 -0
  16. package/dist/profiles/ja.d.ts +2 -0
  17. package/dist/profiles/ko.d.ts +2 -0
  18. package/dist/profiles/pt.d.ts +2 -0
  19. package/dist/profiles/tr.d.ts +2 -0
  20. package/dist/profiles/zh.d.ts +2 -0
  21. package/dist/schemas/index.d.ts +31 -0
  22. package/dist/tokenizers/index.d.ts +23 -0
  23. package/dist/types.d.ts +266 -0
  24. package/package.json +63 -0
  25. package/src/__tests__/schemas.test.ts +145 -0
  26. package/src/__tests__/sentence-generation.test.ts +189 -0
  27. package/src/generators/gloss-generator.ts +145 -0
  28. package/src/generators/learn-renderer.ts +291 -0
  29. package/src/generators/sentence-generator.ts +501 -0
  30. package/src/index.ts +237 -0
  31. package/src/profiles/ar.ts +526 -0
  32. package/src/profiles/de.ts +481 -0
  33. package/src/profiles/en.ts +181 -0
  34. package/src/profiles/es.ts +829 -0
  35. package/src/profiles/fr.ts +466 -0
  36. package/src/profiles/index.ts +34 -0
  37. package/src/profiles/ja.ts +301 -0
  38. package/src/profiles/ko.ts +286 -0
  39. package/src/profiles/pt.ts +484 -0
  40. package/src/profiles/tr.ts +511 -0
  41. package/src/profiles/zh.ts +256 -0
  42. package/src/schemas/index.ts +576 -0
  43. package/src/tokenizers/index.ts +409 -0
  44. package/src/types.ts +321 -0
@@ -0,0 +1,466 @@
1
+ import type { LearnLanguageProfile } from '../types';
2
+
3
+ export const frProfile: LearnLanguageProfile = {
4
+ patternProfile: {
5
+ code: 'fr',
6
+ wordOrder: 'SVO',
7
+ keywords: {
8
+ add: { primary: 'ajouter', alternatives: ['ajoute'] },
9
+ remove: { primary: 'retirer', alternatives: ['retire'] },
10
+ toggle: { primary: 'basculer', alternatives: ['bascule'] },
11
+ put: { primary: 'mettre', alternatives: ['mets'] },
12
+ set: { primary: 'définir', alternatives: ['définis'] },
13
+ show: { primary: 'montrer', alternatives: ['montre'] },
14
+ hide: { primary: 'cacher', alternatives: ['cache'] },
15
+ get: { primary: 'obtenir', alternatives: ['obtiens'] },
16
+ wait: { primary: 'attendre', alternatives: ['attends'] },
17
+ fetch: { primary: 'récupérer', alternatives: ['récupère'] },
18
+ send: { primary: 'envoyer', alternatives: ['envoie'] },
19
+ go: { primary: 'aller', alternatives: ['va'] },
20
+ increment: { primary: 'incrémenter', alternatives: ['incrémente'] },
21
+ decrement: { primary: 'décrémenter', alternatives: ['décrémente'] },
22
+ take: { primary: 'prendre', alternatives: ['prends'] },
23
+ },
24
+ },
25
+ morphologyTable: {
26
+ add: {
27
+ infinitive: 'ajouter',
28
+ imperative: {
29
+ tu: 'ajoute',
30
+ vous: 'ajoutez',
31
+ },
32
+ present: {
33
+ je: "j'ajoute",
34
+ tu: 'ajoutes',
35
+ il: 'ajoute',
36
+ nous: 'ajoutons',
37
+ vous: 'ajoutez',
38
+ ils: 'ajoutent',
39
+ },
40
+ passeCompose: {
41
+ il: 'a ajouté',
42
+ je: 'ai ajouté',
43
+ },
44
+ imparfait: {
45
+ il: 'ajoutait',
46
+ },
47
+ futur: {
48
+ il: 'ajoutera',
49
+ },
50
+ gerondif: 'en ajoutant',
51
+ },
52
+ remove: {
53
+ infinitive: 'retirer',
54
+ imperative: {
55
+ tu: 'retire',
56
+ vous: 'retirez',
57
+ },
58
+ present: {
59
+ je: 'je retire',
60
+ tu: 'retires',
61
+ il: 'retire',
62
+ nous: 'retirons',
63
+ vous: 'retirez',
64
+ ils: 'retirent',
65
+ },
66
+ passeCompose: {
67
+ il: 'a retiré',
68
+ je: 'ai retiré',
69
+ },
70
+ imparfait: {
71
+ il: 'retirait',
72
+ },
73
+ futur: {
74
+ il: 'retirera',
75
+ },
76
+ gerondif: 'en retirant',
77
+ },
78
+ toggle: {
79
+ infinitive: 'basculer',
80
+ imperative: {
81
+ tu: 'bascule',
82
+ vous: 'basculez',
83
+ },
84
+ present: {
85
+ je: 'je bascule',
86
+ tu: 'bascules',
87
+ il: 'bascule',
88
+ nous: 'basculons',
89
+ vous: 'basculez',
90
+ ils: 'basculent',
91
+ },
92
+ passeCompose: {
93
+ il: 'a basculé',
94
+ je: 'ai basculé',
95
+ },
96
+ imparfait: {
97
+ il: 'basculait',
98
+ },
99
+ futur: {
100
+ il: 'basculera',
101
+ },
102
+ gerondif: 'en basculant',
103
+ },
104
+ put: {
105
+ infinitive: 'mettre',
106
+ imperative: {
107
+ tu: 'mets',
108
+ vous: 'mettez',
109
+ },
110
+ present: {
111
+ je: 'je mets',
112
+ tu: 'mets',
113
+ il: 'met',
114
+ nous: 'mettons',
115
+ vous: 'mettez',
116
+ ils: 'mettent',
117
+ },
118
+ passeCompose: {
119
+ il: 'a mis',
120
+ je: 'ai mis',
121
+ },
122
+ imparfait: {
123
+ il: 'mettait',
124
+ },
125
+ futur: {
126
+ il: 'mettra',
127
+ },
128
+ gerondif: 'en mettant',
129
+ },
130
+ set: {
131
+ infinitive: 'définir',
132
+ imperative: {
133
+ tu: 'définis',
134
+ vous: 'définissez',
135
+ },
136
+ present: {
137
+ je: 'je définis',
138
+ tu: 'définis',
139
+ il: 'définit',
140
+ nous: 'définissons',
141
+ vous: 'définissez',
142
+ ils: 'définissent',
143
+ },
144
+ passeCompose: {
145
+ il: 'a défini',
146
+ je: 'ai défini',
147
+ },
148
+ imparfait: {
149
+ il: 'définissait',
150
+ },
151
+ futur: {
152
+ il: 'définira',
153
+ },
154
+ gerondif: 'en définissant',
155
+ },
156
+ show: {
157
+ infinitive: 'montrer',
158
+ imperative: {
159
+ tu: 'montre',
160
+ vous: 'montrez',
161
+ },
162
+ present: {
163
+ je: 'je montre',
164
+ tu: 'montres',
165
+ il: 'montre',
166
+ nous: 'montrons',
167
+ vous: 'montrez',
168
+ ils: 'montrent',
169
+ },
170
+ passeCompose: {
171
+ il: 'a montré',
172
+ je: 'ai montré',
173
+ },
174
+ imparfait: {
175
+ il: 'montrait',
176
+ },
177
+ futur: {
178
+ il: 'montrera',
179
+ },
180
+ gerondif: 'en montrant',
181
+ },
182
+ hide: {
183
+ infinitive: 'cacher',
184
+ imperative: {
185
+ tu: 'cache',
186
+ vous: 'cachez',
187
+ },
188
+ present: {
189
+ je: 'je cache',
190
+ tu: 'caches',
191
+ il: 'cache',
192
+ nous: 'cachons',
193
+ vous: 'cachez',
194
+ ils: 'cachent',
195
+ },
196
+ passeCompose: {
197
+ il: 'a caché',
198
+ je: 'ai caché',
199
+ },
200
+ imparfait: {
201
+ il: 'cachait',
202
+ },
203
+ futur: {
204
+ il: 'cachera',
205
+ },
206
+ gerondif: 'en cachant',
207
+ },
208
+ get: {
209
+ infinitive: 'obtenir',
210
+ imperative: {
211
+ tu: 'obtiens',
212
+ vous: 'obtenez',
213
+ },
214
+ present: {
215
+ je: "j'obtiens",
216
+ tu: 'obtiens',
217
+ il: 'obtient',
218
+ nous: 'obtenons',
219
+ vous: 'obtenez',
220
+ ils: 'obtiennent',
221
+ },
222
+ passeCompose: {
223
+ il: 'a obtenu',
224
+ je: 'ai obtenu',
225
+ },
226
+ imparfait: {
227
+ il: 'obtenait',
228
+ },
229
+ futur: {
230
+ il: 'obtiendra',
231
+ },
232
+ gerondif: 'en obtenant',
233
+ },
234
+ wait: {
235
+ infinitive: 'attendre',
236
+ imperative: {
237
+ tu: 'attends',
238
+ vous: 'attendez',
239
+ },
240
+ present: {
241
+ je: "j'attends",
242
+ tu: 'attends',
243
+ il: 'attend',
244
+ nous: 'attendons',
245
+ vous: 'attendez',
246
+ ils: 'attendent',
247
+ },
248
+ passeCompose: {
249
+ il: 'a attendu',
250
+ je: 'ai attendu',
251
+ },
252
+ imparfait: {
253
+ il: 'attendait',
254
+ },
255
+ futur: {
256
+ il: 'attendra',
257
+ },
258
+ gerondif: 'en attendant',
259
+ },
260
+ fetch: {
261
+ infinitive: 'récupérer',
262
+ imperative: {
263
+ tu: 'récupère',
264
+ vous: 'récupérez',
265
+ },
266
+ present: {
267
+ je: 'je récupère',
268
+ tu: 'récupères',
269
+ il: 'récupère',
270
+ nous: 'récupérons',
271
+ vous: 'récupérez',
272
+ ils: 'récupèrent',
273
+ },
274
+ passeCompose: {
275
+ il: 'a récupéré',
276
+ je: 'ai récupéré',
277
+ },
278
+ imparfait: {
279
+ il: 'récupérait',
280
+ },
281
+ futur: {
282
+ il: 'récupérera',
283
+ },
284
+ gerondif: 'en récupérant',
285
+ },
286
+ send: {
287
+ infinitive: 'envoyer',
288
+ imperative: {
289
+ tu: 'envoie',
290
+ vous: 'envoyez',
291
+ },
292
+ present: {
293
+ je: "j'envoie",
294
+ tu: 'envoies',
295
+ il: 'envoie',
296
+ nous: 'envoyons',
297
+ vous: 'envoyez',
298
+ ils: 'envoient',
299
+ },
300
+ passeCompose: {
301
+ il: 'a envoyé',
302
+ je: 'ai envoyé',
303
+ },
304
+ imparfait: {
305
+ il: 'envoyait',
306
+ },
307
+ futur: {
308
+ il: 'enverra',
309
+ },
310
+ gerondif: 'en envoyant',
311
+ },
312
+ go: {
313
+ infinitive: 'aller',
314
+ imperative: {
315
+ tu: 'va',
316
+ vous: 'allez',
317
+ },
318
+ present: {
319
+ je: 'je vais',
320
+ tu: 'vas',
321
+ il: 'va',
322
+ nous: 'allons',
323
+ vous: 'allez',
324
+ ils: 'vont',
325
+ },
326
+ passeCompose: {
327
+ il: 'est allé',
328
+ je: 'suis allé',
329
+ },
330
+ imparfait: {
331
+ il: 'allait',
332
+ },
333
+ futur: {
334
+ il: 'ira',
335
+ },
336
+ gerondif: 'en allant',
337
+ },
338
+ increment: {
339
+ infinitive: 'incrémenter',
340
+ imperative: {
341
+ tu: 'incrémente',
342
+ vous: 'incrémentez',
343
+ },
344
+ present: {
345
+ je: "j'incrémente",
346
+ tu: 'incrémentes',
347
+ il: 'incrémente',
348
+ nous: 'incrémentons',
349
+ vous: 'incrémentez',
350
+ ils: 'incrémentent',
351
+ },
352
+ passeCompose: {
353
+ il: 'a incrémenté',
354
+ je: 'ai incrémenté',
355
+ },
356
+ imparfait: {
357
+ il: 'incrémentait',
358
+ },
359
+ futur: {
360
+ il: 'incrémentera',
361
+ },
362
+ gerondif: 'en incrémentant',
363
+ },
364
+ decrement: {
365
+ infinitive: 'décrémenter',
366
+ imperative: {
367
+ tu: 'décrémente',
368
+ vous: 'décrémentez',
369
+ },
370
+ present: {
371
+ je: 'je décrémente',
372
+ tu: 'décrémentes',
373
+ il: 'décrémente',
374
+ nous: 'décrémentons',
375
+ vous: 'décrémentez',
376
+ ils: 'décrémentent',
377
+ },
378
+ passeCompose: {
379
+ il: 'a décrémenté',
380
+ je: 'ai décrémenté',
381
+ },
382
+ imparfait: {
383
+ il: 'décrémentait',
384
+ },
385
+ futur: {
386
+ il: 'décrémentera',
387
+ },
388
+ gerondif: 'en décrémentant',
389
+ },
390
+ take: {
391
+ infinitive: 'prendre',
392
+ imperative: {
393
+ tu: 'prends',
394
+ vous: 'prenez',
395
+ },
396
+ present: {
397
+ je: 'je prends',
398
+ tu: 'prends',
399
+ il: 'prend',
400
+ nous: 'prenons',
401
+ vous: 'prenez',
402
+ ils: 'prennent',
403
+ },
404
+ passeCompose: {
405
+ il: 'a pris',
406
+ je: 'ai pris',
407
+ },
408
+ imparfait: {
409
+ il: 'prenait',
410
+ },
411
+ futur: {
412
+ il: 'prendra',
413
+ },
414
+ gerondif: 'en prenant',
415
+ },
416
+ },
417
+ frames: {
418
+ code: 'fr',
419
+ wordOrder: 'SVO',
420
+ frames: [
421
+ {
422
+ function: 'commanding',
423
+ template: '{verb.imperative.tu} {patient} {target}',
424
+ verbForm: 'imperative.tu',
425
+ example: 'ajoute .active à #button',
426
+ },
427
+ {
428
+ function: 'describing',
429
+ template: '{subject} {verb.present.il} {patient} {target}',
430
+ verbForm: 'present.il',
431
+ example: 'le système ajoute .active à #button',
432
+ },
433
+ {
434
+ function: 'narrating',
435
+ template: '{subject} {verb.passeCompose.il} {patient} {target}',
436
+ verbForm: 'passeCompose.il',
437
+ example: 'le système a ajouté .active à #button',
438
+ },
439
+ {
440
+ function: 'questioning',
441
+ template: 'est-ce que {subject} {verb.present.il} {patient} {target} ?',
442
+ verbForm: 'present.il',
443
+ example: 'est-ce que le système ajoute .active à #button ?',
444
+ },
445
+ {
446
+ function: 'negating',
447
+ template: '{subject} ne {verb.present.il} pas {patient} {target}',
448
+ verbForm: 'present.il',
449
+ example: 'le système ne ajoute pas .active à #button',
450
+ },
451
+ {
452
+ function: 'planning',
453
+ template: '{subject} {verb.futur.il} {patient} {target}',
454
+ verbForm: 'futur.il',
455
+ example: 'le système ajoutera .active à #button',
456
+ },
457
+ {
458
+ function: 'progressing',
459
+ template: '{subject} est en train de {verb.infinitive} {patient} {target}',
460
+ verbForm: 'infinitive',
461
+ example: 'le système est en train de ajouter .active à #button',
462
+ },
463
+ ],
464
+ },
465
+ defaultSubject: 'le système',
466
+ };
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Language Profiles Index
3
+ *
4
+ * Re-exports all 10 language profiles and provides a registry lookup.
5
+ */
6
+
7
+ import type { LearnLanguageProfile } from '../types';
8
+ import { enProfile } from './en';
9
+ import { jaProfile } from './ja';
10
+ import { esProfile } from './es';
11
+ import { arProfile } from './ar';
12
+ import { zhProfile } from './zh';
13
+ import { koProfile } from './ko';
14
+ import { frProfile } from './fr';
15
+ import { trProfile } from './tr';
16
+ import { deProfile } from './de';
17
+ import { ptProfile } from './pt';
18
+
19
+ export { enProfile, jaProfile, esProfile, arProfile, zhProfile };
20
+ export { koProfile, frProfile, trProfile, deProfile, ptProfile };
21
+
22
+ /** All profiles indexed by language code */
23
+ export const ALL_PROFILES: Record<string, LearnLanguageProfile> = {
24
+ en: enProfile,
25
+ ja: jaProfile,
26
+ es: esProfile,
27
+ ar: arProfile,
28
+ zh: zhProfile,
29
+ ko: koProfile,
30
+ fr: frProfile,
31
+ tr: trProfile,
32
+ de: deProfile,
33
+ pt: ptProfile,
34
+ };