tpmkms 8.2.0 → 8.3.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -384,6 +384,11 @@
384
384
  "ifAble",
385
385
  false
386
386
  ],
387
+ [
388
+ "integer",
389
+ "number",
390
+ false
391
+ ],
387
392
  [
388
393
  "is",
389
394
  "canBeQuestion",
package/common/numbers.js CHANGED
@@ -14,37 +14,44 @@ let config = {
14
14
  name: 'numbers',
15
15
  operators: [
16
16
  "([number])",
17
+ "([integer])",
17
18
  ],
18
19
  bridges: [
19
- { "id": "number", "level": 0, "bridge": "{ instance: false, ...next(operator) }" },
20
+ {
21
+ id: "number",
22
+ bridge: "{ instance: false, ...next(operator) }"
23
+ },
24
+ {
25
+ id: "integer",
26
+ isA: ['number'],
27
+ bridge: "{ instance: false, ...next(operator) }"
28
+ },
20
29
  ],
21
- debug: false,
22
- version: '3',
23
30
  words: {
24
31
  "literals": {
25
- "one": [{"id": "number", "initial": "{ value: 1, instance: true }" }],
26
- "ones": [{"id": "number", "initial": "{ value: 1, number: 'many', instance: true }" }],
27
- "two": [{"id": "number", "initial": "{ value: 2 , instance: true}" }],
28
- "twos": [{"id": "number", "initial": "{ value: 2 , number: 'many', instance: true}" }],
29
- "three": [{"id": "number", "initial": "{ value: 3, instance: true }" }],
30
- "threes": [{"id": "number", "initial": "{ value: 3, number: 'many', instance: true }" }],
31
- "four": [{"id": "number", "initial": "{ value: 4, instance: true }" }],
32
- "fours": [{"id": "number", "initial": "{ value: 4, number: 'many', instance: true }" }],
33
- "five": [{"id": "number", "initial": "{ value: 5, instance: true }" }],
34
- "fives": [{"id": "number", "initial": "{ value: 5, number: 'many', instance: true }" }],
35
- "six": [{"id": "number", "initial": "{ value: 6, instance: true }" }],
36
- "sixes": [{"id": "number", "initial": "{ value: 6, number: 'many', instance: true }" }],
37
- "seven": [{"id": "number", "initial": "{ value: 7, instance: true }" }],
38
- "sevens": [{"id": "number", "initial": "{ value: 7, number: 'many', instance: true }" }],
39
- "eight": [{"id": "number", "initial": "{ value: 8, instance: true }" }],
40
- "eights": [{"id": "number", "initial": "{ value: 8, number: 'many', instance: true }" }],
41
- "nine": [{"id": "number", "initial": "{ value: 9, instance: true }" }],
42
- "nines": [{"id": "number", "initial": "{ value: 9, number: 'many', instance: true }" }],
43
- "ten": [{"id": "number", "initial": "{ value: 10, instance: true }" }],
44
- "tens": [{"id": "number", "initial": "{ value: 10, number: 'many', instance: true }" }],
32
+ "one": [{"id": "integer", "initial": "{ value: 1, instance: true }" }],
33
+ "ones": [{"id": "integer", "initial": "{ value: 1, integer: 'many', instance: true }" }],
34
+ "two": [{"id": "integer", "initial": "{ value: 2 , instance: true}" }],
35
+ "twos": [{"id": "integer", "initial": "{ value: 2 , integer: 'many', instance: true}" }],
36
+ "three": [{"id": "integer", "initial": "{ value: 3, instance: true }" }],
37
+ "threes": [{"id": "integer", "initial": "{ value: 3, integer: 'many', instance: true }" }],
38
+ "four": [{"id": "integer", "initial": "{ value: 4, instance: true }" }],
39
+ "fours": [{"id": "integer", "initial": "{ value: 4, integer: 'many', instance: true }" }],
40
+ "five": [{"id": "integer", "initial": "{ value: 5, instance: true }" }],
41
+ "fives": [{"id": "integer", "initial": "{ value: 5, integer: 'many', instance: true }" }],
42
+ "six": [{"id": "integer", "initial": "{ value: 6, instance: true }" }],
43
+ "sixes": [{"id": "integer", "initial": "{ value: 6, integer: 'many', instance: true }" }],
44
+ "seven": [{"id": "integer", "initial": "{ value: 7, instance: true }" }],
45
+ "sevens": [{"id": "integer", "initial": "{ value: 7, integer: 'many', instance: true }" }],
46
+ "eight": [{"id": "integer", "initial": "{ value: 8, instance: true }" }],
47
+ "eights": [{"id": "integer", "initial": "{ value: 8, integer: 'many', instance: true }" }],
48
+ "nine": [{"id": "integer", "initial": "{ value: 9, instance: true }" }],
49
+ "nines": [{"id": "integer", "initial": "{ value: 9, integer: 'many', instance: true }" }],
50
+ "ten": [{"id": "integer", "initial": "{ value: 10, instance: true }" }],
51
+ "tens": [{"id": "integer", "initial": "{ value: 10, integer: 'many', instance: true }" }],
45
52
  },
46
53
  patterns: [
47
- { "pattern": [{ type: 'digit' }, { repeat: true }], defs: [{id: "number", uuid: '1', initial: "{ value: int(text), instance: true }" }]},
54
+ { "pattern": [{ type: 'digit' }, { repeat: true }], defs: [{id: "integer", uuid: '1', initial: "{ value: int(text), instance: true }" }]},
48
55
  { "pattern": [{ type: 'digit' }, { repeat: true }, '.', { type: 'digit' }, { repeat: true }], defs: [{id: "number", uuid: '1', initial: "{ value: float(text), instance: true }" }]},
49
56
  { "pattern": ['.', { type: 'digit' }, { repeat: true }], defs: [{id: "number", uuid: '1', initial: "{ value: float(text), instance: true }" }]},
50
57
  ],
@@ -58,7 +65,7 @@ let config = {
58
65
  generators: [
59
66
  {
60
67
  where: where(),
61
- match: ({context}) => context.marker == 'number' && context.leadingZeros && context.value >= 0,
68
+ match: ({context, isA}) => isA(context.marker, 'number', { extended: true }) && context.leadingZeros && context.value >= 0,
62
69
  apply: ({context}) => {
63
70
  value = `${context.value}`
64
71
  if (value.length < context.length) {
@@ -69,12 +76,12 @@ let config = {
69
76
  },
70
77
  {
71
78
  where: where(),
72
- match: ({context}) => context.marker == 'number' && context.number == 'many',
79
+ match: ({context}) => ['number', 'integer'].includes(context.marker) && context.number == 'many',
73
80
  apply: ({context}) => `${context.value}'s`
74
81
  },
75
82
  {
76
83
  where: where(),
77
- match: ({context}) => context.marker == 'number',
84
+ match: ({context}) => ['number', 'integer'].includes(context.marker),
78
85
  apply: ({context}) => `${context.value}`
79
86
  },
80
87
  ],
@@ -9,7 +9,7 @@
9
9
  "dead": true,
10
10
  "instance": true,
11
11
  "level": 1,
12
- "marker": "number",
12
+ "marker": "integer",
13
13
  "range": {
14
14
  "end": 1,
15
15
  "start": 0
@@ -28,12 +28,12 @@
28
28
  {
29
29
  "counter": 1,
30
30
  "op": [
31
- "number",
31
+ "integer",
32
32
  0
33
33
  ],
34
34
  "ops": [
35
35
  [
36
- "number",
36
+ "integer",
37
37
  0
38
38
  ]
39
39
  ]
@@ -43,12 +43,18 @@
43
43
  "objects": {
44
44
  "nameToUUID": {
45
45
  "gdefaults": "gdefaults2",
46
- "numbers": "numbers1"
46
+ "numbers": "numbers1",
47
+ "sdefaults": "sdefaults2",
48
+ "tokenize": "tokenize2"
47
49
  },
48
50
  "namespaced": {
49
51
  "gdefaults2": {
50
52
  },
51
53
  "numbers1": {
54
+ },
55
+ "sdefaults2": {
56
+ },
57
+ "tokenize2": {
52
58
  }
53
59
  },
54
60
  "processed": [
@@ -57,7 +63,7 @@
57
63
  "dead": true,
58
64
  "instance": true,
59
65
  "level": 1,
60
- "marker": "number",
66
+ "marker": "integer",
61
67
  "range": {
62
68
  "end": 1,
63
69
  "start": 0
@@ -97,7 +103,7 @@
97
103
  "dead": true,
98
104
  "instance": true,
99
105
  "level": 1,
100
- "marker": "number",
106
+ "marker": "integer",
101
107
  "range": {
102
108
  "end": 1,
103
109
  "start": 0
@@ -116,12 +122,12 @@
116
122
  {
117
123
  "counter": 1,
118
124
  "op": [
119
- "number",
125
+ "integer",
120
126
  0
121
127
  ],
122
128
  "ops": [
123
129
  [
124
- "number",
130
+ "integer",
125
131
  0
126
132
  ]
127
133
  ]
@@ -131,12 +137,18 @@
131
137
  "objects": {
132
138
  "nameToUUID": {
133
139
  "gdefaults": "gdefaults2",
134
- "numbers": "numbers1"
140
+ "numbers": "numbers1",
141
+ "sdefaults": "sdefaults2",
142
+ "tokenize": "tokenize2"
135
143
  },
136
144
  "namespaced": {
137
145
  "gdefaults2": {
138
146
  },
139
147
  "numbers1": {
148
+ },
149
+ "sdefaults2": {
150
+ },
151
+ "tokenize2": {
140
152
  }
141
153
  },
142
154
  "processed": [
@@ -145,7 +157,7 @@
145
157
  "dead": true,
146
158
  "instance": true,
147
159
  "level": 1,
148
- "marker": "number",
160
+ "marker": "integer",
149
161
  "range": {
150
162
  "end": 1,
151
163
  "start": 0
@@ -185,7 +197,7 @@
185
197
  "dead": true,
186
198
  "instance": true,
187
199
  "level": 1,
188
- "marker": "number",
200
+ "marker": "integer",
189
201
  "range": {
190
202
  "end": 1,
191
203
  "start": 0
@@ -204,12 +216,12 @@
204
216
  {
205
217
  "counter": 1,
206
218
  "op": [
207
- "number",
219
+ "integer",
208
220
  0
209
221
  ],
210
222
  "ops": [
211
223
  [
212
- "number",
224
+ "integer",
213
225
  0
214
226
  ]
215
227
  ]
@@ -219,12 +231,18 @@
219
231
  "objects": {
220
232
  "nameToUUID": {
221
233
  "gdefaults": "gdefaults2",
222
- "numbers": "numbers1"
234
+ "numbers": "numbers1",
235
+ "sdefaults": "sdefaults2",
236
+ "tokenize": "tokenize2"
223
237
  },
224
238
  "namespaced": {
225
239
  "gdefaults2": {
226
240
  },
227
241
  "numbers1": {
242
+ },
243
+ "sdefaults2": {
244
+ },
245
+ "tokenize2": {
228
246
  }
229
247
  },
230
248
  "processed": [
@@ -233,7 +251,7 @@
233
251
  "dead": true,
234
252
  "instance": true,
235
253
  "level": 1,
236
- "marker": "number",
254
+ "marker": "integer",
237
255
  "range": {
238
256
  "end": 1,
239
257
  "start": 0
@@ -307,12 +325,18 @@
307
325
  "objects": {
308
326
  "nameToUUID": {
309
327
  "gdefaults": "gdefaults2",
310
- "numbers": "numbers1"
328
+ "numbers": "numbers1",
329
+ "sdefaults": "sdefaults2",
330
+ "tokenize": "tokenize2"
311
331
  },
312
332
  "namespaced": {
313
333
  "gdefaults2": {
314
334
  },
315
335
  "numbers1": {
336
+ },
337
+ "sdefaults2": {
338
+ },
339
+ "tokenize2": {
316
340
  }
317
341
  },
318
342
  "processed": [
@@ -395,12 +419,18 @@
395
419
  "objects": {
396
420
  "nameToUUID": {
397
421
  "gdefaults": "gdefaults2",
398
- "numbers": "numbers1"
422
+ "numbers": "numbers1",
423
+ "sdefaults": "sdefaults2",
424
+ "tokenize": "tokenize2"
399
425
  },
400
426
  "namespaced": {
401
427
  "gdefaults2": {
402
428
  },
403
429
  "numbers1": {
430
+ },
431
+ "sdefaults2": {
432
+ },
433
+ "tokenize2": {
404
434
  }
405
435
  },
406
436
  "processed": [
@@ -446,6 +476,8 @@
446
476
  },
447
477
  "contexts": [
448
478
  {
479
+ "dead": true,
480
+ "level": 1,
449
481
  "marker": "unknown",
450
482
  "range": {
451
483
  "end": 1,
@@ -453,6 +485,7 @@
453
485
  },
454
486
  "text": "c1",
455
487
  "topLevel": true,
488
+ "unknown": true,
456
489
  "value": "c1",
457
490
  "word": "c1"
458
491
  }
@@ -462,22 +495,43 @@
462
495
  ],
463
496
  "metadata": {
464
497
  "opChoices": [
498
+ {
499
+ "counter": 1,
500
+ "op": [
501
+ "unknown",
502
+ 0
503
+ ],
504
+ "ops": [
505
+ [
506
+ "unknown",
507
+ 0
508
+ ]
509
+ ]
510
+ }
465
511
  ]
466
512
  },
467
513
  "objects": {
468
514
  "nameToUUID": {
469
515
  "gdefaults": "gdefaults2",
470
- "numbers": "numbers1"
516
+ "numbers": "numbers1",
517
+ "sdefaults": "sdefaults2",
518
+ "tokenize": "tokenize2"
471
519
  },
472
520
  "namespaced": {
473
521
  "gdefaults2": {
474
522
  },
475
523
  "numbers1": {
524
+ },
525
+ "sdefaults2": {
526
+ },
527
+ "tokenize2": {
476
528
  }
477
529
  },
478
530
  "processed": [
479
531
  {
480
532
  "context": {
533
+ "dead": true,
534
+ "level": 1,
481
535
  "marker": "unknown",
482
536
  "range": {
483
537
  "end": 1,
@@ -485,6 +539,7 @@
485
539
  },
486
540
  "text": "c1",
487
541
  "topLevel": true,
542
+ "unknown": true,
488
543
  "value": "c1",
489
544
  "word": "c1"
490
545
  },
@@ -21,6 +21,7 @@ let config = {
21
21
  words: ['percent', '%'],
22
22
  bridge: "{ ...next(operator), percentage: before[0], isResponse: true, semanticIsEvaluate: true, value: after[0] }",
23
23
  evaluator: async ({context, e}) => {
24
+ debugger
24
25
  const scale = context.percentage.scale
25
26
  const number = await e(context.value)
26
27
  const percentage = number.value * scale.value / 100
@@ -3,7 +3,7 @@
3
3
  "associations": [
4
4
  [
5
5
  [
6
- "number",
6
+ "integer",
7
7
  0
8
8
  ],
9
9
  [
@@ -30,14 +30,14 @@
30
30
  "dead": true,
31
31
  "instance": true,
32
32
  "level": 1,
33
- "marker": "number",
33
+ "marker": "integer",
34
34
  "range": {
35
35
  "end": 1,
36
36
  "start": 0
37
37
  },
38
38
  "text": "10",
39
39
  "types": [
40
- "number"
40
+ "integer"
41
41
  ],
42
42
  "value": 10,
43
43
  "word": "10"
@@ -56,12 +56,12 @@
56
56
  {
57
57
  "counter": 1,
58
58
  "op": [
59
- "number",
59
+ "integer",
60
60
  0
61
61
  ],
62
62
  "ops": [
63
63
  [
64
- "number",
64
+ "integer",
65
65
  0
66
66
  ],
67
67
  [
@@ -122,14 +122,14 @@
122
122
  "dead": true,
123
123
  "instance": true,
124
124
  "level": 1,
125
- "marker": "number",
125
+ "marker": "integer",
126
126
  "range": {
127
127
  "end": 1,
128
128
  "start": 0
129
129
  },
130
130
  "text": "10",
131
131
  "types": [
132
- "number"
132
+ "integer"
133
133
  ],
134
134
  "value": 10,
135
135
  "word": "10"
@@ -163,7 +163,7 @@
163
163
  "associations": [
164
164
  [
165
165
  [
166
- "number",
166
+ "integer",
167
167
  0
168
168
  ],
169
169
  [
@@ -190,14 +190,14 @@
190
190
  "dead": true,
191
191
  "instance": true,
192
192
  "level": 1,
193
- "marker": "number",
193
+ "marker": "integer",
194
194
  "range": {
195
195
  "end": 1,
196
196
  "start": 0
197
197
  },
198
198
  "text": "10",
199
199
  "types": [
200
- "number"
200
+ "integer"
201
201
  ],
202
202
  "value": 10,
203
203
  "word": "10"
@@ -216,12 +216,12 @@
216
216
  {
217
217
  "counter": 1,
218
218
  "op": [
219
- "number",
219
+ "integer",
220
220
  0
221
221
  ],
222
222
  "ops": [
223
223
  [
224
- "number",
224
+ "integer",
225
225
  0
226
226
  ],
227
227
  [
@@ -282,14 +282,14 @@
282
282
  "dead": true,
283
283
  "instance": true,
284
284
  "level": 1,
285
- "marker": "number",
285
+ "marker": "integer",
286
286
  "range": {
287
287
  "end": 1,
288
288
  "start": 0
289
289
  },
290
290
  "text": "10",
291
291
  "types": [
292
- "number"
292
+ "integer"
293
293
  ],
294
294
  "value": 10,
295
295
  "word": "10"
@@ -323,7 +323,7 @@
323
323
  "associations": [
324
324
  [
325
325
  [
326
- "number",
326
+ "integer",
327
327
  0
328
328
  ],
329
329
  [
@@ -337,7 +337,7 @@
337
337
  ],
338
338
  [
339
339
  [
340
- "number",
340
+ "integer",
341
341
  0
342
342
  ],
343
343
  [
@@ -370,14 +370,14 @@
370
370
  "dead": true,
371
371
  "instance": true,
372
372
  "level": 1,
373
- "marker": "number",
373
+ "marker": "integer",
374
374
  "range": {
375
375
  "end": 1,
376
376
  "start": 0
377
377
  },
378
378
  "text": "10",
379
379
  "types": [
380
- "number"
380
+ "integer"
381
381
  ],
382
382
  "value": 10,
383
383
  "word": "10"
@@ -407,7 +407,7 @@
407
407
  "evalue": 110,
408
408
  "instance": true,
409
409
  "level": 0,
410
- "marker": "number",
410
+ "marker": "integer",
411
411
  "range": {
412
412
  "end": 16,
413
413
  "start": 14
@@ -417,7 +417,7 @@
417
417
  "percentages#call3"
418
418
  ],
419
419
  "types": [
420
- "number"
420
+ "integer"
421
421
  ],
422
422
  "value": 11,
423
423
  "word": null
@@ -443,14 +443,14 @@
443
443
  "dead": true,
444
444
  "instance": true,
445
445
  "level": 1,
446
- "marker": "number",
446
+ "marker": "integer",
447
447
  "range": {
448
448
  "end": 1,
449
449
  "start": 0
450
450
  },
451
451
  "text": "10",
452
452
  "types": [
453
- "number"
453
+ "integer"
454
454
  ],
455
455
  "value": 10,
456
456
  "word": "10"
@@ -476,14 +476,14 @@
476
476
  "value": {
477
477
  "instance": true,
478
478
  "level": 0,
479
- "marker": "number",
479
+ "marker": "integer",
480
480
  "range": {
481
481
  "end": 16,
482
482
  "start": 14
483
483
  },
484
484
  "text": "110",
485
485
  "types": [
486
- "number"
486
+ "integer"
487
487
  ],
488
488
  "value": 110,
489
489
  "word": "110"
@@ -501,16 +501,16 @@
501
501
  {
502
502
  "counter": 1,
503
503
  "op": [
504
- "number",
504
+ "integer",
505
505
  0
506
506
  ],
507
507
  "ops": [
508
508
  [
509
- "number",
509
+ "integer",
510
510
  0
511
511
  ],
512
512
  [
513
- "number",
513
+ "integer",
514
514
  0
515
515
  ],
516
516
  [
@@ -531,7 +531,7 @@
531
531
  ],
532
532
  "ops": [
533
533
  [
534
- "number",
534
+ "integer",
535
535
  0
536
536
  ],
537
537
  [
@@ -552,7 +552,7 @@
552
552
  ],
553
553
  "ops": [
554
554
  [
555
- "number",
555
+ "integer",
556
556
  0
557
557
  ],
558
558
  [
@@ -606,14 +606,14 @@
606
606
  "dead": true,
607
607
  "instance": true,
608
608
  "level": 1,
609
- "marker": "number",
609
+ "marker": "integer",
610
610
  "range": {
611
611
  "end": 1,
612
612
  "start": 0
613
613
  },
614
614
  "text": "10",
615
615
  "types": [
616
- "number"
616
+ "integer"
617
617
  ],
618
618
  "value": 10,
619
619
  "word": "10"
@@ -643,7 +643,7 @@
643
643
  "evalue": 110,
644
644
  "instance": true,
645
645
  "level": 0,
646
- "marker": "number",
646
+ "marker": "integer",
647
647
  "range": {
648
648
  "end": 16,
649
649
  "start": 14
@@ -653,7 +653,7 @@
653
653
  "percentages#call3"
654
654
  ],
655
655
  "types": [
656
- "number"
656
+ "integer"
657
657
  ],
658
658
  "value": 11,
659
659
  "word": null
@@ -679,14 +679,14 @@
679
679
  "dead": true,
680
680
  "instance": true,
681
681
  "level": 1,
682
- "marker": "number",
682
+ "marker": "integer",
683
683
  "range": {
684
684
  "end": 1,
685
685
  "start": 0
686
686
  },
687
687
  "text": "10",
688
688
  "types": [
689
- "number"
689
+ "integer"
690
690
  ],
691
691
  "value": 10,
692
692
  "word": "10"
@@ -712,14 +712,14 @@
712
712
  "value": {
713
713
  "instance": true,
714
714
  "level": 0,
715
- "marker": "number",
715
+ "marker": "integer",
716
716
  "range": {
717
717
  "end": 16,
718
718
  "start": 14
719
719
  },
720
720
  "text": "110",
721
721
  "types": [
722
- "number"
722
+ "integer"
723
723
  ],
724
724
  "value": 110,
725
725
  "word": "110"