tpmkms_4wp 9.5.1-beta.3 → 9.5.1-beta.31

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 (114) hide show
  1. package/common/animals.instance.json +21 -61
  2. package/common/asking.js +112 -102
  3. package/common/avatar.test.json +1001 -860
  4. package/common/can.instance.json +2174 -0
  5. package/common/can.js +254 -0
  6. package/common/can.test.json +51307 -0
  7. package/common/characters.js +3 -3
  8. package/common/colors.instance.json +10 -10
  9. package/common/comparable.instance.json +2 -2
  10. package/common/concept.js +19 -22
  11. package/common/concept.test.json +54 -40
  12. package/common/conjunction.js +13 -5
  13. package/common/conjunction.test.json +32 -42
  14. package/common/crew.instance.json +164 -150
  15. package/common/crew.js +1 -1
  16. package/common/currency.js +1 -1
  17. package/common/dateTimeSelectors.instance.json +2 -2
  18. package/common/dateTimeSelectors.js +3 -3
  19. package/common/dateTimeSelectors.test.json +76935 -35739
  20. package/common/dates.instance.json +3 -3
  21. package/common/dates.test.json +284 -287
  22. package/common/dialogues.js +41 -119
  23. package/common/dialogues.test.json +1171 -996
  24. package/common/dimension.instance.json +21374 -562
  25. package/common/dimension.js +145 -51
  26. package/common/dimension.test.json +8753 -3495
  27. package/common/drone.instance.json +23710 -0
  28. package/common/drone.js +429 -0
  29. package/common/drone.test.json +61113 -0
  30. package/common/edible.instance.json +23 -95
  31. package/common/emotions.instance.json +53 -80
  32. package/common/emotions.js +1 -1
  33. package/common/english_helpers.js +277 -67
  34. package/common/fastfood.instance.json +180 -372
  35. package/common/fastfood.js +4 -4
  36. package/common/fastfood.test.json +6970 -6829
  37. package/common/formulas.instance.json +1 -1
  38. package/common/gdefaults.js +94 -17
  39. package/common/help.js +11 -11
  40. package/common/help.test.json +65 -11
  41. package/common/helpers/concept.js +1 -1
  42. package/common/helpers/conjunction.js +54 -44
  43. package/common/helpers/dateTimeSelectors.js +2 -2
  44. package/common/helpers/dialogues.js +7 -2
  45. package/common/helpers/formulas.js +13 -11
  46. package/common/helpers/menus.js +12 -12
  47. package/common/helpers/meta.js +8 -8
  48. package/common/helpers/properties.js +104 -23
  49. package/common/helpers.js +114 -48
  50. package/common/hierarchy.js +6 -4
  51. package/common/kirk.instance.json +1 -1
  52. package/common/kirk.test.json +600 -424
  53. package/common/latin.instance.json +10 -10
  54. package/common/latin.js +5 -5
  55. package/common/length.instance.json +27612 -2890
  56. package/common/length.js +6 -1
  57. package/common/length.test.json +45315 -3925
  58. package/common/math.instance.json +20 -20
  59. package/common/math.js +45 -44
  60. package/common/menus.instance.json +6 -9
  61. package/common/menus.js +2 -9
  62. package/common/meta.js +50 -33
  63. package/common/nameable.js +13 -6
  64. package/common/nameable.test.json +436 -0
  65. package/common/numbers.js +1 -1
  66. package/common/ordering.instance.json +20 -30
  67. package/common/ordering.js +1 -1
  68. package/common/ordering.test.json +414 -426
  69. package/common/people.instance.json +82 -348
  70. package/common/people.js +1 -1
  71. package/common/people.test.json +952 -681
  72. package/common/pipboy.instance.json +16 -16
  73. package/common/pokemon.instance.json +8 -8
  74. package/common/pokemon.js +1 -1
  75. package/common/pressure.instance.json +3579 -1610
  76. package/common/pressure.test.json +433 -477
  77. package/common/properties.instance.json +6 -17
  78. package/common/properties.js +19 -6
  79. package/common/properties.test.json +8746 -6638
  80. package/common/rates.instance.json +59 -0
  81. package/common/rates.js +97 -0
  82. package/common/rates.test.json +27702 -0
  83. package/common/reminders.js +1 -1
  84. package/common/reminders.test.json +64635 -25787
  85. package/common/reports.instance.json +3 -3
  86. package/common/reports.js +18 -16
  87. package/common/scorekeeper.js +4 -4
  88. package/common/sdefaults.js +22 -2
  89. package/common/spock.instance.json +1 -1
  90. package/common/spock.test.json +606 -430
  91. package/common/stgame.js +1 -1
  92. package/common/stm.js +15 -4
  93. package/common/tell.js +1 -1
  94. package/common/temperature.instance.json +3786 -1705
  95. package/common/temperature.test.json +433 -477
  96. package/common/tester.js +3 -3
  97. package/common/time.instance.json +24762 -0
  98. package/common/time.js +137 -141
  99. package/common/time.test.json +31876 -3757
  100. package/common/tokenize.js +1 -1
  101. package/common/ui.instance.json +2 -5
  102. package/common/ui.js +1 -8
  103. package/common/weight.instance.json +10359 -4077
  104. package/common/weight.test.json +2601 -2263
  105. package/common/words.instance.json +9 -0
  106. package/common/words.js +53 -0
  107. package/common/words.test.json +2 -0
  108. package/common/wp.instance.json +336 -8
  109. package/common/wp.js +8 -4
  110. package/common/wp.test.json +7385 -6906
  111. package/main.js +4 -2
  112. package/package.json +18 -5
  113. package/common/listener.js +0 -50
  114. package/common/listener.test.json +0 -142
@@ -16,9 +16,7 @@ const dialogues_tests = require('./dialogues.test.json')
16
16
  const { defaultObjectCheck, defaultContextCheck, indent, focus } = require('./helpers')
17
17
  const pluralize = require('pluralize')
18
18
 
19
- const api = new API()
20
-
21
- const warningIsANotImplemented = (log, context) => {
19
+ function warningIsANotImplemented(log, context) {
22
20
  const description = 'WARNING from Dialogues KM: For semantics in order to handle sentences of type "x is y?", set the response to what you like.'
23
21
  const match = `({context, hierarchy}) => hierarchy.isA(context.marker, 'is') && context.query && <other conditions as you like>`
24
22
  const apply = `({context}) => <do stuff...>; context.evalue = <value>`
@@ -27,7 +25,7 @@ const warningIsANotImplemented = (log, context) => {
27
25
  log(indent(message, 4))
28
26
  }
29
27
 
30
- const warningSameNotEvaluated = (log, one) => {
28
+ function warningSameNotEvaluated(log, one) {
31
29
  const description = 'WARNING from Dialogues KM: For the "X is Y" type phrase implement a same handler.'
32
30
  const match = `({context}) => context.marker == '${one.marker}' && context.same && <other conditions as you like>`
33
31
  const apply = '({context}) => <do stuff... context.same is the other value>; context.sameWasProcessed = true'
@@ -36,7 +34,7 @@ const warningSameNotEvaluated = (log, one) => {
36
34
  log(indent(message, 4))
37
35
  }
38
36
 
39
- const listorama = (type) => {
37
+ function listorama(type) {
40
38
  return [
41
39
  { context: [[type, 0], ['list', 0], [type, 0]], choose: 0 },
42
40
  { context: [[type, 1], ['list', 0], [type, 0]], choose: 0 },
@@ -56,38 +54,23 @@ const config = {
56
54
 
57
55
  "(([queryable]) [is|] ([queryable|]))",
58
56
  "([isQuery|] ([queryable]) ([queryable]))",
59
- // "(([queryable]) [is:isEdBridge|is,are] ([isEdAble|]))",
60
57
  // who is the car owned by
61
58
  "(([queryable]) [(<isEd|> ([isEdAble|]))])",
62
59
 
63
- /* TODO investigate this:
64
- {"pattern":"(([ownee])^ <owned|owned> ([by] ([owner])?))","uuid":"people1"}
65
- {"pattern":"(([isEdee])^ <isEdAble|> ([by] ([isEder])?))","uuid":"dialogues2"}
66
- */
67
60
  "(([isEdee])^ <isEdAble|> ([by] ([isEder])?))",
68
61
  "([isEdee|])",
69
62
  "([isEder|])",
70
63
 
71
- // "([nevermind])",
72
- // { pattern: "([nevermindTestSetup] (allowed))", scope: "testing" },
73
64
  "([why])",
74
65
  "([reason])",
75
- // "([thisitthat|])",
76
- // "([it])",
77
- // "([this])",
78
- // "([that])",
79
66
 
80
67
  "(<what> ([whatAble|]))",
81
68
  "([what:optional])",
82
- // "(<the|> ([theAble|]))",
83
- // "(<a|a,an> ([theAble|]))",
84
- // "([unknown])",
85
69
 
86
70
  "([be] ([briefOrWordy|]))",
87
71
 
88
72
  "([([canBeQuestion])])",
89
73
  "(([canBeQuestion/1,2]) <questionMark|>)",
90
- // "(([is/2]) <questionMark|>)",
91
74
 
92
75
  "(([what]) [(<does|> ([doesAble|]))])",
93
76
  "([canBeDoQuestion])",
@@ -101,46 +84,29 @@ const config = {
101
84
 
102
85
  "([to] ([toAble|]))",
103
86
  ],
104
- associations: {
105
- positive: [
106
- { context: [['unknown', 0], ['isEdAble', 0]], choose: 1 },
107
- { context: [['isQuery', 0], ['a', 0], ['unknown', 0], ['a', 0], ['unknown', 0]], choose: { index: 0, increment: true } },
108
-
109
- { context: [["unknown",0],["isEd",0],["isEdAble",0],["by",0],["unknown",0]], choose: { index: 0, increment: true } },
110
- { context: [["unknown",0],["isEd",0],["isEdAble",0],["by",1]], choose: { index: 0, increment: true } },
111
- { context: [["unknown",0],["isEd",0],["isEdAble",0]], choose: { index: 0, increment: true } },
112
-
113
-
114
- // ...listorama('unknown'),
115
- // ...listorama('queryable'),
116
- { context: [['unknown', 0], ['list', 0], ['unknown', 0]], choose: 0 },
117
- { context: [['unknown', 0], ['list', 0], ['unknown', 1]], choose: 0 },
118
- { context: [['unknown', 1], ['list', 0], ['unknown', 0]], choose: 0 },
119
- { context: [['unknown', 1], ['list', 0], ['unknown', 1]], choose: 0 },
120
-
121
- { context: [['queryable', 0], ['list', 0], ['unknown', 0]], choose: 1 },
122
- { context: [['queryable', 0], ['list', 0], ['unknown', 1]], choose: 1 },
123
- { context: [['queryable', 1], ['list', 0], ['unknown', 0]], choose: 1 },
124
- { context: [['queryable', 1], ['list', 0], ['unknown', 1]], choose: 1 },
125
-
126
- { context: [['unknown', 0], ['list', 0], ['queryable', 0]], choose: 2 },
127
- { context: [['unknown', 0], ['list', 0], ['queryable', 1]], choose: 2 },
128
- { context: [['unknown', 1], ['list', 0], ['queryable', 0]], choose: 2 },
129
- { context: [['unknown', 1], ['list', 0], ['queryable', 1]], choose: 2 },
130
-
131
- { context: [['queryable', 0], ['list', 0], ['queryable', 0]], choose: 0 },
132
- { context: [['queryable', 0], ['list', 0], ['queryable', 1]], choose: 0 },
133
- { context: [['queryable', 1], ['list', 0], ['queryable', 0]], choose: 0 },
134
- { context: [['queryable', 1], ['list', 0], ['queryable', 1]], choose: 0 },
135
- ]
136
- },
137
87
  bridges: [
138
88
  {
139
89
  id: 'thatVerb',
140
90
  before: ['verb'],
141
- // 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]) }' } }",
142
- // 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]) }' } }",
143
- 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]) }' } }",
91
+ bridge: `
92
+ {
93
+ ...after[0],
94
+ verb: after[0],
95
+ that: operator,
96
+ generate: ['that', 'verb'],
97
+ localPriorities: { actLike: ["subordinatedVerb", 0] },
98
+ bridge_override: {
99
+ operator: after[0].marker,
100
+ bridge: '{
101
+ ...bridge.subject,
102
+ postModifiers: ["conditions"],
103
+ modifiers: [],
104
+ generate: concatm("thatClause.", bridge.generate),
105
+ thatClause: bridge,
106
+ conditions: append(bridge.subject.conditions, [bridge])
107
+ }'
108
+ }
109
+ }`,
144
110
  },
145
111
 
146
112
  {
@@ -203,7 +169,16 @@ const config = {
203
169
  },
204
170
  { id: "toAble" },
205
171
 
206
- { id: "be", level: 0, bridge: "{ ...next(operator), type: after[0] }" },
172
+ {
173
+ id: "be",
174
+ level: 0,
175
+ bridge: `{
176
+ ...next(operator),
177
+ form: 'infinitive',
178
+ type: after[0]
179
+ }`
180
+ },
181
+
207
182
  { id: "briefOrWordy" },
208
183
 
209
184
  { id: "yesno" },
@@ -246,38 +221,6 @@ const config = {
246
221
  { id: "doesAble", level: 0, bridge: "{ ...next(operator) }" },
247
222
  { id: "doesAble", level: 1, bridge: "{ ...next(operator), before: before[0] }" },
248
223
  { id: "does", level: 0, bridge: "{ query: true, what: operator.marker, ...context, number: operator.number, object.number: operator.number }*" },
249
-
250
- /*
251
- {
252
- id: 'the',
253
- level: 0,
254
- bridge: '{ ...after[0], focusableForPhrase: true, pullFromContext: true, concept: true, wantsValue: true, determiner: "the", modifiers: append(["determiner"], after[0].modifiers)}'
255
- },
256
- {
257
- id: "a",
258
- level: 0,
259
- // bridge: "{ ...after[0], pullFromContext: false, instance: true, concept: true, number: 'one', wantsValue: true, determiner: operator, modifiers: append(['determiner'], after[0].modifiers) }"
260
- bridge: "{ ...after[0], pullFromContext: false, concept: true, number: 'one', wantsValue: true, determiner: operator, modifiers: append(['determiner'], after[0].modifiers) }"
261
- },
262
- */
263
- /*
264
- {
265
- id: "theAble",
266
- children: ['noun'],
267
- bridge: "{ ...next(operator) }"
268
- },
269
- */
270
-
271
- // TODO make this hierarchy thing work
272
- /*
273
- {
274
- id: "thisitthat",
275
- level: 0,
276
- isA: ['queryable'],
277
- before: ['verby'],
278
- bridge: "{ ...next(operator) }"
279
- },
280
- */
281
224
  {
282
225
  id: "why",
283
226
  level: 0,
@@ -287,31 +230,10 @@ const config = {
287
230
  id: "reason",
288
231
  isA: ['theAble', 'queryable'],
289
232
  },
290
- /*
291
- {
292
- id: "it",
293
- level: 0,
294
- isA: ['thisitthat'],
295
- bridge: "{ ...next(operator), pullFromContext: true, unknown: true, determined: true }"
296
- },
297
- {
298
- id: "this",
299
- level: 0,
300
- isA: ['thisitthat'],
301
- bridge: "{ ...next(operator), unknown: true, pullFromContext: true }"
302
- },
303
- {
304
- id: "that",
305
- level: 0,
306
- isA: ['thisitthat'],
307
- bridge: "{ ...next(operator), unknown: true, pullFromContext: true }"
308
- },
309
- */
310
233
  ],
311
234
  words: {
312
235
  "literals": {
313
236
  "?": [{"id": "questionMark", "initial": "{}" }],
314
- // "the": [{"id": "the", "initial": "{ modifiers: [] }" }],
315
237
  "who": [{"id": "what", "initial": "{ modifiers: [], query: true }" }],
316
238
  "yes": [{"id": "yesno", "initial": "{ value: true }" }],
317
239
  "no": [{"id": "yesno", "initial": "{ value: false }" }],
@@ -320,6 +242,7 @@ const config = {
320
242
  "does": [{"id": "does", "initial": "{ number: 'one' }" }],
321
243
  "do": [{"id": "does", "initial": "{ number: 'many' }" }],
322
244
  "is": [
245
+ {"id": "be", "initial": "{ form: 'infinitive' }" },
323
246
  {"id": "is", "initial": "{ number: 'one' }" },
324
247
  {"id": "isQuery", "initial": "{ number: 'one' }" },
325
248
  {"id": "isEd", "initial": "{ number: 'one' }" }
@@ -347,12 +270,9 @@ const config = {
347
270
  ['it', 'pronoun'],
348
271
  ['this', 'pronoun'],
349
272
  ['questionMark', 'punctuation'],
350
- // ['questionMark', 'isEd'],
351
273
  ['a', 'article'],
352
274
  ['the', 'article'],
353
- // ['unknown', 'theAble'],
354
275
  ['theAble', 'queryable'],
355
- // ['unknown', 'queryable'],
356
276
  ['it', 'queryable'],
357
277
  ['what', 'queryable'],
358
278
  ['whatAble', 'queryable'],
@@ -369,11 +289,13 @@ const config = {
369
289
  {
370
290
  where: where(),
371
291
  notes: "handle making responses brief",
372
- match: ({context, objects}) => (context.topLevel || context.isResponse) && objects.brief && !context.briefWasRun,
292
+ match: ({context, objects, callId}) => (context.topLevel || context.isResponse) && objects.brief && !context.briefWasRun,
373
293
  apply: async ({context, g}) => {
374
294
  const focussed = focus(context)
375
295
  context.briefWasRun = true
376
- return await g(focussed)
296
+ const result = await g(focussed)
297
+ context.briefWasRun = false
298
+ return result
377
299
  },
378
300
  priority: -2,
379
301
  },
@@ -393,7 +315,7 @@ const config = {
393
315
  where: where(),
394
316
  notes: "be brief or wordy",
395
317
  match: ({context}) => context.marker == 'be',
396
- apply: ({context}) => `be ${context.type.word}`,
318
+ apply: ({context}) => `be ${context.type?.word}`,
397
319
  },
398
320
  /*
399
321
  {
@@ -528,7 +450,7 @@ const config = {
528
450
  return `${await gp(context.one)} ${isMany(context.one) || isMany(context.two) || isMany(context) ? "are" : "is"} ${await g(context.two)}`
529
451
  }
530
452
 
531
- const hasFocus = (property) => {
453
+ function hasFocus(property) {
532
454
  if (context.focusableForPhrase) {
533
455
  return true
534
456
  }
@@ -554,7 +476,7 @@ const config = {
554
476
  } else {
555
477
  // TODO fix this using the assumed and that whole mess. change isResponse to useValue
556
478
  if (context.isResponse) {
557
- return `${await gp(context.one, { responding: true })} ${isMany(context.one) || isMany(context.two) || isMany(context) ? "are" : "is"} ${await g(context.two)}`
479
+ return `${await gp(context.one, { assumed: { responding: true } })} ${isMany(context.one) || isMany(context.two) || isMany(context) ? "are" : "is"} ${await g(context.two)}`
558
480
  } else {
559
481
  return `${await gp(context.one)} ${isMany(context.one) || isMany(context.two) || isMany(context) ? "are" : "is"} ${await gr(context.two)}`
560
482
  }
@@ -788,7 +710,7 @@ const config = {
788
710
  ],
789
711
  };
790
712
 
791
- const initializer = ({objects, config, isModule}) => {
713
+ function initializer({objects, config, isModule}) {
792
714
  /* TODO add this beck in. some stuff from config needs to be here
793
715
  config.addArgs((args) => ({
794
716
  e: (context) => config.api.getEvaluator(args.s, args.log, context),