tpmkms_4wp 9.3.0-beta.52 → 9.3.0-beta.54
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.
- package/common/animals.js +1 -4
- package/common/animals.test.json +1607 -1
- package/common/articles.js +1 -5
- package/common/asking.js +3 -3
- package/common/avatar.js +1 -3
- package/common/characters.js +1 -3
- package/common/colors.instance.json +0 -28
- package/common/colors.js +1 -3
- package/common/comparable.js +1 -3
- package/common/concept.js +1 -4
- package/common/conjunction.js +2 -6
- package/common/countable.js +1 -15
- package/common/crew.js +1 -3
- package/common/currency.js +1 -4
- package/common/dateTimeSelectors.js +1 -18
- package/common/dates.instance.json +0 -84
- package/common/dates.js +1 -17
- package/common/dialogues.js +3 -3
- package/common/dimension.js +2 -4
- package/common/edible.instance.json +0 -56
- package/common/edible.js +1 -3
- package/common/emotions.js +1 -3
- package/common/errors.js +1 -0
- package/common/evaluate.js +1 -3
- package/common/events.js +1 -4
- package/common/fastfood.instance.json +691 -247
- package/common/fastfood.js +2 -6
- package/common/formulas.js +1 -1
- package/common/gdefaults.js +1 -4
- package/common/help.js +1 -3
- package/common/helpers.js +16 -73
- package/common/hierarchy.js +1 -4
- package/common/javascript.js +1 -4
- package/common/kirk.js +1 -4
- package/common/length.js +1 -4
- package/common/listener.js +1 -1
- package/common/math.js +1 -4
- package/common/menus.js +1 -1
- package/common/meta.js +1 -4
- package/common/nameable.js +1 -1
- package/common/negation.js +1 -3
- package/common/numbers.js +1 -4
- package/common/ordering.js +1 -4
- package/common/ordinals.js +1 -4
- package/common/people.instance.json +0 -36
- package/common/people.js +1 -4
- package/common/percentages.js +1 -4
- package/common/percentages.test.json +57 -11
- package/common/pipboy.instance.json +0 -56
- package/common/pipboy.js +1 -1
- package/common/pokemon.js +1 -4
- package/common/pos.js +1 -3
- package/common/pressure.js +1 -3
- package/common/properties.js +1 -11
- package/common/punctuation.js +1 -3
- package/common/reminders.instance.json +4 -0
- package/common/reminders.js +1 -1
- package/common/reports.instance.json +1 -1
- package/common/reports.js +1 -3
- package/common/scorekeeper.js +1 -3
- package/common/sdefaults.js +1 -3
- package/common/self.js +1 -3
- package/common/sizeable.js +1 -3
- package/common/spock.js +1 -3
- package/common/stgame.js +1 -3
- package/common/stm.js +1 -1
- package/common/tell.js +1 -3
- package/common/temperature.js +1 -3
- package/common/time.js +1 -9
- package/common/time.test.json +73 -119
- package/common/tokenize.js +1 -3
- package/common/ui.js +1 -1
- package/common/weight.js +1 -3
- package/common/wp.instance.json +73 -41
- package/common/wp.js +1 -3
- package/common/yesno.js +1 -3
- package/package.json +2 -2
package/common/fastfood.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
const { knowledgeModule, ensureTestFile, where } = require('./runtime').theprogrammablemind
|
2
|
-
const { defaultContextCheck, propertyToArray } = require('./helpers')
|
2
|
+
const { defaultObjectCheck, defaultContextCheck, propertyToArray } = require('./helpers')
|
3
3
|
const edible = require('./edible')
|
4
4
|
const events = require('./events')
|
5
5
|
const sizeable = require('./sizeable')
|
@@ -995,11 +995,7 @@ knowledgeModule( {
|
|
995
995
|
{ property: 'quantity', filter: ['marker', 'value', 'text' ] },
|
996
996
|
{ property: 'pieces', filter: ['marker', 'value', 'text' ] },
|
997
997
|
],
|
998
|
-
|
999
|
-
...defaultContextCheck(),
|
1000
|
-
// TODO some kind of conditional selector { match: (value) => value.marker == 'count', filter: ['marker', 'value', 'text'] },
|
1001
|
-
{ property: 'comboNumber', filter: ['marker', 'value', 'text' ] },
|
1002
|
-
],
|
998
|
+
...defaultContextCheck(['comboNumber']),
|
1003
999
|
},
|
1004
1000
|
},
|
1005
1001
|
template: {
|
package/common/formulas.js
CHANGED
package/common/gdefaults.js
CHANGED
package/common/help.js
CHANGED
package/common/helpers.js
CHANGED
@@ -151,82 +151,25 @@ const toEValue = (context) => {
|
|
151
151
|
return context;
|
152
152
|
}
|
153
153
|
|
154
|
-
const
|
155
|
-
return
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
}
|
163
|
-
throw new Error("Expected the <checks> argument to defaultContextCheck to be a list of <property> or { property: <property>, filter: <checks> }. Where <property> is a string.")
|
164
|
-
}
|
165
|
-
}
|
166
|
-
|
167
|
-
const defaultContextCheckProperties = ['marker', 'text', 'verbatim', 'isResponse', 'types', { property: 'response', filter: ['marker', 'text', 'verbatim'] }]
|
168
|
-
|
169
|
-
const expand_checks = (properties, variables = {}) => {
|
170
|
-
let expanded = []
|
171
|
-
if (properties == 'defaults') {
|
172
|
-
return defaultContextCheckProperties
|
173
|
-
}
|
174
|
-
if (properties.variable) {
|
175
|
-
return variables[properties.variable]
|
176
|
-
}
|
177
|
-
if (Array.isArray(properties)) {
|
178
|
-
for (const property of properties) {
|
179
|
-
defaultContextCheckValidify(properties)
|
180
|
-
if (typeof property == 'string') {
|
181
|
-
expanded.push({ property, filter: defaultContextCheckProperties })
|
182
|
-
} else if (property.property && property.filter) {
|
183
|
-
expanded.push({ property: property.property, filter: [defaultContextCheckProperties, ...expand_checks(property.filter, variables)] })
|
184
|
-
} else {
|
185
|
-
expanded = [...expanded, ...expand_checks(property, variables)]
|
186
|
-
}
|
187
|
-
}
|
188
|
-
return expanded
|
189
|
-
}
|
190
|
-
for (const key of Object.keys(properties)) {
|
191
|
-
if (key === '_') {
|
192
|
-
expanded = [...expanded, ...defaultContextCheckProperties]
|
193
|
-
} else {
|
194
|
-
expanded.push({ property: key, filter: [...expand_checks(properties[key], variables)] })
|
195
|
-
}
|
154
|
+
const defaultObjectCheck = (extra = []) => {
|
155
|
+
return {
|
156
|
+
objects: [
|
157
|
+
{
|
158
|
+
match: ({objects}) => true,
|
159
|
+
apply: () => extra
|
160
|
+
},
|
161
|
+
],
|
196
162
|
}
|
197
|
-
return expanded
|
198
|
-
|
199
163
|
}
|
200
164
|
|
201
|
-
const defaultContextCheck = (
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
return [
|
208
|
-
...defaultContextCheckProperties,
|
209
|
-
// ...properties.map((property) => { return { property, filter: defaultContextCheckProperties } }),
|
210
|
-
...expand_checks(properties, variables),
|
211
|
-
(object) => {
|
212
|
-
if (typeof object.value == 'object') {
|
213
|
-
return { property: 'value', filter: defaultContextCheckProperties }
|
214
|
-
} else {
|
215
|
-
return 'value'
|
216
|
-
}
|
217
|
-
},
|
218
|
-
(object) => {
|
219
|
-
if (!Array.isArray(object.modifiers)) {
|
220
|
-
return
|
221
|
-
}
|
222
|
-
if (typeof object.modifiers[0] == 'object') {
|
223
|
-
return { property: 'modifiers', filter: defaultContextCheckProperties }
|
224
|
-
} else {
|
225
|
-
return 'modifiers'
|
226
|
-
}
|
165
|
+
const defaultContextCheck = (extra = []) => {
|
166
|
+
return {
|
167
|
+
context: [
|
168
|
+
{
|
169
|
+
match: ({context}) => !Array.isArray(context),
|
170
|
+
apply: () => ['marker', 'text', 'verbatim', 'value', 'evalue', 'isResponse', { properties: 'modifiers' }, { properties: 'postModifiers' }, ...extra],
|
227
171
|
},
|
228
|
-
|
229
|
-
]
|
172
|
+
],
|
230
173
|
}
|
231
174
|
}
|
232
175
|
|
@@ -319,7 +262,7 @@ module.exports = {
|
|
319
262
|
pushL,
|
320
263
|
getValue,
|
321
264
|
defaultContextCheck,
|
322
|
-
|
265
|
+
defaultObjectCheck,
|
323
266
|
toEValue,
|
324
267
|
millisecondsUntilHourOfDay,
|
325
268
|
indent,
|
package/common/hierarchy.js
CHANGED
@@ -305,10 +305,7 @@ knowledgeModule( {
|
|
305
305
|
// TODO doesnt this need the KM
|
306
306
|
checks: {
|
307
307
|
objects: ['children', 'concept', 'parents', 'properties'],
|
308
|
-
|
309
|
-
context: defaultContextCheck(),
|
310
|
-
},
|
311
|
-
|
308
|
+
...defaultContextCheck(),
|
312
309
|
},
|
313
310
|
includes: {
|
314
311
|
words: true,
|
package/common/javascript.js
CHANGED
package/common/kirk.js
CHANGED
package/common/length.js
CHANGED
package/common/listener.js
CHANGED
package/common/math.js
CHANGED
package/common/menus.js
CHANGED
@@ -251,7 +251,7 @@ knowledgeModule({
|
|
251
251
|
fixtures,
|
252
252
|
checks: {
|
253
253
|
objects: ['move', 'select', 'unselect', 'cancel', 'stop', 'show', 'menuDefs', 'close'],
|
254
|
-
|
254
|
+
...defaultContextCheck(['operator', 'direction', 'moveable']),
|
255
255
|
},
|
256
256
|
},
|
257
257
|
template: {
|
package/common/meta.js
CHANGED
package/common/nameable.js
CHANGED
@@ -134,7 +134,7 @@ knowledgeModule( {
|
|
134
134
|
name: './nameable.test.json',
|
135
135
|
contents: nameable_tests,
|
136
136
|
checks: {
|
137
|
-
|
137
|
+
...defaultContextCheck(['pullFromContext']),
|
138
138
|
objects: ['mentioned', { km: 'stm' }],
|
139
139
|
},
|
140
140
|
include: {
|
package/common/negation.js
CHANGED
package/common/numbers.js
CHANGED
package/common/ordering.js
CHANGED
@@ -120,10 +120,7 @@ knowledgeModule( {
|
|
120
120
|
name: './ordering.test.json',
|
121
121
|
heck: ['children', 'concept', 'parents', 'properties'],
|
122
122
|
contents: ordering_tests,
|
123
|
-
checks:
|
124
|
-
context: defaultContextCheck(),
|
125
|
-
},
|
126
|
-
|
123
|
+
checks: defaultContextCheck(),
|
127
124
|
},
|
128
125
|
template: {
|
129
126
|
template,
|
package/common/ordinals.js
CHANGED
@@ -8430,24 +8430,6 @@
|
|
8430
8430
|
0
|
8431
8431
|
]
|
8432
8432
|
],
|
8433
|
-
[
|
8434
|
-
[
|
8435
|
-
"by",
|
8436
|
-
0
|
8437
|
-
],
|
8438
|
-
[
|
8439
|
-
"isEd",
|
8440
|
-
0
|
8441
|
-
],
|
8442
|
-
[
|
8443
|
-
"owned",
|
8444
|
-
0
|
8445
|
-
],
|
8446
|
-
[
|
8447
|
-
"unknown",
|
8448
|
-
0
|
8449
|
-
]
|
8450
|
-
],
|
8451
8433
|
[
|
8452
8434
|
[
|
8453
8435
|
"isEd",
|
@@ -8846,24 +8828,6 @@
|
|
8846
8828
|
0
|
8847
8829
|
]
|
8848
8830
|
],
|
8849
|
-
[
|
8850
|
-
[
|
8851
|
-
"by",
|
8852
|
-
0
|
8853
|
-
],
|
8854
|
-
[
|
8855
|
-
"isEd",
|
8856
|
-
0
|
8857
|
-
],
|
8858
|
-
[
|
8859
|
-
"owned",
|
8860
|
-
0
|
8861
|
-
],
|
8862
|
-
[
|
8863
|
-
"unknown",
|
8864
|
-
0
|
8865
|
-
]
|
8866
|
-
],
|
8867
8831
|
[
|
8868
8832
|
[
|
8869
8833
|
"first",
|
package/common/people.js
CHANGED
package/common/percentages.js
CHANGED
@@ -45,9 +45,6 @@ knowledgeModule( {
|
|
45
45
|
test: {
|
46
46
|
name: './percentages.test.json',
|
47
47
|
contents: percentages_tests,
|
48
|
-
checks:
|
49
|
-
context: [...defaultContextCheck(), { property: 'scale', filter: ['marker', 'word', 'value'] }],
|
50
|
-
},
|
51
|
-
|
48
|
+
checks: defaultContextCheck(['scale'])
|
52
49
|
},
|
53
50
|
})
|
@@ -16,6 +16,7 @@
|
|
16
16
|
},
|
17
17
|
"contexts": [
|
18
18
|
{
|
19
|
+
"context_id": 2,
|
19
20
|
"context_index": 1,
|
20
21
|
"dead": true,
|
21
22
|
"level": 1,
|
@@ -87,6 +88,8 @@
|
|
87
88
|
]
|
88
89
|
},
|
89
90
|
"objects": {
|
91
|
+
"associations": [
|
92
|
+
],
|
90
93
|
"nameToUUID": {
|
91
94
|
"gdefaults": "gdefaults2",
|
92
95
|
"numbers": "numbers2",
|
@@ -96,19 +99,25 @@
|
|
96
99
|
},
|
97
100
|
"namespaced": {
|
98
101
|
"gdefaults2": {
|
102
|
+
"km": "gdefaults2"
|
99
103
|
},
|
100
104
|
"numbers2": {
|
105
|
+
"km": "numbers2"
|
101
106
|
},
|
102
107
|
"percentages1": {
|
108
|
+
"km": "percentages1"
|
103
109
|
},
|
104
110
|
"sdefaults2": {
|
111
|
+
"km": "sdefaults2"
|
105
112
|
},
|
106
113
|
"tokenize2": {
|
114
|
+
"km": "tokenize2"
|
107
115
|
}
|
108
116
|
},
|
109
117
|
"processed": [
|
110
118
|
{
|
111
119
|
"context": {
|
120
|
+
"context_id": 2,
|
112
121
|
"context_index": 1,
|
113
122
|
"dead": true,
|
114
123
|
"level": 1,
|
@@ -141,9 +150,12 @@
|
|
141
150
|
"value": "percent",
|
142
151
|
"word": "percent"
|
143
152
|
},
|
144
|
-
"generatedParenthesized":
|
145
|
-
|
146
|
-
"
|
153
|
+
"generatedParenthesized": [
|
154
|
+
],
|
155
|
+
"paraphrases": [
|
156
|
+
],
|
157
|
+
"paraphrasesParenthesized": [
|
158
|
+
],
|
147
159
|
"responses": [
|
148
160
|
""
|
149
161
|
]
|
@@ -250,6 +262,7 @@
|
|
250
262
|
},
|
251
263
|
"contexts": [
|
252
264
|
{
|
265
|
+
"context_id": 2,
|
253
266
|
"context_index": 1,
|
254
267
|
"dead": true,
|
255
268
|
"level": 1,
|
@@ -321,6 +334,8 @@
|
|
321
334
|
]
|
322
335
|
},
|
323
336
|
"objects": {
|
337
|
+
"associations": [
|
338
|
+
],
|
324
339
|
"nameToUUID": {
|
325
340
|
"gdefaults": "gdefaults2",
|
326
341
|
"numbers": "numbers2",
|
@@ -330,19 +345,25 @@
|
|
330
345
|
},
|
331
346
|
"namespaced": {
|
332
347
|
"gdefaults2": {
|
348
|
+
"km": "gdefaults2"
|
333
349
|
},
|
334
350
|
"numbers2": {
|
351
|
+
"km": "numbers2"
|
335
352
|
},
|
336
353
|
"percentages1": {
|
354
|
+
"km": "percentages1"
|
337
355
|
},
|
338
356
|
"sdefaults2": {
|
357
|
+
"km": "sdefaults2"
|
339
358
|
},
|
340
359
|
"tokenize2": {
|
360
|
+
"km": "tokenize2"
|
341
361
|
}
|
342
362
|
},
|
343
363
|
"processed": [
|
344
364
|
{
|
345
365
|
"context": {
|
366
|
+
"context_id": 2,
|
346
367
|
"context_index": 1,
|
347
368
|
"dead": true,
|
348
369
|
"level": 1,
|
@@ -375,9 +396,12 @@
|
|
375
396
|
"value": "percent",
|
376
397
|
"word": "%"
|
377
398
|
},
|
378
|
-
"generatedParenthesized":
|
379
|
-
|
380
|
-
"
|
399
|
+
"generatedParenthesized": [
|
400
|
+
],
|
401
|
+
"paraphrases": [
|
402
|
+
],
|
403
|
+
"paraphrasesParenthesized": [
|
404
|
+
],
|
381
405
|
"responses": [
|
382
406
|
""
|
383
407
|
]
|
@@ -512,6 +536,7 @@
|
|
512
536
|
},
|
513
537
|
"contexts": [
|
514
538
|
{
|
539
|
+
"context_id": 2,
|
515
540
|
"context_index": 1,
|
516
541
|
"dead": true,
|
517
542
|
"default": true,
|
@@ -563,13 +588,16 @@
|
|
563
588
|
"percentages#call2"
|
564
589
|
],
|
565
590
|
"value": {
|
591
|
+
"context_id": 2,
|
566
592
|
"context_index": 1,
|
567
593
|
"dead": true,
|
568
594
|
"default": true,
|
569
595
|
"evalue": {
|
570
596
|
"edefault": true,
|
571
|
-
"evalue":
|
597
|
+
"evalue": 11,
|
572
598
|
"instance": true,
|
599
|
+
"isModule": true,
|
600
|
+
"isProcess": true,
|
573
601
|
"level": 0,
|
574
602
|
"marker": "integer",
|
575
603
|
"range": {
|
@@ -587,6 +615,8 @@
|
|
587
615
|
"word": null
|
588
616
|
},
|
589
617
|
"instance": true,
|
618
|
+
"isModule": true,
|
619
|
+
"isProcess": true,
|
590
620
|
"isReponse": true,
|
591
621
|
"isResponse": true,
|
592
622
|
"level": 1,
|
@@ -728,6 +758,8 @@
|
|
728
758
|
]
|
729
759
|
},
|
730
760
|
"objects": {
|
761
|
+
"associations": [
|
762
|
+
],
|
731
763
|
"nameToUUID": {
|
732
764
|
"gdefaults": "gdefaults2",
|
733
765
|
"numbers": "numbers2",
|
@@ -737,19 +769,25 @@
|
|
737
769
|
},
|
738
770
|
"namespaced": {
|
739
771
|
"gdefaults2": {
|
772
|
+
"km": "gdefaults2"
|
740
773
|
},
|
741
774
|
"numbers2": {
|
775
|
+
"km": "numbers2"
|
742
776
|
},
|
743
777
|
"percentages1": {
|
778
|
+
"km": "percentages1"
|
744
779
|
},
|
745
780
|
"sdefaults2": {
|
781
|
+
"km": "sdefaults2"
|
746
782
|
},
|
747
783
|
"tokenize2": {
|
784
|
+
"km": "tokenize2"
|
748
785
|
}
|
749
786
|
},
|
750
787
|
"processed": [
|
751
788
|
{
|
752
789
|
"context": {
|
790
|
+
"context_id": 2,
|
753
791
|
"context_index": 1,
|
754
792
|
"dead": true,
|
755
793
|
"default": true,
|
@@ -801,13 +839,16 @@
|
|
801
839
|
"percentages#call2"
|
802
840
|
],
|
803
841
|
"value": {
|
842
|
+
"context_id": 2,
|
804
843
|
"context_index": 1,
|
805
844
|
"dead": true,
|
806
845
|
"default": true,
|
807
846
|
"evalue": {
|
808
847
|
"edefault": true,
|
809
|
-
"evalue":
|
848
|
+
"evalue": 11,
|
810
849
|
"instance": true,
|
850
|
+
"isModule": true,
|
851
|
+
"isProcess": true,
|
811
852
|
"level": 0,
|
812
853
|
"marker": "integer",
|
813
854
|
"range": {
|
@@ -825,6 +866,8 @@
|
|
825
866
|
"word": null
|
826
867
|
},
|
827
868
|
"instance": true,
|
869
|
+
"isModule": true,
|
870
|
+
"isProcess": true,
|
828
871
|
"isReponse": true,
|
829
872
|
"isResponse": true,
|
830
873
|
"level": 1,
|
@@ -894,9 +937,12 @@
|
|
894
937
|
},
|
895
938
|
"word": "of"
|
896
939
|
},
|
897
|
-
"generatedParenthesized":
|
898
|
-
|
899
|
-
"
|
940
|
+
"generatedParenthesized": [
|
941
|
+
],
|
942
|
+
"paraphrases": [
|
943
|
+
],
|
944
|
+
"paraphrasesParenthesized": [
|
945
|
+
],
|
900
946
|
"responses": [
|
901
947
|
"11"
|
902
948
|
]
|