tpmkms_4wp 8.9.0 → 8.9.1-beta.1

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/common/animals.instance.json +65 -36
  2. package/common/articles.js +4 -0
  3. package/common/colors.instance.json +77 -106
  4. package/common/comparable.instance.json +15 -0
  5. package/common/conjunction.js +27 -18
  6. package/common/countable.js +8 -2
  7. package/common/countable.test.json +586 -0
  8. package/common/crew.instance.json +142 -504
  9. package/common/dialogues.js +16 -11
  10. package/common/dimension.instance.json +10 -36
  11. package/common/edible.instance.json +324 -224
  12. package/common/emotions.instance.json +8 -60
  13. package/common/fastfood.instance.json +1464 -216
  14. package/common/formulas.instance.json +10 -0
  15. package/common/helpers/conjunction.js +75 -0
  16. package/common/helpers/dialogues.js +14 -8
  17. package/common/helpers/properties.js +2 -2
  18. package/common/helpers.js +29 -0
  19. package/common/hierarchy.js +5 -5
  20. package/common/hierarchy.test.json +1491 -0
  21. package/common/kirk.instance.json +5 -0
  22. package/common/length.instance.json +150 -0
  23. package/common/math.instance.json +10 -0
  24. package/common/meta.js +5 -3
  25. package/common/ordering.instance.json +78 -0
  26. package/common/people.instance.json +169 -4
  27. package/common/pipboy.instance.json +203 -177
  28. package/common/pipboy.js +0 -1
  29. package/common/pipboy.test.json +494 -251
  30. package/common/pokemon.instance.json +71 -6
  31. package/common/pos.js +12 -6
  32. package/common/pressure.instance.json +40 -0
  33. package/common/properties.instance.json +5 -44
  34. package/common/reports.instance.json +21 -1
  35. package/common/spock.instance.json +5 -0
  36. package/common/temperature.instance.json +40 -0
  37. package/common/ui.instance.json +135 -0
  38. package/common/ui.js +11 -5
  39. package/common/weight.instance.json +120 -0
  40. package/common/wp.instance.json +30067 -0
  41. package/common/wp.js +256 -0
  42. package/common/wp.test.json +41469 -0
  43. package/main.js +2 -0
  44. package/package.json +7 -2
@@ -127,6 +127,11 @@
127
127
  "verb",
128
128
  false
129
129
  ],
130
+ [
131
+ "negatable",
132
+ "queryable",
133
+ false
134
+ ],
130
135
  [
131
136
  "noun",
132
137
  "theAble",
@@ -570,24 +575,6 @@
570
575
  1
571
576
  ]
572
577
  ],
573
- [
574
- [
575
- "is",
576
- 0
577
- ],
578
- [
579
- "list",
580
- 0
581
- ],
582
- [
583
- "unknown",
584
- 0
585
- ],
586
- [
587
- "unknown",
588
- 1
589
- ]
590
- ],
591
578
  [
592
579
  [
593
580
  "is",
@@ -860,6 +847,11 @@
860
847
  "verb",
861
848
  false
862
849
  ],
850
+ [
851
+ "negatable",
852
+ "queryable",
853
+ false
854
+ ],
863
855
  [
864
856
  "noun",
865
857
  "theAble",
@@ -1470,6 +1462,11 @@
1470
1462
  "verb",
1471
1463
  false
1472
1464
  ],
1465
+ [
1466
+ "negatable",
1467
+ "queryable",
1468
+ false
1469
+ ],
1473
1470
  [
1474
1471
  "noun",
1475
1472
  "theAble",
@@ -2080,6 +2077,11 @@
2080
2077
  "verb",
2081
2078
  false
2082
2079
  ],
2080
+ [
2081
+ "negatable",
2082
+ "queryable",
2083
+ false
2084
+ ],
2083
2085
  [
2084
2086
  "noun",
2085
2087
  "theAble",
@@ -2742,6 +2744,11 @@
2742
2744
  "verb",
2743
2745
  false
2744
2746
  ],
2747
+ [
2748
+ "negatable",
2749
+ "queryable",
2750
+ false
2751
+ ],
2745
2752
  [
2746
2753
  "noun",
2747
2754
  "theAble",
@@ -3352,6 +3359,11 @@
3352
3359
  "verb",
3353
3360
  false
3354
3361
  ],
3362
+ [
3363
+ "negatable",
3364
+ "queryable",
3365
+ false
3366
+ ],
3355
3367
  [
3356
3368
  "noun",
3357
3369
  "theAble",
@@ -3962,6 +3974,11 @@
3962
3974
  "verb",
3963
3975
  false
3964
3976
  ],
3977
+ [
3978
+ "negatable",
3979
+ "queryable",
3980
+ false
3981
+ ],
3965
3982
  [
3966
3983
  "noun",
3967
3984
  "theAble",
@@ -4572,6 +4589,11 @@
4572
4589
  "verb",
4573
4590
  false
4574
4591
  ],
4592
+ [
4593
+ "negatable",
4594
+ "queryable",
4595
+ false
4596
+ ],
4575
4597
  [
4576
4598
  "noun",
4577
4599
  "theAble",
@@ -5182,6 +5204,11 @@
5182
5204
  "verb",
5183
5205
  false
5184
5206
  ],
5207
+ [
5208
+ "negatable",
5209
+ "queryable",
5210
+ false
5211
+ ],
5185
5212
  [
5186
5213
  "noun",
5187
5214
  "theAble",
@@ -6243,6 +6270,11 @@
6243
6270
  "verb",
6244
6271
  false
6245
6272
  ],
6273
+ [
6274
+ "negatable",
6275
+ "queryable",
6276
+ false
6277
+ ],
6246
6278
  [
6247
6279
  "noun",
6248
6280
  "theAble",
@@ -7344,6 +7376,11 @@
7344
7376
  "verb",
7345
7377
  false
7346
7378
  ],
7379
+ [
7380
+ "negatable",
7381
+ "queryable",
7382
+ false
7383
+ ],
7347
7384
  [
7348
7385
  "noun",
7349
7386
  "theAble",
@@ -8305,6 +8342,11 @@
8305
8342
  "verb",
8306
8343
  false
8307
8344
  ],
8345
+ [
8346
+ "negatable",
8347
+ "queryable",
8348
+ false
8349
+ ],
8308
8350
  [
8309
8351
  "noun",
8310
8352
  "theAble",
@@ -9442,6 +9484,11 @@
9442
9484
  "verb",
9443
9485
  false
9444
9486
  ],
9487
+ [
9488
+ "negatable",
9489
+ "queryable",
9490
+ false
9491
+ ],
9445
9492
  [
9446
9493
  "noun",
9447
9494
  "theAble",
@@ -10585,24 +10632,6 @@
10585
10632
  1
10586
10633
  ]
10587
10634
  ],
10588
- [
10589
- [
10590
- "is",
10591
- 0
10592
- ],
10593
- [
10594
- "list",
10595
- 0
10596
- ],
10597
- [
10598
- "unknown",
10599
- 0
10600
- ],
10601
- [
10602
- "unknown",
10603
- 1
10604
- ]
10605
- ],
10606
10635
  [
10607
10636
  [
10608
10637
  "is",
@@ -11,6 +11,7 @@ let config = {
11
11
  "([it])",
12
12
  "([this])",
13
13
  "([that])",
14
+ "([everything])",
14
15
  "([queryable])",
15
16
  /*
16
17
  "(<what> ([whatAble|]))",
@@ -22,6 +23,9 @@ let config = {
22
23
  bridges: [
23
24
  // { id: "what", level: 0, optional: "{ ...next(operator), query: ['what'], determined: true }", bridge: "{ ...after, query: ['what'], modifiers: ['what'], what: operator }" },
24
25
  // { id: "whatAble", level: 0, bridge: "{ ...next(operator) }" },
26
+ {
27
+ id: 'everything',
28
+ },
25
29
  {
26
30
  id: 'the',
27
31
  level: 0,
@@ -244,6 +244,11 @@
244
244
  "verb",
245
245
  false
246
246
  ],
247
+ [
248
+ "negatable",
249
+ "queryable",
250
+ false
251
+ ],
247
252
  [
248
253
  "noun",
249
254
  "theAble",
@@ -648,6 +653,11 @@
648
653
  "verb",
649
654
  false
650
655
  ],
656
+ [
657
+ "negatable",
658
+ "queryable",
659
+ false
660
+ ],
651
661
  [
652
662
  "noun",
653
663
  "theAble",
@@ -1091,24 +1101,6 @@
1091
1101
  1
1092
1102
  ]
1093
1103
  ],
1094
- [
1095
- [
1096
- "is",
1097
- 0
1098
- ],
1099
- [
1100
- "list",
1101
- 0
1102
- ],
1103
- [
1104
- "unknown",
1105
- 0
1106
- ],
1107
- [
1108
- "unknown",
1109
- 1
1110
- ]
1111
- ],
1112
1104
  [
1113
1105
  [
1114
1106
  "is",
@@ -1381,6 +1373,11 @@
1381
1373
  "verb",
1382
1374
  false
1383
1375
  ],
1376
+ [
1377
+ "negatable",
1378
+ "queryable",
1379
+ false
1380
+ ],
1384
1381
  [
1385
1382
  "noun",
1386
1383
  "theAble",
@@ -2676,7 +2673,7 @@
2676
2673
  ],
2677
2674
  "ops": [
2678
2675
  [
2679
- "isEd",
2676
+ "is",
2680
2677
  0
2681
2678
  ],
2682
2679
  [
@@ -2693,7 +2690,7 @@
2693
2690
  ],
2694
2691
  "ops": [
2695
2692
  [
2696
- "isEd",
2693
+ "is",
2697
2694
  0
2698
2695
  ],
2699
2696
  [
@@ -2710,7 +2707,7 @@
2710
2707
  ],
2711
2708
  "ops": [
2712
2709
  [
2713
- "isEd",
2710
+ "is",
2714
2711
  0
2715
2712
  ],
2716
2713
  [
@@ -2727,7 +2724,7 @@
2727
2724
  ],
2728
2725
  "ops": [
2729
2726
  [
2730
- "isEd",
2727
+ "is",
2731
2728
  0
2732
2729
  ],
2733
2730
  [
@@ -2744,7 +2741,7 @@
2744
2741
  ],
2745
2742
  "ops": [
2746
2743
  [
2747
- "isEd",
2744
+ "is",
2748
2745
  0
2749
2746
  ],
2750
2747
  [
@@ -2761,7 +2758,7 @@
2761
2758
  ],
2762
2759
  "ops": [
2763
2760
  [
2764
- "isEd",
2761
+ "is",
2765
2762
  0
2766
2763
  ],
2767
2764
  [
@@ -3232,28 +3229,6 @@
3232
3229
  1
3233
3230
  ]
3234
3231
  ],
3235
- [
3236
- [
3237
- "comma",
3238
- 0
3239
- ],
3240
- [
3241
- "is",
3242
- 0
3243
- ],
3244
- [
3245
- "list",
3246
- 0
3247
- ],
3248
- [
3249
- "unknown",
3250
- 0
3251
- ],
3252
- [
3253
- "unknown",
3254
- 1
3255
- ]
3256
- ],
3257
3232
  [
3258
3233
  [
3259
3234
  "comma",
@@ -3303,16 +3278,6 @@
3303
3278
  "unknown",
3304
3279
  1
3305
3280
  ]
3306
- ],
3307
- [
3308
- [
3309
- "list",
3310
- 1
3311
- ],
3312
- [
3313
- "unknown",
3314
- 1
3315
- ]
3316
3281
  ]
3317
3282
  ],
3318
3283
  "learned_contextual_priorities": [],
@@ -3753,6 +3718,11 @@
3753
3718
  "verb",
3754
3719
  false
3755
3720
  ],
3721
+ [
3722
+ "negatable",
3723
+ "queryable",
3724
+ false
3725
+ ],
3756
3726
  [
3757
3727
  "noun",
3758
3728
  "theAble",
@@ -4893,6 +4863,11 @@
4893
4863
  "verb",
4894
4864
  false
4895
4865
  ],
4866
+ [
4867
+ "negatable",
4868
+ "queryable",
4869
+ false
4870
+ ],
4896
4871
  [
4897
4872
  "noun",
4898
4873
  "theAble",
@@ -6265,6 +6240,11 @@
6265
6240
  "verb",
6266
6241
  false
6267
6242
  ],
6243
+ [
6244
+ "negatable",
6245
+ "queryable",
6246
+ false
6247
+ ],
6268
6248
  [
6269
6249
  "noun",
6270
6250
  "theAble",
@@ -8103,6 +8083,11 @@
8103
8083
  "verb",
8104
8084
  false
8105
8085
  ],
8086
+ [
8087
+ "negatable",
8088
+ "queryable",
8089
+ false
8090
+ ],
8106
8091
  [
8107
8092
  "noun",
8108
8093
  "theAble",
@@ -10061,6 +10046,11 @@
10061
10046
  "verb",
10062
10047
  false
10063
10048
  ],
10049
+ [
10050
+ "negatable",
10051
+ "queryable",
10052
+ false
10053
+ ],
10064
10054
  [
10065
10055
  "noun",
10066
10056
  "theAble",
@@ -12426,6 +12416,11 @@
12426
12416
  "theAble",
12427
12417
  false
12428
12418
  ],
12419
+ [
12420
+ "negatable",
12421
+ "queryable",
12422
+ false
12423
+ ],
12429
12424
  [
12430
12425
  "noun",
12431
12426
  "theAble",
@@ -14553,6 +14548,11 @@
14553
14548
  "theAble",
14554
14549
  false
14555
14550
  ],
14551
+ [
14552
+ "negatable",
14553
+ "queryable",
14554
+ false
14555
+ ],
14556
14556
  [
14557
14557
  "noun",
14558
14558
  "theAble",
@@ -17031,6 +17031,11 @@
17031
17031
  "theAble",
17032
17032
  false
17033
17033
  ],
17034
+ [
17035
+ "negatable",
17036
+ "queryable",
17037
+ false
17038
+ ],
17034
17039
  [
17035
17040
  "noun",
17036
17041
  "theAble",
@@ -19243,6 +19248,11 @@
19243
19248
  "theAble",
19244
19249
  false
19245
19250
  ],
19251
+ [
19252
+ "negatable",
19253
+ "queryable",
19254
+ false
19255
+ ],
19246
19256
  [
19247
19257
  "noun",
19248
19258
  "theAble",
@@ -21312,6 +21322,11 @@
21312
21322
  "theAble",
21313
21323
  false
21314
21324
  ],
21325
+ [
21326
+ "negatable",
21327
+ "queryable",
21328
+ false
21329
+ ],
21315
21330
  [
21316
21331
  "noun",
21317
21332
  "theAble",
@@ -23602,6 +23617,11 @@
23602
23617
  "theAble",
23603
23618
  false
23604
23619
  ],
23620
+ [
23621
+ "negatable",
23622
+ "queryable",
23623
+ false
23624
+ ],
23605
23625
  [
23606
23626
  "noun",
23607
23627
  "theAble",
@@ -24373,6 +24393,7 @@
24373
24393
  "default": true,
24374
24394
  "text": "resetidsuffix",
24375
24395
  "word": "resetidsuffix",
24396
+ "raw_text": "resetIdSuffix",
24376
24397
  "range": {
24377
24398
  "start": 0,
24378
24399
  "end": 12
@@ -25563,28 +25584,6 @@
25563
25584
  1
25564
25585
  ]
25565
25586
  ],
25566
- [
25567
- [
25568
- "comma",
25569
- 0
25570
- ],
25571
- [
25572
- "is",
25573
- 0
25574
- ],
25575
- [
25576
- "list",
25577
- 0
25578
- ],
25579
- [
25580
- "unknown",
25581
- 0
25582
- ],
25583
- [
25584
- "unknown",
25585
- 1
25586
- ]
25587
- ],
25588
25587
  [
25589
25588
  [
25590
25589
  "comma",
@@ -25653,24 +25652,6 @@
25653
25652
  1
25654
25653
  ]
25655
25654
  ],
25656
- [
25657
- [
25658
- "is",
25659
- 0
25660
- ],
25661
- [
25662
- "list",
25663
- 0
25664
- ],
25665
- [
25666
- "unknown",
25667
- 0
25668
- ],
25669
- [
25670
- "unknown",
25671
- 1
25672
- ]
25673
- ],
25674
25655
  [
25675
25656
  [
25676
25657
  "is",
@@ -25793,16 +25774,6 @@
25793
25774
  1
25794
25775
  ]
25795
25776
  ],
25796
- [
25797
- [
25798
- "list",
25799
- 1
25800
- ],
25801
- [
25802
- "unknown",
25803
- 1
25804
- ]
25805
- ],
25806
25777
  [
25807
25778
  [
25808
25779
  "modifies",
@@ -133,6 +133,11 @@
133
133
  "verb",
134
134
  false
135
135
  ],
136
+ [
137
+ "negatable",
138
+ "queryable",
139
+ false
140
+ ],
136
141
  [
137
142
  "noun",
138
143
  "theAble",
@@ -527,6 +532,11 @@
527
532
  "verb",
528
533
  false
529
534
  ],
535
+ [
536
+ "negatable",
537
+ "queryable",
538
+ false
539
+ ],
530
540
  [
531
541
  "noun",
532
542
  "theAble",
@@ -1119,6 +1129,11 @@
1119
1129
  "verb",
1120
1130
  false
1121
1131
  ],
1132
+ [
1133
+ "negatable",
1134
+ "queryable",
1135
+ false
1136
+ ],
1122
1137
  [
1123
1138
  "noun",
1124
1139
  "theAble",
@@ -1,7 +1,8 @@
1
1
  const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const gdefaults = require('./gdefaults.js')
3
3
  const conjunction_tests = require('./conjunction.test.json')
4
- const { defaultContextCheck } = require('./helpers')
4
+ const { defaultContextCheck, propertyToArray } = require('./helpers')
5
+ const { isA, asList, listable } = require('./helpers/conjunction.js')
5
6
 
6
7
  let config = {
7
8
  name: 'conjunction',
@@ -64,24 +65,32 @@ let config = {
64
65
  };
65
66
 
66
67
  const initializer = ({objects, config, isModule}) => {
67
- config.addArgs(({config, api, isA}) => ({
68
- isAListable: (context, type) => {
69
- if (context.marker == 'list' || context.listable) {
70
- return context.value.every( (element) => isA(element.marker, type) )
71
- } else {
72
- return isA(context.marker, type)
73
- }
74
- },
75
- toContext: (v) => {
76
- if (Array.isArray(v)) {
77
- return { marker: 'list', level: 1, value: v }
78
- }
79
- if (v.marker == 'list') {
68
+ config.addArgs(({config, api, hierarchy}) => {
69
+ const isAI = isA(hierarchy);
70
+
71
+ return {
72
+ isAListable: (context, type) => {
73
+ if (context.marker == 'list' || context.listable) {
74
+ return context.value.every( (element) => isAI(element.marker, type) )
75
+ } else {
76
+ return isAI(context.marker, type)
77
+ }
78
+ },
79
+ asList,
80
+ toArray: propertyToArray,
81
+ listable: listable(hierarchy),
82
+ isA: isAI,
83
+ toContext: (v) => {
84
+ if (Array.isArray(v)) {
85
+ return { marker: 'list', level: 1, value: v }
86
+ }
87
+ if (v.marker == 'list') {
88
+ return v
89
+ }
80
90
  return v
81
- }
82
- return v
83
- },
84
- }))
91
+ },
92
+ }
93
+ })
85
94
  }
86
95
 
87
96
  knowledgeModule( {
@@ -20,6 +20,7 @@ let config = {
20
20
  "([more] (countable/*))",
21
21
  "([less] (countable/*))",
22
22
  "([all])",
23
+ "([every])",
23
24
  // everything
24
25
  ],
25
26
  bridges: [
@@ -56,7 +57,7 @@ let config = {
56
57
  },
57
58
  {
58
59
  id: "quantifier",
59
- children: ['number', 'all'],
60
+ children: ['number', 'all', 'every'],
60
61
  },
61
62
  {
62
63
  id: "countable",
@@ -65,7 +66,12 @@ let config = {
65
66
  {
66
67
  id: "all",
67
68
  generatorp: ({context}) => 'all',
68
- bridge: "{ ...next(operator), number: 'many' }"
69
+ bridge: "{ ...next(operator), number: 'many', quantity: 'all' }"
70
+ },
71
+ {
72
+ id: "every",
73
+ generatorp: ({context}) => 'every',
74
+ bridge: "{ ...next(operator), number: 'one', quantity: 'every' }"
69
75
  },
70
76
  ],
71
77