tpmkms 8.3.0 → 8.4.0-beta.0

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
  },
@@ -730,6 +730,32 @@
730
730
  0
731
731
  ]
732
732
  ],
733
+ [
734
+ [
735
+ "between",
736
+ 0
737
+ ],
738
+ [
739
+ "is",
740
+ 0
741
+ ],
742
+ [
743
+ "list",
744
+ 0
745
+ ],
746
+ [
747
+ "unknown",
748
+ 0
749
+ ],
750
+ [
751
+ "unknown",
752
+ 1
753
+ ],
754
+ [
755
+ "xfx",
756
+ 0
757
+ ]
758
+ ],
733
759
  [
734
760
  [
735
761
  "between",
@@ -2253,6 +2279,32 @@
2253
2279
  0
2254
2280
  ]
2255
2281
  ],
2282
+ [
2283
+ [
2284
+ "between",
2285
+ 0
2286
+ ],
2287
+ [
2288
+ "is",
2289
+ 0
2290
+ ],
2291
+ [
2292
+ "list",
2293
+ 0
2294
+ ],
2295
+ [
2296
+ "unknown",
2297
+ 0
2298
+ ],
2299
+ [
2300
+ "unknown",
2301
+ 1
2302
+ ],
2303
+ [
2304
+ "xfx",
2305
+ 0
2306
+ ]
2307
+ ],
2256
2308
  [
2257
2309
  [
2258
2310
  "between",
@@ -14,7 +14,6 @@ let config = {
14
14
  bridges: [
15
15
  {
16
16
  id: "ordinal",
17
- isA: ['number'],
18
17
  bridge: "{ instance: false, ordinal: true, ...next(operator) }"
19
18
  },
20
19
  {
@@ -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