tpmkms_4wp 8.9.1 → 9.0.0-beta.0
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.instance.json +6716 -775
- package/common/articles.js +22 -9
- package/common/articles.test.json +640 -2
- package/common/asking.js +3 -3
- package/common/asking.test.json +1599 -140
- package/common/avatar.js +9 -1
- package/common/avatar.test.json +6008 -2749
- package/common/characters.js +1 -1
- package/common/characters.test.json +1371 -95
- package/common/colors.instance.json +22813 -1432
- package/common/colors.test.json +704 -136
- package/common/comparable.instance.json +1337 -159
- package/common/comparable.js +13 -13
- package/common/comparable.test.json +3239 -558
- package/common/concept.js +11 -3
- package/common/concept.test.json +2853 -694
- package/common/conjunction.js +13 -1
- package/common/conjunction.test.json +229 -1
- package/common/countable.js +3 -9
- package/common/countable.test.json +1310 -638
- package/common/crew.instance.json +19500 -2069
- package/common/crew.js +19 -0
- package/common/crew.test.json +10218 -2145
- package/common/currency.js +2 -3
- package/common/currency.test.json +948 -64
- package/common/dialogues.js +111 -33
- package/common/dialogues.test.json +6611 -1905
- package/common/dimension.instance.json +760 -84
- package/common/dimension.js +18 -4
- package/common/dimension.test.json +23680 -11550
- package/common/edible.instance.json +21870 -2699
- package/common/edible.js +13 -0
- package/common/edible.test.json +1580 -304
- package/common/emotions.instance.json +2278 -247
- package/common/emotions.js +10 -2
- package/common/emotions.test.json +1134 -107
- package/common/errors.js +1 -1
- package/common/errors.test.json +88 -0
- package/common/evaluate.test.json +100 -1
- package/common/events.js +1 -1
- package/common/events.test.json +2197 -242
- package/common/fastfood.instance.json +82907 -10367
- package/common/fastfood.js +99 -12
- package/common/fastfood.test.json +65486 -21430
- package/common/formulas.instance.json +325 -58
- package/common/formulas.js +1 -1
- package/common/formulas.test.json +13202 -6757
- package/common/gdefaults.js +35 -17
- package/common/help.js +4 -4
- package/common/help.test.json +292 -4
- package/common/helpers/concept.js +6 -5
- package/common/helpers/conjunction.js +1 -1
- package/common/helpers/formulas.js +4 -4
- package/common/helpers/frankenhash.js +4 -4
- package/common/helpers/meta.js +4 -4
- package/common/helpers/ordering.js +2 -2
- package/common/helpers/properties.js +18 -48
- package/common/helpers.js +17 -1
- package/common/hierarchy.js +12 -3
- package/common/hierarchy.test.json +53813 -17340
- package/common/javascript.js +1 -1
- package/common/javascript.test.json +214 -11
- package/common/kirk.instance.json +322 -7
- package/common/kirk.test.json +1123 -254
- package/common/length.instance.json +9890 -797
- package/common/length.test.json +12055 -8184
- package/common/listener.test.json +39 -1
- package/common/math.instance.json +294 -57
- package/common/math.js +1 -1
- package/common/math.test.json +38557 -17754
- package/common/meta.instance.json +1 -0
- package/common/meta.js +13 -13
- package/common/meta.test.json +2770 -275
- package/common/nameable.js +1 -1
- package/common/nameable.test.json +5150 -1475
- package/common/negation.js +1 -1
- package/common/negation.test.json +146 -8
- package/common/numbers.js +1 -1
- package/common/numbers.test.json +234 -0
- package/common/ordering.instance.json +3861 -508
- package/common/ordering.test.json +2680 -1283
- package/common/ordinals.js +15 -3
- package/common/ordinals.test.json +627 -3
- package/common/people.instance.json +4041 -652
- package/common/people.js +1 -15
- package/common/people.test.json +27157 -13664
- package/common/percentages.js +1 -2
- package/common/percentages.test.json +313 -0
- package/common/pipboy.instance.json +13835 -1684
- package/common/pipboy.js +31 -49
- package/common/pipboy.test.json +19335 -6019
- package/common/pokemon.instance.json +6163 -690
- package/common/pokemon.test.json +1826 -389
- package/common/pos.js +27 -11
- package/common/pressure.instance.json +2635 -291
- package/common/pressure.test.json +2997 -1629
- package/common/properties.instance.json +907 -84
- package/common/properties.js +19 -28
- package/common/properties.test.json +46801 -14612
- package/common/punctuation.js +1 -1
- package/common/punctuation.test.json +327 -0
- package/common/reports.instance.json +997 -118
- package/common/reports.js +16 -9
- package/common/reports.test.json +16653 -2453
- package/common/scorekeeper.instance.json +1 -0
- package/common/scorekeeper.js +22 -12
- package/common/scorekeeper.test.json +42546 -15408
- package/common/sdefaults.js +2 -2
- package/common/sizeable.js +2 -2
- package/common/sizeable.test.json +1170 -215
- package/common/spock.instance.json +322 -7
- package/common/spock.test.json +1123 -254
- package/common/stgame.js +0 -1
- package/common/stgame.test.json +1371 -91
- package/common/stm.js +6 -6
- package/common/stm.test.json +842 -9
- package/common/tell.js +1 -1
- package/common/tell.test.json +224 -1
- package/common/temperature.instance.json +5980 -285
- package/common/temperature.test.json +2610 -1272
- package/common/tester.js +1 -1
- package/common/testing.test.json +84 -1
- package/common/time.test.json +5345 -272
- package/common/tokenize.js +3 -2
- package/common/tokenize.test.json +39 -0
- package/common/ui.instance.json +144 -26
- package/common/ui.js +0 -16
- package/common/ui.test.json +4620 -140
- package/common/weight.instance.json +10025 -771
- package/common/weight.js +10 -0
- package/common/weight.test.json +18658 -12176
- package/common/wp.instance.json +27555 -2630
- package/common/wp.js +240 -41
- package/common/wp.test.json +147553 -2727
- package/common/yesno.js +1 -1
- package/common/yesno.test.json +168 -4
- package/package.json +11 -6
package/common/dialogues.js
CHANGED
@@ -36,16 +36,26 @@ const warningSameNotEvaluated = (log, one) => {
|
|
36
36
|
log(indent(message, 4))
|
37
37
|
}
|
38
38
|
|
39
|
+
const listorama = (type) => {
|
40
|
+
return [
|
41
|
+
{ context: [[type, 0], ['list', 0], [type, 0]], choose: 0 },
|
42
|
+
{ context: [[type, 1], ['list', 0], [type, 0]], choose: 0 },
|
43
|
+
{ context: [[type, 1], ['list', 0], [type, 1]], choose: 0 },
|
44
|
+
]
|
45
|
+
}
|
46
|
+
|
47
|
+
|
39
48
|
// TODO implement what / what did you say ...
|
40
|
-
|
49
|
+
const config = {
|
41
50
|
name: 'dialogues',
|
42
51
|
operators: [
|
52
|
+
"(<thatVerb|that> (verb/0))",
|
43
53
|
"([makeObject] (word))",
|
44
54
|
"([setIdSuffix] (word))",
|
45
55
|
"([resetIdSuffix])",
|
46
56
|
|
47
57
|
"(([queryable]) [is|] ([queryable|]))",
|
48
|
-
"([
|
58
|
+
"([isQuery|] ([queryable]) ([queryable]))",
|
49
59
|
// "(([queryable]) [is:isEdBridge|is,are] ([isEdAble|]))",
|
50
60
|
// who is the car owned by
|
51
61
|
"(([queryable]) [(<isEd|> ([isEdAble|]))])",
|
@@ -100,20 +110,78 @@ let config = {
|
|
100
110
|
positive: [
|
101
111
|
// [['is', 0], ['unknown', 1]],
|
102
112
|
// [['isEd', 0], ['means', 0]],
|
103
|
-
[['
|
104
|
-
|
105
|
-
|
106
|
-
[['
|
107
|
-
[[
|
113
|
+
// [['unknown', 0], ['list', 0], ['unknown', 0]],
|
114
|
+
{ context: [['unknown', 0], ['isEdAble', 0]], choose: 1 },
|
115
|
+
|
116
|
+
{ context: [['listable', 0], ['list', 0], ['listable', 0]], choose: 0 },
|
117
|
+
{ context: [['the', 0], ['listable', 0], ['list', 0], ['listable', 0]], choose: 1 },
|
118
|
+
{ context: [['the', 0], ['listable', 0], ['list', 0], ['the', 0], ['listable', 0]], choose: 1 },
|
119
|
+
|
120
|
+
{ context: [['queryable', 0], ['is', 0], ['article', 0], ['theAble', 0]], choose: 1 },
|
121
|
+
{ context: [['queryable', 1], ['is', 0], ['article', 0], ['theAble', 0]], choose: 1 },
|
122
|
+
{ context: [['queryable', 1], ['is', 0], ['article', 0], ['theAble', 1]], choose: 1 },
|
123
|
+
|
124
|
+
{ context: [['isQuery', 0], ['a', 0], ['unknown', 0], ['a', 0], ['unknown', 0]], choose: 0 },
|
125
|
+
|
126
|
+
{ context: [['isQuery', 0], ['unknown', 0], ['unknown', 0]], choose: 0 },
|
127
|
+
|
128
|
+
{ context: [['isQuery', 0], ['unknown', 0], ['article', 0], ['unknown', 0]], choose: 0 },
|
129
|
+
|
130
|
+
{ context: [['isQuery', 0], ['queryable', 0], ['article', 0], ['queryable', 0]], choose: 0 },
|
131
|
+
{ context: [['isQuery', 0], ['queryable', 1], ['article', 0], ['queryable', 0]], choose: 0 },
|
132
|
+
{ context: [['isQuery', 0], ['queryable', 1], ['article', 0], ['queryable', 1]], choose: 0 },
|
133
|
+
|
134
|
+
{ context: [['unknown', 0], ['is', 0], ['unknown', 0]], choose: 1 },
|
135
|
+
{ context: [["unknown",0],["is",0],["article",0],["queryable",0]], choose: 1 },
|
136
|
+
{ context: [["unknown",0],["is",0],["article",0],["queryable",1]], choose: 1 },
|
137
|
+
|
138
|
+
{ context: [["a",0],["unknown",0],["is",0],["a",0],["unknown",0]], choose: 2 },
|
139
|
+
|
140
|
+
{ context: [['article', 0], ['unknown', 0], ['is', 0], ['article', 0], ['unknown', 0]], choose: 2 },
|
141
|
+
{ context: [['queryable', 0], ['is', 0], ['article', 0], ['unknown', 1]], choose: 1 },
|
142
|
+
{ context: [['queryable', 1], ['is', 0], ['article', 0], ['unknown', 1]], choose: 1 },
|
143
|
+
|
144
|
+
{ context: [["article",0],["unknown",0],["isEdAble",0],["by",0],["unknown",0]], choose: 1 },
|
145
|
+
|
146
|
+
{ context: [["queryable",0],["is",0],["isEder",0],["isEdAble",0],["by",0]], choose: 1 },
|
147
|
+
{ context: [["queryable",1],["is",0],["isEder",0],["isEdAble",0],["by",0]], choose: 1 },
|
148
|
+
{ context: [["queryable",1],["is",0],["isEder",1],["isEdAble",0],["by",0]], choose: 1 },
|
149
|
+
{ context: [["queryable",0],["is",0],["unknown",0],["isEdAble",0],["by",0]], choose: 1 },
|
150
|
+
{ context: [["queryable",1],["is",0],["unknown",0],["isEdAble",0],["by",0]], choose: 1 },
|
151
|
+
|
152
|
+
{ context: [["unknown",0],["isEd",0],["isEdAble",0],["by",0],["unknown",0]], choose: 1 },
|
153
|
+
{ context: [["unknown",0],["isEd",0],["isEdAble",0],["by",1]], choose: 1 },
|
154
|
+
{ context: [["unknown",0],["isEd",0],["isEdAble",0]], choose: 1 },
|
155
|
+
|
156
|
+
{ context: [["isEdee",0],["isEd",0],["isEdAble",0],["by",0],["isEder",0]], choose: 1 },
|
157
|
+
{ context: [["isEdee",1],["isEd",0],["isEdAble",0],["by",0],["isEder",0]], choose: 1 },
|
158
|
+
{ context: [["isEdee",1],["isEd",0],["isEdAble",0],["by",0],["isEder",1]], choose: 1 },
|
159
|
+
{ context: [["isEdee",0],["isEd",0],["isEdAble",0],["by",1]], choose: 1 },
|
160
|
+
{ context: [["isEdee",1],["isEd",0],["isEdAble",0],["by",1]], choose: 1 },
|
161
|
+
|
108
162
|
|
163
|
+
...listorama('unknown'),
|
164
|
+
...listorama('queryable'),
|
165
|
+
// ...listorama('listable'),
|
109
166
|
]
|
110
167
|
},
|
111
168
|
bridges: [
|
169
|
+
{
|
170
|
+
id: 'thatVerb',
|
171
|
+
before: ['verb'],
|
172
|
+
// bridge: "{ ...after[0], verb: after[0], that: operator, generate: ['that', 'verb'], localPriorities: { before: [\"verb\"] }, bridge_override: { operator: after[0].marker, bridge: '{ ...bridge.subject, postModifiers: [\"conditions\"], generate: append(before[0].generate, concatm(\"thatClause.\", operator.generate)), thatClause: bridge, conditions: append(after[0].conditions, [bridge]) }' } }",
|
173
|
+
// bridge: "{ ...after[0], verb: after[0], that: operator, generate: ['that', 'verb'], localPriorities: { before: [\"verb\"] }, bridge_override: { operator: after[0].marker, bridge: '{ ...bridge.subject, postModifiers: [\"conditions\"], generate: concatm(\"thatClause.\", bridge.generate), thatClause: bridge, conditions: append(bridge.subject.conditions, [bridge]) }' } }",
|
174
|
+
bridge: "{ ...after[0], verb: after[0], that: operator, generate: ['that', 'verb'], localPriorities: { actLike: [\"subordinatedVerb\", 0] }, bridge_override: { operator: after[0].marker, bridge: '{ ...bridge.subject, postModifiers: [\"conditions\"], modifiers: [], generate: concatm(\"thatClause.\", bridge.generate), thatClause: bridge, conditions: append(bridge.subject.conditions, [bridge]) }' } }",
|
175
|
+
},
|
176
|
+
|
112
177
|
{
|
113
178
|
id: 'queryable',
|
114
|
-
children: [
|
115
|
-
|
116
|
-
|
179
|
+
children: [ 'negatable' ],
|
180
|
+
},
|
181
|
+
{
|
182
|
+
id: 'queryable',
|
183
|
+
level: 1,
|
184
|
+
isA: ['listable'],
|
117
185
|
},
|
118
186
|
{
|
119
187
|
id: 'makeObject',
|
@@ -133,7 +201,6 @@ let config = {
|
|
133
201
|
},
|
134
202
|
{
|
135
203
|
id: 'resetIdSuffix',
|
136
|
-
bridge: "{ ...next(operator) }",
|
137
204
|
semantic: ({context, api}) => {
|
138
205
|
api.setIdSuffix('')
|
139
206
|
}
|
@@ -147,10 +214,9 @@ let config = {
|
|
147
214
|
optional: { 1: "{ marker: 'unknown', implicit: true, concept: true }", },
|
148
215
|
},
|
149
216
|
|
150
|
-
{ id: "debug23"
|
151
|
-
// { id: "what", level: 0, bridge: "{ ...next(operator), ...after[0], query: ['what'], determined: true }" },
|
217
|
+
{ id: "debug23" },
|
152
218
|
{ id: "what", level: 0, optional: "{ ...next(operator), query: ['what'], determined: true }", bridge: "{ ...after, query: ['what'], modifiers: ['what'], what: operator }" },
|
153
|
-
{ id: "whatAble"
|
219
|
+
{ id: "whatAble" },
|
154
220
|
|
155
221
|
// context.instance == variables.instance (unification)
|
156
222
|
{
|
@@ -163,12 +229,12 @@ let config = {
|
|
163
229
|
return `to ${await gp(context.toObject)}`
|
164
230
|
},
|
165
231
|
},
|
166
|
-
{ id: "toAble"
|
232
|
+
{ id: "toAble" },
|
167
233
|
|
168
234
|
{ id: "be", level: 0, bridge: "{ ...next(operator), type: after[0] }" },
|
169
|
-
{ id: "briefOrWordy"
|
235
|
+
{ id: "briefOrWordy" },
|
170
236
|
|
171
|
-
{ id: "yesno"
|
237
|
+
{ id: "yesno" },
|
172
238
|
{ id: "canBeQuestion", level: 0, bridge: "{ ...next(operator) }" },
|
173
239
|
{ id: "canBeQuestion", level: 1, bridge: "{ ...next(operator) }" },
|
174
240
|
{ id: "questionMark", level: 0, bridge: "{ ...before[0], query: [before.marker] }" },
|
@@ -181,14 +247,17 @@ let config = {
|
|
181
247
|
// { id: "isEd", level: 0, bridge: "{ ...context }" },
|
182
248
|
{ id: "isEdAble", level: 0, bridge: "{ ...next(operator) }" },
|
183
249
|
{ id: "isEdAble", level: 1, bridge: "{ ...next(operator) }" },
|
184
|
-
{ id: "isEdee"
|
185
|
-
{ id: "isEder"
|
250
|
+
{ id: "isEdee" },
|
251
|
+
{ id: "isEder" },
|
186
252
|
{ id: "is", level: 0,
|
187
|
-
|
188
|
-
|
189
|
-
queryBridge: "{ ...next(operator), one: after[0], two: after[1], query: true }" ,
|
253
|
+
bridge: "{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }",
|
254
|
+
isA: ['verb'],
|
190
255
|
},
|
191
256
|
{ id: "is", level: 1, bridge: "{ ...next(operator) }" },
|
257
|
+
{ id: "isQuery", level: 0,
|
258
|
+
bridge: "{ ...operator, marker: operator('is', 1), one: after[0], two: after[1], query: true, generate: [operator, 'one', 'two'] }" ,
|
259
|
+
isA: ['verb'],
|
260
|
+
},
|
192
261
|
|
193
262
|
{ id: "canBeDoQuestion", level: 0, bridge: "{ ...next(operator) }" },
|
194
263
|
{ id: "canBeDoQuestion", level: 1, bridge: "{ ...next(operator) }" },
|
@@ -276,9 +345,7 @@ let config = {
|
|
276
345
|
},
|
277
346
|
{
|
278
347
|
id: "reason",
|
279
|
-
level: 0,
|
280
348
|
isA: ['theAble', 'queryable'],
|
281
|
-
bridge: "{ ...next(operator) }"
|
282
349
|
},
|
283
350
|
/*
|
284
351
|
{
|
@@ -312,20 +379,29 @@ let config = {
|
|
312
379
|
"wordy": [{"id": "briefOrWordy", "initial": "{ value: 'wordy' }" }],
|
313
380
|
"does": [{"id": "does", "initial": "{ number: 'one' }" }],
|
314
381
|
"do": [{"id": "does", "initial": "{ number: 'many' }" }],
|
315
|
-
"is": [
|
316
|
-
|
382
|
+
"is": [
|
383
|
+
{"id": "is", "initial": "{ number: 'one' }" },
|
384
|
+
{"id": "isQuery", "initial": "{ number: 'one' }" },
|
385
|
+
{"id": "isEd", "initial": "{ number: 'one' }" }
|
386
|
+
],
|
387
|
+
"are": [
|
388
|
+
{"id": "is", "initial": "{ number: 'many' }" },
|
389
|
+
{"id": "isQuery", "initial": "{ number: 'many' }" },
|
390
|
+
{"id": "isEd", "initial": "{ number: 'many' }" }
|
391
|
+
],
|
317
392
|
}
|
318
393
|
},
|
319
394
|
|
320
395
|
floaters: ['query'],
|
321
396
|
priorities: [
|
397
|
+
{ "context": [['is', 0], ['means', 0], ], "choose": [0] },
|
322
398
|
{ "context": [['is', 0], ['means', 0], ], "choose": [0] },
|
323
399
|
{ "context": [["what",0], ["does",0],], "choose": [0] },
|
324
400
|
{ "context": [["is",0], ["is",1],], "choose": [0] },
|
325
401
|
{ "context": [["isEdAble",0], ["isEd",0],], "choose": [0] },
|
326
402
|
{ "context": [['a', 0], ['is', 0], ['does', 0], ], "choose": [0] },
|
327
403
|
{ "context": [['isEd', 0], ['means', 0], ], "choose": [0] },
|
328
|
-
{ "context": [['
|
404
|
+
{ "context": [['article', 0], ['isEdAble', 0], ], "choose": [0] },
|
329
405
|
{ "context": [['isEdAble', 0], ['is', 0], ], "choose": [0] },
|
330
406
|
{ "context": [['isEdAble', 0], ['is', 1], ], "choose": [0] },
|
331
407
|
],
|
@@ -335,8 +411,8 @@ let config = {
|
|
335
411
|
['this', 'pronoun'],
|
336
412
|
['questionMark', 'punctuation'],
|
337
413
|
// ['questionMark', 'isEd'],
|
338
|
-
['a', '
|
339
|
-
['the', '
|
414
|
+
['a', 'article'],
|
415
|
+
['the', 'article'],
|
340
416
|
['unknown', 'theAble'],
|
341
417
|
['theAble', 'queryable'],
|
342
418
|
['unknown', 'queryable'],
|
@@ -347,6 +423,8 @@ let config = {
|
|
347
423
|
['is', 'canBeQuestion'],
|
348
424
|
['it', 'toAble'],
|
349
425
|
['this', 'queryable'],
|
426
|
+
|
427
|
+
['listable', 'theAble'],
|
350
428
|
],
|
351
429
|
debug: false,
|
352
430
|
version: '3',
|
@@ -554,8 +632,8 @@ let config = {
|
|
554
632
|
todo: 'debug23',
|
555
633
|
match: ({context}) => context.marker == 'debug23',
|
556
634
|
apply: ({context, hierarchy}) => {
|
557
|
-
debugger
|
558
|
-
debugger
|
635
|
+
debugger // eslint-disable-line no-debugger
|
636
|
+
debugger // eslint-disable-line no-debugger
|
559
637
|
},
|
560
638
|
},
|
561
639
|
{
|
@@ -649,7 +727,7 @@ let config = {
|
|
649
727
|
// km('dialogues').api.mentioned(concept)
|
650
728
|
// TODO wtf is the next line?
|
651
729
|
value = JSON.parse(JSON.stringify(value))
|
652
|
-
|
730
|
+
const instance = await e(value)
|
653
731
|
if (false && instance.evalue) {
|
654
732
|
km('stm').api.mentioned({ context: value })
|
655
733
|
}
|
@@ -784,7 +862,7 @@ const initializer = ({objects, config, isModule}) => {
|
|
784
862
|
return api('dialogues').toScopedId(context)
|
785
863
|
},
|
786
864
|
addWords: (id, word, additional) => {
|
787
|
-
for (
|
865
|
+
for (const props of words(word, { ...additional })) {
|
788
866
|
config.addWord(props.word, { id, initial: JSON.stringify(props) })
|
789
867
|
}
|
790
868
|
},
|