tpmkms_4wp 8.0.0-beta.30 → 8.0.0-beta.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/common/animals.instance.json +325 -0
  2. package/common/articles.js +108 -0
  3. package/common/articles.test.json +310 -0
  4. package/common/colors.instance.json +340 -0
  5. package/common/crew.instance.json +525 -0
  6. package/common/dialogues.js +66 -102
  7. package/common/dimension.instance.json +20 -0
  8. package/common/edible.instance.json +650 -28
  9. package/common/emotions.instance.json +25 -0
  10. package/common/evaluate.instance.json +2 -0
  11. package/common/evaluate.js +55 -0
  12. package/common/evaluate.test.json +574 -0
  13. package/common/fastfood.instance.json +1989 -329
  14. package/common/formulas.instance.json +20 -0
  15. package/common/gdefaults.js +6 -6
  16. package/common/help.test.json +16 -4
  17. package/common/helpers.js +1 -1
  18. package/common/kirk.instance.json +20 -0
  19. package/common/length.instance.json +300 -0
  20. package/common/math.instance.json +25 -0
  21. package/common/nameable.instance.json +2 -0
  22. package/common/nameable.js +137 -0
  23. package/common/nameable.test.json +1545 -0
  24. package/common/ordering.instance.json +50 -0
  25. package/common/people.instance.json +165 -0
  26. package/common/pipboy.instance.json +340 -0
  27. package/common/pokemon.instance.json +265 -0
  28. package/common/pressure.instance.json +80 -0
  29. package/common/properties.instance.json +25 -0
  30. package/common/reports.instance.json +41 -1
  31. package/common/spock.instance.json +20 -0
  32. package/common/stm.js +109 -3
  33. package/common/stm.test.json +1702 -1
  34. package/common/temperature.instance.json +192 -0
  35. package/common/ui.instance.json +20 -0
  36. package/common/weight.instance.json +240 -0
  37. package/main.js +6 -0
  38. package/package.json +13 -2
@@ -10,6 +10,11 @@
10
10
  "articlePOS",
11
11
  false
12
12
  ],
13
+ [
14
+ "adjective",
15
+ "adjective",
16
+ false
17
+ ],
13
18
  [
14
19
  "articlePOS",
15
20
  "articlePOS",
@@ -50,6 +55,11 @@
50
55
  "unknown",
51
56
  false
52
57
  ],
58
+ [
59
+ "evaluate",
60
+ "verby",
61
+ false
62
+ ],
53
63
  [
54
64
  "feel",
55
65
  "canBeDoQuestion",
@@ -120,6 +130,11 @@
120
130
  "toAble",
121
131
  false
122
132
  ],
133
+ [
134
+ "memorable",
135
+ "theAble",
136
+ false
137
+ ],
123
138
  [
124
139
  "modifies",
125
140
  "verby",
@@ -200,11 +215,21 @@
200
215
  "theAble",
201
216
  false
202
217
  ],
218
+ [
219
+ "remember",
220
+ "verby",
221
+ false
222
+ ],
203
223
  [
204
224
  "sentientBeing",
205
225
  "unknown",
206
226
  false
207
227
  ],
228
+ [
229
+ "stm_before",
230
+ "adjective",
231
+ false
232
+ ],
208
233
  [
209
234
  "that",
210
235
  "thisitthat",
@@ -0,0 +1,2 @@
1
+ {
2
+ }
@@ -0,0 +1,55 @@
1
+ const { Config, knowledgeModule, ensureTestFile, where, unflatten, flattens } = require('./runtime').theprogrammablemind
2
+ const { defaultContextCheck } = require('./helpers')
3
+ const tests = require('./evaluate.test.json')
4
+ const pos = require('./pos')
5
+ const gdefaults = require('./gdefaults')
6
+
7
+ const configStruct = {
8
+ name: 'evaluate',
9
+ operators: [
10
+ "([evaluate] (value))",
11
+ { pattern: "([value1])", development: true },
12
+ ],
13
+ bridges: [
14
+ {
15
+ id: 'value1',
16
+ evaluator: ({context}) => {
17
+ context.evalue = 'value1 after evaluation'
18
+ },
19
+ development: true,
20
+ },
21
+ {
22
+ id: 'evaluate',
23
+ isA: ['verby'],
24
+ bridge: "{ ...next(operator), postModifiers: ['value'], value: after[0] }",
25
+ semantic: async ({context, e}) => {
26
+ context.response = (await e(context.value)).evalue
27
+ context.isResponse = true
28
+ }
29
+ }
30
+ ],
31
+ };
32
+
33
+ const createConfig = async () => {
34
+ const config = new Config(configStruct, module)
35
+ config.stop_auto_rebuild()
36
+ await config.add(pos, gdefaults)
37
+ await config.restart_auto_rebuild()
38
+ return config
39
+ }
40
+
41
+ knowledgeModule({
42
+ module,
43
+ description: 'Explicit handling of evaluate',
44
+ createConfig,
45
+ test: {
46
+ name: './evaluate.test.json',
47
+ contents: tests,
48
+ include: {
49
+ words: true,
50
+ },
51
+ checks: {
52
+ context: defaultContextCheck,
53
+ },
54
+ },
55
+ })
@@ -0,0 +1,574 @@
1
+ [
2
+ {
3
+ "associations": [
4
+ [
5
+ [
6
+ "evaluate",
7
+ 0
8
+ ],
9
+ [
10
+ "value1",
11
+ 0
12
+ ]
13
+ ]
14
+ ],
15
+ "config": {
16
+ "words": {
17
+ "hierarchy": [
18
+ {
19
+ "child": " ",
20
+ "parent": "space"
21
+ },
22
+ {
23
+ "child": "0",
24
+ "parent": "digit"
25
+ },
26
+ {
27
+ "child": "1",
28
+ "parent": "digit"
29
+ },
30
+ {
31
+ "child": "2",
32
+ "parent": "digit"
33
+ },
34
+ {
35
+ "child": "3",
36
+ "parent": "digit"
37
+ },
38
+ {
39
+ "child": "4",
40
+ "parent": "digit"
41
+ },
42
+ {
43
+ "child": "5",
44
+ "parent": "digit"
45
+ },
46
+ {
47
+ "child": "6",
48
+ "parent": "digit"
49
+ },
50
+ {
51
+ "child": "7",
52
+ "parent": "digit"
53
+ },
54
+ {
55
+ "child": "8",
56
+ "parent": "digit"
57
+ },
58
+ {
59
+ "child": "9",
60
+ "parent": "digit"
61
+ },
62
+ {
63
+ "child": "lower",
64
+ "parent": "letter"
65
+ },
66
+ {
67
+ "child": "upper",
68
+ "parent": "letter"
69
+ },
70
+ {
71
+ "child": "a",
72
+ "parent": "lower"
73
+ },
74
+ {
75
+ "child": "b",
76
+ "parent": "lower"
77
+ },
78
+ {
79
+ "child": "c",
80
+ "parent": "lower"
81
+ },
82
+ {
83
+ "child": "d",
84
+ "parent": "lower"
85
+ },
86
+ {
87
+ "child": "e",
88
+ "parent": "lower"
89
+ },
90
+ {
91
+ "child": "f",
92
+ "parent": "lower"
93
+ },
94
+ {
95
+ "child": "g",
96
+ "parent": "lower"
97
+ },
98
+ {
99
+ "child": "h",
100
+ "parent": "lower"
101
+ },
102
+ {
103
+ "child": "i",
104
+ "parent": "lower"
105
+ },
106
+ {
107
+ "child": "j",
108
+ "parent": "lower"
109
+ },
110
+ {
111
+ "child": "k",
112
+ "parent": "lower"
113
+ },
114
+ {
115
+ "child": "l",
116
+ "parent": "lower"
117
+ },
118
+ {
119
+ "child": "m",
120
+ "parent": "lower"
121
+ },
122
+ {
123
+ "child": "n",
124
+ "parent": "lower"
125
+ },
126
+ {
127
+ "child": "o",
128
+ "parent": "lower"
129
+ },
130
+ {
131
+ "child": "p",
132
+ "parent": "lower"
133
+ },
134
+ {
135
+ "child": "q",
136
+ "parent": "lower"
137
+ },
138
+ {
139
+ "child": "r",
140
+ "parent": "lower"
141
+ },
142
+ {
143
+ "child": "s",
144
+ "parent": "lower"
145
+ },
146
+ {
147
+ "child": "t",
148
+ "parent": "lower"
149
+ },
150
+ {
151
+ "child": "u",
152
+ "parent": "lower"
153
+ },
154
+ {
155
+ "child": "v",
156
+ "parent": "lower"
157
+ },
158
+ {
159
+ "child": "w",
160
+ "parent": "lower"
161
+ },
162
+ {
163
+ "child": "x",
164
+ "parent": "lower"
165
+ },
166
+ {
167
+ "child": "y",
168
+ "parent": "lower"
169
+ },
170
+ {
171
+ "child": "z",
172
+ "parent": "lower"
173
+ },
174
+ {
175
+ "child": "A",
176
+ "parent": "upper"
177
+ },
178
+ {
179
+ "child": "B",
180
+ "parent": "upper"
181
+ },
182
+ {
183
+ "child": "C",
184
+ "parent": "upper"
185
+ },
186
+ {
187
+ "child": "D",
188
+ "parent": "upper"
189
+ },
190
+ {
191
+ "child": "E",
192
+ "parent": "upper"
193
+ },
194
+ {
195
+ "child": "F",
196
+ "parent": "upper"
197
+ },
198
+ {
199
+ "child": "G",
200
+ "parent": "upper"
201
+ },
202
+ {
203
+ "child": "H",
204
+ "parent": "upper"
205
+ },
206
+ {
207
+ "child": "I",
208
+ "parent": "upper"
209
+ },
210
+ {
211
+ "child": "J",
212
+ "parent": "upper"
213
+ },
214
+ {
215
+ "child": "K",
216
+ "parent": "upper"
217
+ },
218
+ {
219
+ "child": "L",
220
+ "parent": "upper"
221
+ },
222
+ {
223
+ "child": "M",
224
+ "parent": "upper"
225
+ },
226
+ {
227
+ "child": "N",
228
+ "parent": "upper"
229
+ },
230
+ {
231
+ "child": "O",
232
+ "parent": "upper"
233
+ },
234
+ {
235
+ "child": "P",
236
+ "parent": "upper"
237
+ },
238
+ {
239
+ "child": "Q",
240
+ "parent": "upper"
241
+ },
242
+ {
243
+ "child": "R",
244
+ "parent": "upper"
245
+ },
246
+ {
247
+ "child": "S",
248
+ "parent": "upper"
249
+ },
250
+ {
251
+ "child": "T",
252
+ "parent": "upper"
253
+ },
254
+ {
255
+ "child": "U",
256
+ "parent": "upper"
257
+ },
258
+ {
259
+ "child": "V",
260
+ "parent": "upper"
261
+ },
262
+ {
263
+ "child": "W",
264
+ "parent": "upper"
265
+ },
266
+ {
267
+ "child": "X",
268
+ "parent": "upper"
269
+ },
270
+ {
271
+ "child": "Y",
272
+ "parent": "upper"
273
+ },
274
+ {
275
+ "child": "Z",
276
+ "parent": "upper"
277
+ },
278
+ {
279
+ "child": "letter",
280
+ "parent": "alphanumeric"
281
+ },
282
+ {
283
+ "child": "digit",
284
+ "parent": "alphanumeric"
285
+ },
286
+ {
287
+ "child": "_",
288
+ "parent": "alphanumeric"
289
+ },
290
+ {
291
+ "child": "~",
292
+ "parent": "punctuation"
293
+ },
294
+ {
295
+ "child": "!",
296
+ "parent": "punctuation"
297
+ },
298
+ {
299
+ "child": "@",
300
+ "parent": "punctuation"
301
+ },
302
+ {
303
+ "child": "#",
304
+ "parent": "punctuation"
305
+ },
306
+ {
307
+ "child": "$",
308
+ "parent": "punctuation"
309
+ },
310
+ {
311
+ "child": "%",
312
+ "parent": "punctuation"
313
+ },
314
+ {
315
+ "child": "^",
316
+ "parent": "punctuation"
317
+ },
318
+ {
319
+ "child": "&",
320
+ "parent": "punctuation"
321
+ },
322
+ {
323
+ "child": "*",
324
+ "parent": "punctuation"
325
+ },
326
+ {
327
+ "child": "(",
328
+ "parent": "punctuation"
329
+ },
330
+ {
331
+ "child": ")",
332
+ "parent": "punctuation"
333
+ },
334
+ {
335
+ "child": "+",
336
+ "parent": "punctuation"
337
+ },
338
+ {
339
+ "child": "-",
340
+ "parent": "punctuation"
341
+ },
342
+ {
343
+ "child": "=",
344
+ "parent": "punctuation"
345
+ },
346
+ {
347
+ "child": "[",
348
+ "parent": "punctuation"
349
+ },
350
+ {
351
+ "child": "]",
352
+ "parent": "punctuation"
353
+ },
354
+ {
355
+ "child": "{",
356
+ "parent": "punctuation"
357
+ },
358
+ {
359
+ "child": "}",
360
+ "parent": "punctuation"
361
+ },
362
+ {
363
+ "child": "\\",
364
+ "parent": "punctuation"
365
+ },
366
+ {
367
+ "child": "|",
368
+ "parent": "punctuation"
369
+ },
370
+ {
371
+ "child": ";",
372
+ "parent": "punctuation"
373
+ },
374
+ {
375
+ "child": ":",
376
+ "parent": "punctuation"
377
+ },
378
+ {
379
+ "child": ",",
380
+ "parent": "punctuation"
381
+ },
382
+ {
383
+ "child": "<",
384
+ "parent": "punctuation"
385
+ },
386
+ {
387
+ "child": ">",
388
+ "parent": "punctuation"
389
+ },
390
+ {
391
+ "child": "/",
392
+ "parent": "punctuation"
393
+ },
394
+ {
395
+ "child": "?",
396
+ "parent": "punctuation"
397
+ },
398
+ {
399
+ "child": "'",
400
+ "parent": "punctuation"
401
+ },
402
+ {
403
+ "child": "\"",
404
+ "parent": "punctuation"
405
+ }
406
+ ],
407
+ "literals": {
408
+ },
409
+ "patterns": [
410
+ {
411
+ "defs": [
412
+ {
413
+ "remove": true,
414
+ "uuid": "tokenize2"
415
+ }
416
+ ],
417
+ "pattern": [
418
+ {
419
+ "type": "space"
420
+ },
421
+ {
422
+ "repeat": true
423
+ }
424
+ ]
425
+ },
426
+ {
427
+ "defs": [
428
+ {
429
+ "id": "unknown",
430
+ "initial": "{ value: text, unknown: true }",
431
+ "uuid": "tokenize2"
432
+ }
433
+ ],
434
+ "pattern": [
435
+ {
436
+ "type": "alphanumeric"
437
+ },
438
+ {
439
+ "repeat": true
440
+ }
441
+ ]
442
+ }
443
+ ]
444
+ }
445
+ },
446
+ "contexts": [
447
+ {
448
+ "dead": true,
449
+ "default": true,
450
+ "isResponse": true,
451
+ "level": 1,
452
+ "marker": "evaluate",
453
+ "postModifiers": [
454
+ "value"
455
+ ],
456
+ "range": {
457
+ "end": 14,
458
+ "start": 0
459
+ },
460
+ "response": "value1 after evaluation",
461
+ "text": "evaluate value1",
462
+ "topLevel": true,
463
+ "touchedBy": [
464
+ "evaluate#call2"
465
+ ],
466
+ "value": {
467
+ "default": true,
468
+ "level": 0,
469
+ "marker": "value1",
470
+ "range": {
471
+ "end": 14,
472
+ "start": 9
473
+ },
474
+ "text": "value1",
475
+ "value": "value1",
476
+ "word": "value1"
477
+ },
478
+ "word": "evaluate"
479
+ }
480
+ ],
481
+ "generatedParenthesized": [
482
+ "(value1 after evaluation)"
483
+ ],
484
+ "metadata": {
485
+ "opChoices": [
486
+ {
487
+ "counter": 1,
488
+ "op": [
489
+ "evaluate",
490
+ 0
491
+ ],
492
+ "ops": [
493
+ [
494
+ "evaluate",
495
+ 0
496
+ ],
497
+ [
498
+ "value1",
499
+ 0
500
+ ]
501
+ ]
502
+ }
503
+ ]
504
+ },
505
+ "objects": {
506
+ "nameToUUID": {
507
+ "evaluate": "evaluate1",
508
+ "gdefaults": "gdefaults2",
509
+ "tokenize": "tokenize2"
510
+ },
511
+ "namespaced": {
512
+ "evaluate1": {
513
+ },
514
+ "gdefaults2": {
515
+ },
516
+ "tokenize2": {
517
+ }
518
+ },
519
+ "processed": [
520
+ {
521
+ "context": {
522
+ "dead": true,
523
+ "default": true,
524
+ "isResponse": true,
525
+ "level": 1,
526
+ "marker": "evaluate",
527
+ "postModifiers": [
528
+ "value"
529
+ ],
530
+ "range": {
531
+ "end": 14,
532
+ "start": 0
533
+ },
534
+ "response": "value1 after evaluation",
535
+ "text": "evaluate value1",
536
+ "topLevel": true,
537
+ "touchedBy": [
538
+ "evaluate#call2"
539
+ ],
540
+ "value": {
541
+ "default": true,
542
+ "level": 0,
543
+ "marker": "value1",
544
+ "range": {
545
+ "end": 14,
546
+ "start": 9
547
+ },
548
+ "text": "value1",
549
+ "value": "value1",
550
+ "word": "value1"
551
+ },
552
+ "word": "evaluate"
553
+ },
554
+ "generatedParenthesized": "(value1 after evaluation)",
555
+ "paraphrases": "evaluate value1",
556
+ "paraphrasesParenthesized": "((evaluate) (value1))",
557
+ "responses": [
558
+ "value1 after evaluation"
559
+ ]
560
+ }
561
+ ]
562
+ },
563
+ "paraphrases": [
564
+ "evaluate value1"
565
+ ],
566
+ "paraphrasesParenthesized": [
567
+ "((evaluate) (value1))"
568
+ ],
569
+ "query": "evaluate value1",
570
+ "responses": [
571
+ "value1 after evaluation"
572
+ ]
573
+ }
574
+ ]