tpmkms_4wp 8.9.1-beta.3 → 8.9.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 (137) hide show
  1. package/common/animals.instance.json +6736 -831
  2. package/common/articles.js +22 -9
  3. package/common/articles.test.json +640 -2
  4. package/common/asking.js +3 -3
  5. package/common/asking.test.json +1599 -140
  6. package/common/avatar.js +9 -1
  7. package/common/avatar.test.json +6008 -2749
  8. package/common/characters.js +1 -1
  9. package/common/characters.test.json +1371 -95
  10. package/common/colors.instance.json +22825 -1424
  11. package/common/colors.test.json +704 -136
  12. package/common/comparable.instance.json +1337 -159
  13. package/common/comparable.js +13 -13
  14. package/common/comparable.test.json +3239 -558
  15. package/common/concept.js +11 -3
  16. package/common/concept.test.json +2853 -694
  17. package/common/conjunction.js +13 -1
  18. package/common/conjunction.test.json +229 -1
  19. package/common/countable.js +3 -9
  20. package/common/countable.test.json +1310 -638
  21. package/common/crew.instance.json +19486 -2159
  22. package/common/crew.js +19 -0
  23. package/common/crew.test.json +10218 -2145
  24. package/common/currency.js +2 -3
  25. package/common/currency.test.json +948 -64
  26. package/common/dialogues.js +102 -35
  27. package/common/dialogues.test.json +6611 -1905
  28. package/common/dimension.instance.json +760 -120
  29. package/common/dimension.js +18 -4
  30. package/common/dimension.test.json +23680 -11550
  31. package/common/edible.instance.json +21905 -2694
  32. package/common/edible.js +13 -0
  33. package/common/edible.test.json +1580 -304
  34. package/common/emotions.instance.json +2224 -253
  35. package/common/emotions.js +10 -2
  36. package/common/emotions.test.json +1134 -107
  37. package/common/errors.js +1 -1
  38. package/common/errors.test.json +88 -0
  39. package/common/evaluate.test.json +100 -1
  40. package/common/events.js +1 -1
  41. package/common/events.test.json +2197 -242
  42. package/common/fastfood.instance.json +82039 -9948
  43. package/common/fastfood.js +99 -12
  44. package/common/fastfood.test.json +65486 -21430
  45. package/common/formulas.instance.json +325 -58
  46. package/common/formulas.js +1 -1
  47. package/common/formulas.test.json +13202 -6757
  48. package/common/gdefaults.js +18 -8
  49. package/common/help.js +4 -4
  50. package/common/help.test.json +292 -4
  51. package/common/helpers/concept.js +6 -5
  52. package/common/helpers/conjunction.js +1 -1
  53. package/common/helpers/formulas.js +4 -4
  54. package/common/helpers/frankenhash.js +4 -4
  55. package/common/helpers/meta.js +4 -4
  56. package/common/helpers/ordering.js +2 -2
  57. package/common/helpers/properties.js +18 -48
  58. package/common/helpers.js +1 -1
  59. package/common/hierarchy.js +12 -3
  60. package/common/hierarchy.test.json +53813 -17340
  61. package/common/javascript.js +1 -1
  62. package/common/javascript.test.json +214 -11
  63. package/common/kirk.instance.json +322 -7
  64. package/common/kirk.test.json +1123 -254
  65. package/common/length.instance.json +9890 -797
  66. package/common/length.test.json +12055 -8184
  67. package/common/listener.test.json +39 -1
  68. package/common/math.instance.json +294 -57
  69. package/common/math.js +1 -1
  70. package/common/math.test.json +38557 -17754
  71. package/common/meta.instance.json +1 -0
  72. package/common/meta.js +13 -13
  73. package/common/meta.test.json +2770 -275
  74. package/common/nameable.js +1 -1
  75. package/common/nameable.test.json +5150 -1475
  76. package/common/negation.js +1 -1
  77. package/common/negation.test.json +146 -8
  78. package/common/numbers.js +1 -1
  79. package/common/numbers.test.json +234 -0
  80. package/common/ordering.instance.json +3861 -508
  81. package/common/ordering.test.json +2680 -1283
  82. package/common/ordinals.js +15 -3
  83. package/common/ordinals.test.json +627 -3
  84. package/common/people.instance.json +4028 -675
  85. package/common/people.js +1 -15
  86. package/common/people.test.json +27157 -13664
  87. package/common/percentages.js +1 -2
  88. package/common/percentages.test.json +313 -0
  89. package/common/pipboy.instance.json +13636 -1481
  90. package/common/pipboy.js +28 -48
  91. package/common/pipboy.test.json +17367 -5640
  92. package/common/pokemon.instance.json +6163 -690
  93. package/common/pokemon.test.json +1826 -389
  94. package/common/pos.js +16 -6
  95. package/common/pressure.instance.json +2635 -291
  96. package/common/pressure.test.json +2997 -1629
  97. package/common/properties.instance.json +907 -128
  98. package/common/properties.js +19 -28
  99. package/common/properties.test.json +46801 -14612
  100. package/common/punctuation.js +1 -1
  101. package/common/punctuation.test.json +327 -0
  102. package/common/reports.instance.json +997 -118
  103. package/common/reports.js +16 -9
  104. package/common/reports.test.json +16653 -2453
  105. package/common/scorekeeper.instance.json +1 -0
  106. package/common/scorekeeper.js +22 -12
  107. package/common/scorekeeper.test.json +42546 -15408
  108. package/common/sdefaults.js +2 -2
  109. package/common/sizeable.js +2 -2
  110. package/common/sizeable.test.json +1170 -215
  111. package/common/spock.instance.json +322 -7
  112. package/common/spock.test.json +1123 -254
  113. package/common/stgame.js +0 -1
  114. package/common/stgame.test.json +1371 -91
  115. package/common/stm.js +6 -6
  116. package/common/stm.test.json +842 -9
  117. package/common/tell.js +1 -1
  118. package/common/tell.test.json +224 -1
  119. package/common/temperature.instance.json +5980 -285
  120. package/common/temperature.test.json +2610 -1272
  121. package/common/tester.js +1 -1
  122. package/common/testing.test.json +84 -1
  123. package/common/time.test.json +5345 -272
  124. package/common/tokenize.js +3 -2
  125. package/common/tokenize.test.json +39 -0
  126. package/common/ui.instance.json +144 -26
  127. package/common/ui.js +0 -16
  128. package/common/ui.test.json +4620 -140
  129. package/common/weight.instance.json +9990 -788
  130. package/common/weight.js +10 -0
  131. package/common/weight.test.json +18658 -12176
  132. package/common/wp.instance.json +20102 -1965
  133. package/common/wp.js +197 -44
  134. package/common/wp.test.json +121113 -17800
  135. package/common/yesno.js +1 -1
  136. package/common/yesno.test.json +168 -4
  137. package/package.json +11 -6
@@ -36,8 +36,17 @@ 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
- let config = {
49
+ const config = {
41
50
  name: 'dialogues',
42
51
  operators: [
43
52
  "(<thatVerb|that> (verb/0))",
@@ -46,7 +55,7 @@ let config = {
46
55
  "([resetIdSuffix])",
47
56
 
48
57
  "(([queryable]) [is|] ([queryable|]))",
49
- "([is:queryBridge|] ([queryable]) ([queryable]))",
58
+ "([isQuery|] ([queryable]) ([queryable]))",
50
59
  // "(([queryable]) [is:isEdBridge|is,are] ([isEdAble|]))",
51
60
  // who is the car owned by
52
61
  "(([queryable]) [(<isEd|> ([isEdAble|]))])",
@@ -101,13 +110,58 @@ let config = {
101
110
  positive: [
102
111
  // [['is', 0], ['unknown', 1]],
103
112
  // [['isEd', 0], ['means', 0]],
104
- [['thatVerb', 0], ['verb', 0]],
105
- [['isEdee', 0], ['isEd', 0], ['isEder', 0], ['by', 0]],
106
- [['isEdee', 0], ['isEd', 0], ['isEdAble', 0]],
107
- [['unknown', 1], ['isEd', 0], ['isEdAble', 0]],
108
- [['unknown', 0], ['isEd', 0], ['isEdAble', 0]],
109
- [["isEd",0],["unknown",1],["isEdAble",0]],
113
+ // [['unknown', 0], ['list', 0], ['unknown', 0]],
114
+ { context: [['unknown', 0], ['isEdAble', 0]], choose: 1 },
115
+
116
+ // { context: [['the', 0], ['listable', 0], ['list', 0], ['listable', 0]], choose: 1 },
117
+ // { context: [['the', 0], ['listable', 0], ['list', 0], ['the', 0], ['listable', 0]], choose: 1 },
118
+
119
+ { context: [['queryable', 0], ['is', 0], ['article', 0], ['theAble', 0]], choose: 1 },
120
+ { context: [['queryable', 1], ['is', 0], ['article', 0], ['theAble', 0]], choose: 1 },
121
+ { context: [['queryable', 1], ['is', 0], ['article', 0], ['theAble', 1]], choose: 1 },
122
+
123
+ { context: [['isQuery', 0], ['a', 0], ['unknown', 0], ['a', 0], ['unknown', 0]], choose: 0 },
124
+
125
+ { context: [['isQuery', 0], ['unknown', 0], ['unknown', 0]], choose: 0 },
126
+
127
+ { context: [['isQuery', 0], ['unknown', 0], ['article', 0], ['unknown', 0]], choose: 0 },
128
+
129
+ { context: [['isQuery', 0], ['queryable', 0], ['article', 0], ['queryable', 0]], choose: 0 },
130
+ { context: [['isQuery', 0], ['queryable', 1], ['article', 0], ['queryable', 0]], choose: 0 },
131
+ { context: [['isQuery', 0], ['queryable', 1], ['article', 0], ['queryable', 1]], choose: 0 },
132
+
133
+ { context: [['unknown', 0], ['is', 0], ['unknown', 0]], choose: 1 },
134
+ { context: [["unknown",0],["is",0],["article",0],["queryable",0]], choose: 1 },
135
+ { context: [["unknown",0],["is",0],["article",0],["queryable",1]], choose: 1 },
136
+
137
+ { context: [["a",0],["unknown",0],["is",0],["a",0],["unknown",0]], choose: 2 },
138
+
139
+ { context: [['article', 0], ['unknown', 0], ['is', 0], ['article', 0], ['unknown', 0]], choose: 2 },
140
+ { context: [['queryable', 0], ['is', 0], ['article', 0], ['unknown', 1]], choose: 1 },
141
+ { context: [['queryable', 1], ['is', 0], ['article', 0], ['unknown', 1]], choose: 1 },
142
+
143
+ { context: [["article",0],["unknown",0],["isEdAble",0],["by",0],["unknown",0]], choose: 1 },
144
+
145
+ { context: [["queryable",0],["is",0],["isEder",0],["isEdAble",0],["by",0]], choose: 1 },
146
+ { context: [["queryable",1],["is",0],["isEder",0],["isEdAble",0],["by",0]], choose: 1 },
147
+ { context: [["queryable",1],["is",0],["isEder",1],["isEdAble",0],["by",0]], choose: 1 },
148
+ { context: [["queryable",0],["is",0],["unknown",0],["isEdAble",0],["by",0]], choose: 1 },
149
+ { context: [["queryable",1],["is",0],["unknown",0],["isEdAble",0],["by",0]], choose: 1 },
150
+
151
+ { context: [["unknown",0],["isEd",0],["isEdAble",0],["by",0],["unknown",0]], choose: 1 },
152
+ { context: [["unknown",0],["isEd",0],["isEdAble",0],["by",1]], choose: 1 },
153
+ { context: [["unknown",0],["isEd",0],["isEdAble",0]], choose: 1 },
110
154
 
155
+ { context: [["isEdee",0],["isEd",0],["isEdAble",0],["by",0],["isEder",0]], choose: 1 },
156
+ { context: [["isEdee",1],["isEd",0],["isEdAble",0],["by",0],["isEder",0]], choose: 1 },
157
+ { context: [["isEdee",1],["isEd",0],["isEdAble",0],["by",0],["isEder",1]], choose: 1 },
158
+ { context: [["isEdee",0],["isEd",0],["isEdAble",0],["by",1]], choose: 1 },
159
+ { context: [["isEdee",1],["isEd",0],["isEdAble",0],["by",1]], choose: 1 },
160
+
161
+
162
+ ...listorama('unknown'),
163
+ ...listorama('queryable'),
164
+ // ...listorama('listable'),
111
165
  ]
112
166
  },
113
167
  bridges: [
@@ -115,14 +169,18 @@ let config = {
115
169
  id: 'thatVerb',
116
170
  before: ['verb'],
117
171
  // 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]) }' } }",
118
- 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]) }' } }",
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: concatm(\"thatClause.\", bridge.generate), thatClause: bridge, conditions: append(bridge.subject.conditions, [bridge]) }' } }",
173
+ 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]) }' } }",
119
174
  },
120
175
 
121
176
  {
122
177
  id: 'queryable',
123
- children: [
124
- 'negatable'
125
- ],
178
+ children: [ 'negatable' ],
179
+ },
180
+ {
181
+ id: 'queryable',
182
+ level: 1,
183
+ isA: ['listable'],
126
184
  },
127
185
  {
128
186
  id: 'makeObject',
@@ -142,7 +200,6 @@ let config = {
142
200
  },
143
201
  {
144
202
  id: 'resetIdSuffix',
145
- bridge: "{ ...next(operator) }",
146
203
  semantic: ({context, api}) => {
147
204
  api.setIdSuffix('')
148
205
  }
@@ -156,10 +213,9 @@ let config = {
156
213
  optional: { 1: "{ marker: 'unknown', implicit: true, concept: true }", },
157
214
  },
158
215
 
159
- { id: "debug23", level: 0, bridge: "{ ...next(operator) }" },
160
- // { id: "what", level: 0, bridge: "{ ...next(operator), ...after[0], query: ['what'], determined: true }" },
216
+ { id: "debug23" },
161
217
  { id: "what", level: 0, optional: "{ ...next(operator), query: ['what'], determined: true }", bridge: "{ ...after, query: ['what'], modifiers: ['what'], what: operator }" },
162
- { id: "whatAble", level: 0, bridge: "{ ...next(operator) }" },
218
+ { id: "whatAble" },
163
219
 
164
220
  // context.instance == variables.instance (unification)
165
221
  {
@@ -172,12 +228,12 @@ let config = {
172
228
  return `to ${await gp(context.toObject)}`
173
229
  },
174
230
  },
175
- { id: "toAble", level: 0, bridge: "{ ...next(operator) }" },
231
+ { id: "toAble" },
176
232
 
177
233
  { id: "be", level: 0, bridge: "{ ...next(operator), type: after[0] }" },
178
- { id: "briefOrWordy", level: 0, bridge: "{ ...next(operator) }" },
234
+ { id: "briefOrWordy" },
179
235
 
180
- { id: "yesno", level: 0, bridge: "{ ...next(operator) }" },
236
+ { id: "yesno" },
181
237
  { id: "canBeQuestion", level: 0, bridge: "{ ...next(operator) }" },
182
238
  { id: "canBeQuestion", level: 1, bridge: "{ ...next(operator) }" },
183
239
  { id: "questionMark", level: 0, bridge: "{ ...before[0], query: [before.marker] }" },
@@ -190,14 +246,17 @@ let config = {
190
246
  // { id: "isEd", level: 0, bridge: "{ ...context }" },
191
247
  { id: "isEdAble", level: 0, bridge: "{ ...next(operator) }" },
192
248
  { id: "isEdAble", level: 1, bridge: "{ ...next(operator) }" },
193
- { id: "isEdee", level: 0, bridge: "{ ...next(operator) }" },
194
- { id: "isEder", level: 0, bridge: "{ ...next(operator) }" },
249
+ { id: "isEdee" },
250
+ { id: "isEder" },
195
251
  { id: "is", level: 0,
196
- bridge: "{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }",
197
- isA: ['verb'],
198
- queryBridge: "{ ...next(operator), one: after[0], two: after[1], query: true }" ,
252
+ bridge: "{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }",
253
+ isA: ['verb'],
199
254
  },
200
255
  { id: "is", level: 1, bridge: "{ ...next(operator) }" },
256
+ { id: "isQuery", level: 0,
257
+ bridge: "{ ...operator, marker: operator('is', 1), one: after[0], two: after[1], query: true, generate: [operator, 'one', 'two'] }" ,
258
+ isA: ['verb'],
259
+ },
201
260
 
202
261
  { id: "canBeDoQuestion", level: 0, bridge: "{ ...next(operator) }" },
203
262
  { id: "canBeDoQuestion", level: 1, bridge: "{ ...next(operator) }" },
@@ -285,9 +344,7 @@ let config = {
285
344
  },
286
345
  {
287
346
  id: "reason",
288
- level: 0,
289
347
  isA: ['theAble', 'queryable'],
290
- bridge: "{ ...next(operator) }"
291
348
  },
292
349
  /*
293
350
  {
@@ -321,8 +378,16 @@ let config = {
321
378
  "wordy": [{"id": "briefOrWordy", "initial": "{ value: 'wordy' }" }],
322
379
  "does": [{"id": "does", "initial": "{ number: 'one' }" }],
323
380
  "do": [{"id": "does", "initial": "{ number: 'many' }" }],
324
- "is": [{"id": "is", "initial": "{ number: 'one' }" }, {"id": "isEd", "initial": "{ number: 'one' }" }],
325
- "are": [{"id": "is", "initial": "{ number: 'many' }" }, {"id": "isEd", "initial": "{ number: 'many' }" }],
381
+ "is": [
382
+ {"id": "is", "initial": "{ number: 'one' }" },
383
+ {"id": "isQuery", "initial": "{ number: 'one' }" },
384
+ {"id": "isEd", "initial": "{ number: 'one' }" }
385
+ ],
386
+ "are": [
387
+ {"id": "is", "initial": "{ number: 'many' }" },
388
+ {"id": "isQuery", "initial": "{ number: 'many' }" },
389
+ {"id": "isEd", "initial": "{ number: 'many' }" }
390
+ ],
326
391
  }
327
392
  },
328
393
 
@@ -335,7 +400,7 @@ let config = {
335
400
  { "context": [["isEdAble",0], ["isEd",0],], "choose": [0] },
336
401
  { "context": [['a', 0], ['is', 0], ['does', 0], ], "choose": [0] },
337
402
  { "context": [['isEd', 0], ['means', 0], ], "choose": [0] },
338
- { "context": [['articlePOS', 0], ['isEdAble', 0], ], "choose": [0] },
403
+ { "context": [['article', 0], ['isEdAble', 0], ], "choose": [0] },
339
404
  { "context": [['isEdAble', 0], ['is', 0], ], "choose": [0] },
340
405
  { "context": [['isEdAble', 0], ['is', 1], ], "choose": [0] },
341
406
  ],
@@ -345,8 +410,8 @@ let config = {
345
410
  ['this', 'pronoun'],
346
411
  ['questionMark', 'punctuation'],
347
412
  // ['questionMark', 'isEd'],
348
- ['a', 'articlePOS'],
349
- ['the', 'articlePOS'],
413
+ ['a', 'article'],
414
+ ['the', 'article'],
350
415
  ['unknown', 'theAble'],
351
416
  ['theAble', 'queryable'],
352
417
  ['unknown', 'queryable'],
@@ -357,6 +422,8 @@ let config = {
357
422
  ['is', 'canBeQuestion'],
358
423
  ['it', 'toAble'],
359
424
  ['this', 'queryable'],
425
+
426
+ ['listable', 'theAble'],
360
427
  ],
361
428
  debug: false,
362
429
  version: '3',
@@ -564,8 +631,8 @@ let config = {
564
631
  todo: 'debug23',
565
632
  match: ({context}) => context.marker == 'debug23',
566
633
  apply: ({context, hierarchy}) => {
567
- debugger
568
- debugger
634
+ debugger // eslint-disable-line no-debugger
635
+ debugger // eslint-disable-line no-debugger
569
636
  },
570
637
  },
571
638
  {
@@ -659,7 +726,7 @@ let config = {
659
726
  // km('dialogues').api.mentioned(concept)
660
727
  // TODO wtf is the next line?
661
728
  value = JSON.parse(JSON.stringify(value))
662
- let instance = await e(value)
729
+ const instance = await e(value)
663
730
  if (false && instance.evalue) {
664
731
  km('stm').api.mentioned({ context: value })
665
732
  }
@@ -794,7 +861,7 @@ const initializer = ({objects, config, isModule}) => {
794
861
  return api('dialogues').toScopedId(context)
795
862
  },
796
863
  addWords: (id, word, additional) => {
797
- for (let props of words(word, { ...additional })) {
864
+ for (const props of words(word, { ...additional })) {
798
865
  config.addWord(props.word, { id, initial: JSON.stringify(props) })
799
866
  }
800
867
  },