tpmkms_4wp 8.0.0-beta.7 → 8.0.0-beta.70

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 (103) hide show
  1. package/common/animals.instance.json +2871 -1379
  2. package/common/animals.js +17 -20
  3. package/common/articles.js +103 -0
  4. package/common/articles.test.json +310 -0
  5. package/common/avatar.js +5 -9
  6. package/common/characters.js +22 -28
  7. package/common/colors.instance.json +7170 -3657
  8. package/common/colors.js +4 -8
  9. package/common/colors.test.json +345 -780
  10. package/common/comparable.instance.json +1750 -0
  11. package/common/comparable.js +36 -28
  12. package/common/comparable.test.json +438 -2
  13. package/common/concept.js +120 -118
  14. package/common/countable.js +19 -13
  15. package/common/countable.test.json +1050 -0
  16. package/common/crew.instance.json +13066 -6469
  17. package/common/crew.js +36 -41
  18. package/common/crew.test.json +714 -452
  19. package/common/currency.js +27 -45
  20. package/common/dialogues.js +161 -285
  21. package/common/dimension.instance.json +474 -253
  22. package/common/dimension.js +16 -22
  23. package/common/dimension.test.json +446 -1640
  24. package/common/edible.instance.json +20053 -10093
  25. package/common/edible.js +3 -8
  26. package/common/emotions.instance.json +147 -69
  27. package/common/emotions.js +35 -38
  28. package/common/evaluate.instance.json +2 -0
  29. package/common/evaluate.js +49 -0
  30. package/common/evaluate.test.json +574 -0
  31. package/common/events.js +10 -14
  32. package/common/fastfood.instance.json +221166 -111223
  33. package/common/fastfood.js +75 -85
  34. package/common/fastfood.test.json +268 -90
  35. package/common/formulas.instance.json +455 -249
  36. package/common/formulas.js +19 -26
  37. package/common/gdefaults.js +24 -26
  38. package/common/help.js +7 -12
  39. package/common/help.test.json +63 -8
  40. package/common/helpers/concept.js +10 -7
  41. package/common/helpers/dialogues.js +2 -3
  42. package/common/helpers/properties.js +54 -62
  43. package/common/helpers.js +6 -5
  44. package/common/hierarchy.js +16 -24
  45. package/common/javascript.js +11 -18
  46. package/common/kirk.instance.json +584 -290
  47. package/common/kirk.js +5 -8
  48. package/common/length.instance.json +8834 -4757
  49. package/common/length.js +4 -8
  50. package/common/listener.js +48 -0
  51. package/common/listener.test.json +104 -0
  52. package/common/math.instance.json +425 -1187
  53. package/common/math.js +16 -20
  54. package/common/meta.js +23 -47
  55. package/common/nameable.instance.json +2 -0
  56. package/common/nameable.js +144 -0
  57. package/common/nameable.test.json +3191 -0
  58. package/common/negation.instance.json +2 -0
  59. package/common/negation.js +38 -0
  60. package/common/negation.test.json +308 -0
  61. package/common/numbers.js +27 -31
  62. package/common/ordering.instance.json +366 -246
  63. package/common/ordering.js +80 -86
  64. package/common/people.instance.json +2074 -1022
  65. package/common/people.js +8 -13
  66. package/common/percentages.instance.json +2 -0
  67. package/common/percentages.js +53 -0
  68. package/common/percentages.test.json +751 -0
  69. package/common/pipboy.instance.json +11745 -6329
  70. package/common/pipboy.js +48 -59
  71. package/common/pokemon.instance.json +4226 -2081
  72. package/common/pokemon.js +7 -20
  73. package/common/pos.js +15 -13
  74. package/common/pressure.instance.json +2208 -1175
  75. package/common/pressure.js +4 -8
  76. package/common/properties.instance.json +131 -61
  77. package/common/properties.js +57 -134
  78. package/common/punctuation.js +15 -7
  79. package/common/reports.instance.json +1018 -530
  80. package/common/reports.js +77 -100
  81. package/common/reports.test.json +15623 -10458
  82. package/common/scorekeeper.js +18 -30
  83. package/common/sdefaults.js +16 -7
  84. package/common/sizeable.js +6 -10
  85. package/common/spock.instance.json +584 -290
  86. package/common/spock.js +5 -8
  87. package/common/stgame.js +19 -19
  88. package/common/stm.js +164 -27
  89. package/common/stm.test.json +1734 -1
  90. package/common/tell.js +14 -18
  91. package/common/temperature.instance.json +2271 -1222
  92. package/common/temperature.js +4 -8
  93. package/common/tester.js +15 -4
  94. package/common/testing.js +8 -12
  95. package/common/time.js +20 -25
  96. package/common/tokenize.js +5 -6
  97. package/common/ui.instance.json +459 -240
  98. package/common/ui.js +16 -22
  99. package/common/weight.instance.json +7646 -4026
  100. package/common/weight.js +4 -8
  101. package/common/yesno.js +5 -5
  102. package/main.js +14 -2
  103. package/package.json +28 -5
@@ -1,4 +1,4 @@
1
- const { Config, knowledgeModule, where, Digraph } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where, Digraph } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const dialogues = require('./dialogues.js')
4
4
  const pos = require('./pos.js')
@@ -91,7 +91,7 @@ class API {
91
91
  }
92
92
  */
93
93
 
94
- let configStruct = {
94
+ let config = {
95
95
  name: 'formulas',
96
96
  operators: [
97
97
  // TODO notations like (([arg1:]) [op] ([arg2:nameOfArg2}|word1])) -> just make the bridge + operators. put this in the bridge def / also calculate generators
@@ -102,16 +102,16 @@ let configStruct = {
102
102
  "(([expression]) [equals] ([expression]))",
103
103
  ],
104
104
  priorities: [
105
- { "context": [['mathematicalOperator', 0], ['number', 0], ], "choose": [0] },
105
+ { "context": [['mathematical_operator', 0], ['number', 0], ], "choose": [0] },
106
106
  ],
107
107
  semantics: [
108
108
  {
109
109
  where: where(),
110
110
  match: ({context, api}) => context.evaluate && api.get(context),
111
- apply: ({context, api, e}) => {
111
+ apply: async ({context, api, e}) => {
112
112
  const { formula } = api.get(context)
113
113
  // console.log('greg24 -----------', JSON.stringify(formula, null, 2))
114
- context.evalue = e(formula)
114
+ context.evalue = await e(formula)
115
115
  }
116
116
  },
117
117
  ],
@@ -122,7 +122,7 @@ let configStruct = {
122
122
  isA: ['preposition', 'queryable'],
123
123
  convolution: true,
124
124
  bridge: "{ number: before[0].number, ...next(operator), what: before[0], equality: after[0], variable: after[1] }",
125
- generatorp: ({context, g}) => `${g(context.what)} ${g(context.equality)} ${g(context.variable)}`,
125
+ generatorp: async ({context, g}) => `${await g(context.what)} ${await g(context.equality)} ${await g(context.variable)}`,
126
126
  evaluator: ({context, api, objects}) => {
127
127
  const formulas = api.gets(context.variable).map((f) => { return { ...f.equality, paraphrase: true } })
128
128
  context.evalue = { marker: 'list', value: formulas }
@@ -132,7 +132,7 @@ let configStruct = {
132
132
  where: where(),
133
133
  id: 'solve',
134
134
  bridge: "{ ...next(operator), equality: after[0], variable: after[2] }",
135
- generatorp: ({context, gp}) => `${context.word} ${gp(context.equality)} for ${gp(context.variable)}`,
135
+ generatorp: async ({context, gp}) => `${context.word} ${await gp(context.equality)} for ${await gp(context.variable)}`,
136
136
  semantic: ({context}) => {
137
137
  context.response = solveFor(context.equality, context.variable)
138
138
  context.isResponse = true
@@ -153,17 +153,17 @@ let configStruct = {
153
153
  {
154
154
  id: 'expression',
155
155
  children: ['mathematicalExpression', 'number'],
156
- before: ['verby'],
156
+ before: ['verb'],
157
157
  },
158
158
  {
159
159
  where: where(),
160
160
  id: 'calculate',
161
- isA: ['verby'],
161
+ isA: ['verb'],
162
162
  bridge: "{ ...next(operator), expression: after[0] }",
163
- generatorp: ({context, g}) => `${context.word} ${g(context.expression)}`,
163
+ generatorp: async ({context, g}) => `${context.word} ${await g(context.expression)}`,
164
164
  localHierarchy: [ ['unknown', 'expression'] ],
165
- semantic: ({context, e}) => {
166
- context.evalue = e(context.expression)
165
+ semantic: async ({context, e}) => {
166
+ context.evalue = await e(context.expression)
167
167
  context.isResponse = true
168
168
  }
169
169
  },
@@ -172,10 +172,10 @@ let configStruct = {
172
172
  id: 'equals',
173
173
  bridge: "{ ...next(operator), left: before[0], right: after[0] }",
174
174
  words: ['='],
175
- after: ['mathematicalOperator'],
175
+ after: ['mathematical_operator'],
176
176
  // TODO have this be per argument then 'is' can map to equals where this only applied to before[0] and not after[0]
177
177
  localHierarchy: [ ['unknown', 'expression'] ],
178
- generatorp: ({context, gp}) => `${gp(context.left)} ${context.word} ${gp(context.right)}`,
178
+ generatorp: async ({context, gp}) => `${await gp(context.left)} ${context.word} ${await gp(context.right)}`,
179
179
  semantic: ({context, api}) => {
180
180
  // TODO make sure left is a single name
181
181
  // TODO calculate invertable formulas?
@@ -188,24 +188,17 @@ let configStruct = {
188
188
  const template = {
189
189
  configs: [
190
190
  "formulas are concepts",
191
- configStruct,
191
+ config,
192
192
  ]
193
193
  }
194
194
 
195
- const createConfig = () => {
196
- const api = new API()
197
- config = new Config({ name: 'formulas' }, module)
198
- config.stop_auto_rebuild()
199
- config.add(dialogues(), pos(), math(), hierarchy(), comparable(), countable())
200
- config.api = api
201
- config.restart_auto_rebuild()
202
- return config
203
- }
204
-
205
195
  knowledgeModule({
196
+ config: { name: 'formulas' },
197
+ includes: [dialogues, pos, math, hierarchy, comparable, countable],
198
+ api: () => new API(),
199
+
206
200
  module,
207
201
  description: 'Formulas using math',
208
- createConfig,
209
202
  template: { template, instance },
210
203
  test: {
211
204
  name: './formulas.test.json',
@@ -1,11 +1,11 @@
1
1
  const pluralize = require('pluralize')
2
2
  const { defaultContextCheck } = require('./helpers')
3
- const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
3
+ const { knowledgeModule, where } = require('./runtime').theprogrammablemind
4
4
  const tokenize = require('./tokenize.js')
5
5
  const gdefaults_tests = require('./gdefaults.test.json')
6
6
  const { isMany } = require('./helpers.js')
7
7
 
8
- let configStruct = {
8
+ let config = {
9
9
  name: 'gdefaults',
10
10
  generators: [
11
11
  /* TODO save for later
@@ -23,20 +23,26 @@ let configStruct = {
23
23
  /*
24
24
  * modifiers = <list of properties>
25
25
  */
26
+ {
27
+ where: where(),
28
+ match: ({context}) => context.isResponse && context.response,
29
+ apply: ({context, gp}) => gp(context.response),
30
+ },
31
+
26
32
  {
27
33
  where: where(),
28
34
  //({context}) => context.paraphrase && context.modifiers,
29
35
  // match: ({context}) => context.paraphrase && (context.modifiers || context.postModifiers),
30
36
  match: ({context}) => (context.modifiers || context.postModifiers),
31
- apply: ({context, g, gs, callId}) => {
37
+ apply: async ({context, g, callId}) => {
32
38
  const text = []
33
39
  for (modifier of (context.modifiers || [])) {
34
40
  if (Array.isArray(context[modifier])) {
35
41
  for (let m of context[modifier]) {
36
- text.push(g(m))
42
+ text.push(await g(m))
37
43
  }
38
44
  } else {
39
- text.push(g(context[modifier], { isModifier: true }))
45
+ text.push(await g(context[modifier], { isModifier: true }))
40
46
  }
41
47
  }
42
48
  // text.push(context.word)
@@ -47,15 +53,15 @@ let configStruct = {
47
53
  number = isMany(context) ? 'many' : 'one'
48
54
  }
49
55
  if (context.postModifiers) {
50
- text.push(g({...context, number: 'one', postModifiers: undefined, modifiers: undefined}))
56
+ text.push(await g({...context, number: 'one', postModifiers: undefined, modifiers: undefined}))
51
57
  } else {
52
- text.push(g({...context, number, postModifiers: undefined, modifiers: undefined}))
58
+ text.push(await g({...context, number, postModifiers: undefined, modifiers: undefined}))
53
59
  }
54
60
  for ([index, modifier] of (context.postModifiers || []).entries()) {
55
61
  if (index == context.postModifiers.length - 1) {
56
- text.push(g({...context[modifier], number}))
62
+ text.push(await g({...context[modifier], number}))
57
63
  } else {
58
- text.push(g(context[modifier]))
64
+ text.push(await g(context[modifier]))
59
65
  }
60
66
  }
61
67
  return text.join(' ')
@@ -134,19 +140,19 @@ let configStruct = {
134
140
  {
135
141
  where: where(),
136
142
  match: ({context}) => context.evalue,
137
- apply: ({context, g}) => g(context.evalue)
143
+ apply: async ({context, g}) => await g(context.evalue)
138
144
  },
139
145
 
140
146
  {
141
147
  where: where(),
142
148
  match: ({context}) => context.value && Array.isArray(context.value),
143
- apply: ({context, gs}) => gs(context.value)
149
+ apply: async ({context, gs}) => await gs(context.value)
144
150
  },
145
151
 
146
152
  {
147
153
  where: where(),
148
154
  match: ({context}) => context.value,
149
- apply: ({context, g}) => g(context.value)
155
+ apply: async ({context, g}) => await g(context.value)
150
156
  },
151
157
 
152
158
  {
@@ -155,12 +161,6 @@ let configStruct = {
155
161
  apply: ({context}) => `the ${context.word}`
156
162
  },
157
163
 
158
- {
159
- where: where(),
160
- match: ({context}) => context.isResponse && context.response,
161
- apply: ({context, gp}) => gp(context.response),
162
- },
163
-
164
164
  {
165
165
  where: where(),
166
166
  match: ({context}) => context.word,
@@ -181,10 +181,7 @@ let configStruct = {
181
181
  ],
182
182
  };
183
183
 
184
- const createConfig = () => {
185
- const config = new Config(configStruct, module)
186
- config.add(tokenize())
187
- config.initializer( ({config}) => {
184
+ const initializer = ({config}) => {
188
185
  config.addArgs((args) => {
189
186
  return {
190
187
  number: (context) => isMany(context) ? "many" : "one",
@@ -198,14 +195,15 @@ const createConfig = () => {
198
195
  },
199
196
  }
200
197
  })
201
- })
202
- return config
203
- }
198
+ }
204
199
 
205
200
  knowledgeModule({
201
+ config,
202
+ includes: [tokenize],
203
+ initializer,
204
+
206
205
  module,
207
206
  description: 'defaults for generators',
208
- createConfig,
209
207
  test: {
210
208
  name: './gdefaults.test.json',
211
209
  contents: gdefaults_tests,
package/common/help.js CHANGED
@@ -22,7 +22,7 @@ const getHelp = (config, indent=2) => {
22
22
  return help
23
23
  }
24
24
 
25
- const configStruct = {
25
+ const config = {
26
26
  name: 'help',
27
27
  operators: [
28
28
  "([help] ([withKM|with] ([km]))?)",
@@ -82,12 +82,7 @@ const configStruct = {
82
82
  },
83
83
  };
84
84
 
85
- const createConfig = () => {
86
- const config = new Config(configStruct, module)
87
- config.stop_auto_rebuild()
88
- config.add(dialogues())
89
-
90
- config.initializer( ({ config, addWord, kms }) => {
85
+ const initializer = ({ config, addWord, kms }) => {
91
86
  const names = new Set()
92
87
  for (let name in kms) {
93
88
  names.add(name);
@@ -95,15 +90,15 @@ const createConfig = () => {
95
90
  for (let name of names) {
96
91
  addWord(name, {id: "km", initial: `{ value: '${name}', word: '${name}' }`})
97
92
  }
98
- })
99
- config.restart_auto_rebuild()
100
- return config
101
- }
93
+ }
102
94
 
103
95
  knowledgeModule({
96
+ config,
97
+ includes: [dialogues],
98
+ initializer,
99
+
104
100
  module,
105
101
  description: 'Help the user with the current knowledge modules',
106
- createConfig,
107
102
  test: {
108
103
  name: './help.test.json',
109
104
  contents: help_tests,
@@ -37,6 +37,20 @@
37
37
  0
38
38
  ]
39
39
  ],
40
+ [
41
+ [
42
+ "help",
43
+ 0
44
+ ],
45
+ [
46
+ "list",
47
+ 0
48
+ ],
49
+ [
50
+ "withKM",
51
+ 0
52
+ ]
53
+ ],
40
54
  [
41
55
  [
42
56
  "help",
@@ -91,7 +105,8 @@
91
105
  "word": "help"
92
106
  },
93
107
  {
94
- "level": 0,
108
+ "dead": true,
109
+ "level": 1,
95
110
  "marker": "km",
96
111
  "range": {
97
112
  "end": 27,
@@ -156,7 +171,7 @@
156
171
  {
157
172
  "counter": 2,
158
173
  "op": [
159
- "list",
174
+ "km",
160
175
  0
161
176
  ],
162
177
  "ops": [
@@ -181,7 +196,7 @@
181
196
  {
182
197
  "counter": 3,
183
198
  "op": [
184
- "withKM",
199
+ "list",
185
200
  0
186
201
  ],
187
202
  "ops": [
@@ -189,6 +204,10 @@
189
204
  "help",
190
205
  0
191
206
  ],
207
+ [
208
+ "list",
209
+ 0
210
+ ],
192
211
  [
193
212
  "withKM",
194
213
  0
@@ -197,6 +216,23 @@
197
216
  },
198
217
  {
199
218
  "counter": 4,
219
+ "op": [
220
+ "withKM",
221
+ 0
222
+ ],
223
+ "ops": [
224
+ [
225
+ "help",
226
+ 0
227
+ ],
228
+ [
229
+ "withKM",
230
+ 0
231
+ ]
232
+ ]
233
+ },
234
+ {
235
+ "counter": 5,
200
236
  "op": [
201
237
  "help",
202
238
  0
@@ -212,10 +248,13 @@
212
248
  },
213
249
  "objects": {
214
250
  "nameToUUID": {
251
+ "articles": "articles2",
215
252
  "dialogues": "dialogues2",
253
+ "evaluate": "evaluate2",
216
254
  "gdefaults": "gdefaults2",
217
255
  "help": "help1",
218
256
  "meta": "meta2",
257
+ "negation": "negation2",
219
258
  "pos": "pos2",
220
259
  "punctuation": "punctuation2",
221
260
  "sdefaults": "sdefaults2",
@@ -223,6 +262,8 @@
223
262
  "tokenize": "tokenize2"
224
263
  },
225
264
  "namespaced": {
265
+ "articles2": {
266
+ },
226
267
  "dialogues2": {
227
268
  "idSuffix": "",
228
269
  "mentioned": [
@@ -230,12 +271,16 @@
230
271
  "variables": {
231
272
  }
232
273
  },
274
+ "evaluate2": {
275
+ },
233
276
  "gdefaults2": {
234
277
  },
235
278
  "help1": {
236
279
  },
237
280
  "meta2": {
238
281
  },
282
+ "negation2": {
283
+ },
239
284
  "pos2": {
240
285
  },
241
286
  "punctuation2": {
@@ -289,7 +334,8 @@
289
334
  "word": "help"
290
335
  },
291
336
  {
292
- "level": 0,
337
+ "dead": true,
338
+ "level": 1,
293
339
  "marker": "km",
294
340
  "range": {
295
341
  "end": 27,
@@ -361,7 +407,7 @@
361
407
  }
362
408
  ],
363
409
  "generatedParenthesized": [
364
- "( NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n\n\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n)"
410
+ "( NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\n\n NAME: stm\n DESCRIPTION: short term memory\n\n SAMPLE SENTENCES\n\n remember m1\n previous memorable\n m1\n remember m1\\nevaluate the memorable\n the memorable before\n remember m1\\nremember m2\\nevaluate the memorable before\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: evaluate\n DESCRIPTION: Explicit handling of evaluate\n\n SAMPLE SENTENCES\n\n evaluate value1\n\n NAME: articles\n DESCRIPTION: articles\n\n SAMPLE SENTENCES\n\n the theable\n a theable\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n)"
365
411
  ],
366
412
  "metadata": {
367
413
  "opChoices": [
@@ -382,10 +428,13 @@
382
428
  },
383
429
  "objects": {
384
430
  "nameToUUID": {
431
+ "articles": "articles2",
385
432
  "dialogues": "dialogues2",
433
+ "evaluate": "evaluate2",
386
434
  "gdefaults": "gdefaults2",
387
435
  "help": "help1",
388
436
  "meta": "meta2",
437
+ "negation": "negation2",
389
438
  "pos": "pos2",
390
439
  "punctuation": "punctuation2",
391
440
  "sdefaults": "sdefaults2",
@@ -393,6 +442,8 @@
393
442
  "tokenize": "tokenize2"
394
443
  },
395
444
  "namespaced": {
445
+ "articles2": {
446
+ },
396
447
  "dialogues2": {
397
448
  "idSuffix": "",
398
449
  "mentioned": [
@@ -400,12 +451,16 @@
400
451
  "variables": {
401
452
  }
402
453
  },
454
+ "evaluate2": {
455
+ },
403
456
  "gdefaults2": {
404
457
  },
405
458
  "help1": {
406
459
  },
407
460
  "meta2": {
408
461
  },
462
+ "negation2": {
463
+ },
409
464
  "pos2": {
410
465
  },
411
466
  "punctuation2": {
@@ -440,11 +495,11 @@
440
495
  "value": "help",
441
496
  "word": "help"
442
497
  },
443
- "generatedParenthesized": "( NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n\n\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n)",
498
+ "generatedParenthesized": "( NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\n\n NAME: stm\n DESCRIPTION: short term memory\n\n SAMPLE SENTENCES\n\n remember m1\n previous memorable\n m1\n remember m1\\nevaluate the memorable\n the memorable before\n remember m1\\nremember m2\\nevaluate the memorable before\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: evaluate\n DESCRIPTION: Explicit handling of evaluate\n\n SAMPLE SENTENCES\n\n evaluate value1\n\n NAME: articles\n DESCRIPTION: articles\n\n SAMPLE SENTENCES\n\n the theable\n a theable\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n)",
444
499
  "paraphrases": "help",
445
500
  "paraphrasesParenthesized": "(help)",
446
501
  "responses": [
447
- " NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n\n\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n"
502
+ " NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\n\n NAME: stm\n DESCRIPTION: short term memory\n\n SAMPLE SENTENCES\n\n remember m1\n previous memorable\n m1\n remember m1\\nevaluate the memorable\n the memorable before\n remember m1\\nremember m2\\nevaluate the memorable before\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: evaluate\n DESCRIPTION: Explicit handling of evaluate\n\n SAMPLE SENTENCES\n\n evaluate value1\n\n NAME: articles\n DESCRIPTION: articles\n\n SAMPLE SENTENCES\n\n the theable\n a theable\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n"
448
503
  ]
449
504
  }
450
505
  ]
@@ -457,7 +512,7 @@
457
512
  ],
458
513
  "query": "help",
459
514
  "responses": [
460
- " NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n\n\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n"
515
+ " NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\n\n NAME: stm\n DESCRIPTION: short term memory\n\n SAMPLE SENTENCES\n\n remember m1\n previous memorable\n m1\n remember m1\\nevaluate the memorable\n the memorable before\n remember m1\\nremember m2\\nevaluate the memorable before\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: evaluate\n DESCRIPTION: Explicit handling of evaluate\n\n SAMPLE SENTENCES\n\n evaluate value1\n\n NAME: articles\n DESCRIPTION: articles\n\n SAMPLE SENTENCES\n\n the theable\n a theable\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n"
461
516
  ]
462
517
  }
463
518
  ]
@@ -34,10 +34,9 @@ class API {
34
34
  // TODO make the modifiers objects then below for add words for modifiers only do if !unknown
35
35
  // const objectId = pluralize.singular(object)
36
36
  const objectId = this.args.kms.dialogues.api.toScopedId(object)
37
-
38
37
  // const modifierIds = modifiers.map( (modifier) => pluralize.singular(modifier) )
39
38
  const modifierIds = modifiers.map( (modifier) => this.args.kms.dialogues.api.toScopedId(modifier) )
40
- const modifiersObjectId = `${modifiers.join("_")}_${objectId}`
39
+ const modifiersObjectId = `${modifierIds.join("_")}_${objectId}`
41
40
 
42
41
  const toWord = (object) => {
43
42
  if (typeof object == 'string') {
@@ -76,11 +75,14 @@ class API {
76
75
  config.addWord(objectPlural, { id: objectId, initial: `{ value: '${objectId}', number: 'many' }`})
77
76
  }
78
77
 
79
- zip(modifiers, modifierIds).forEach(([modifierWord, modifierId]) => {
78
+ zip(modifiers, modifierIds).forEach(([modifier, modifierId]) => {
80
79
  // config.addWord(modifier, { id: modifierId, initial: `{ value: '${modifierId}' }`})
81
80
  // TODO call evaluator to pick up overrides
82
- config.addWord(pluralize.singular(modifierWord), { id: modifierId, initial: `{ value: '${modifierId}', number: 'one' }`})
83
- config.addWord(pluralize.plural(modifierWord), { id: modifierId, initial: `{ value: '${modifierId}', number: 'many' }`})
81
+ if (modifier.unknown) {
82
+ const modifierWord = modifier.text
83
+ config.addWord(pluralize.singular(modifierWord), { id: modifierId, initial: `{ value: '${modifierId}', number: 'one' }`})
84
+ config.addWord(pluralize.plural(modifierWord), { id: modifierId, initial: `{ value: '${modifierId}', number: 'many' }`})
85
+ }
84
86
  })
85
87
  // modifierds.forEach((modifierId) => config.addWord(modifierId, { id: modifierId, initial: `{ value: '${modifierId}' }`}))
86
88
 
@@ -94,8 +96,9 @@ class API {
94
96
  id: modifiersObjectId,
95
97
  level: 0,
96
98
  convolution: true,
97
- isA: ['adjective'],
98
- before: ['verby'],
99
+ isA: [{ parent: 'adjective', instance: true }],
100
+ // isA: ['adjective'],
101
+ before: ['verb'],
99
102
  bridge: `{ ...after[0], ${modifierProperties}, atomic: true, dead: true, marker: next(operator('${modifiersObjectId}')), value: '${modifiersObjectId}', modifiers: append([${modifierList}], after[0].modifiers)}`,
100
103
  allowDups: true })
101
104
  {
@@ -50,10 +50,9 @@ class API {
50
50
  return this._objects.brief
51
51
  }
52
52
 
53
- evaluateToConcept(value, context, log, s) {
53
+ async evaluateToConcept(value, context, log, s) {
54
54
  value.evaluate = { toConcept: true }
55
- // const concept = s(value, { debug: { apply: true } })
56
- const concept = s(value)
55
+ const concept = await s(value)
57
56
  if (!concept.evalue && !concept.verbatim) {
58
57
  this.warningNotEvaluated(log, value);
59
58
  concept.evalue = concept.value