tpmkms_4wp 8.0.0-beta.6 → 8.0.0-beta.60

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 (102) 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 +1738 -0
  11. package/common/comparable.js +46 -27
  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 -6598
  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 +20059 -10007
  25. package/common/edible.js +3 -8
  26. package/common/emotions.instance.json +147 -129
  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 +221967 -111264
  33. package/common/fastfood.js +74 -84
  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 +22 -22
  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 +135 -0
  57. package/common/nameable.test.json +2121 -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 +2134 -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 +11777 -6289
  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 +12 -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 +6 -6
  79. package/common/reports.instance.json +1018 -530
  80. package/common/reports.js +73 -97
  81. package/common/scorekeeper.js +18 -30
  82. package/common/sdefaults.js +16 -7
  83. package/common/sizeable.js +6 -10
  84. package/common/spock.instance.json +584 -290
  85. package/common/spock.js +5 -8
  86. package/common/stgame.js +19 -19
  87. package/common/stm.js +164 -27
  88. package/common/stm.test.json +1734 -1
  89. package/common/tell.js +14 -18
  90. package/common/temperature.instance.json +2271 -1222
  91. package/common/temperature.js +4 -8
  92. package/common/tester.js +3 -3
  93. package/common/testing.js +8 -12
  94. package/common/time.js +20 -25
  95. package/common/tokenize.js +4 -5
  96. package/common/ui.instance.json +459 -240
  97. package/common/ui.js +16 -22
  98. package/common/weight.instance.json +7646 -4026
  99. package/common/weight.js +4 -8
  100. package/common/yesno.js +5 -5
  101. package/main.js +59 -46
  102. 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,
@@ -19,24 +19,6 @@
19
19
  0
20
20
  ]
21
21
  ],
22
- [
23
- [
24
- "help",
25
- 0
26
- ],
27
- [
28
- "km",
29
- 0
30
- ],
31
- [
32
- "list",
33
- 0
34
- ],
35
- [
36
- "withKM",
37
- 0
38
- ]
39
- ],
40
22
  [
41
23
  [
42
24
  "help",
@@ -212,10 +194,13 @@
212
194
  },
213
195
  "objects": {
214
196
  "nameToUUID": {
197
+ "articles": "articles2",
215
198
  "dialogues": "dialogues2",
199
+ "evaluate": "evaluate2",
216
200
  "gdefaults": "gdefaults2",
217
201
  "help": "help1",
218
202
  "meta": "meta2",
203
+ "negation": "negation2",
219
204
  "pos": "pos2",
220
205
  "punctuation": "punctuation2",
221
206
  "sdefaults": "sdefaults2",
@@ -223,6 +208,8 @@
223
208
  "tokenize": "tokenize2"
224
209
  },
225
210
  "namespaced": {
211
+ "articles2": {
212
+ },
226
213
  "dialogues2": {
227
214
  "idSuffix": "",
228
215
  "mentioned": [
@@ -230,12 +217,16 @@
230
217
  "variables": {
231
218
  }
232
219
  },
220
+ "evaluate2": {
221
+ },
233
222
  "gdefaults2": {
234
223
  },
235
224
  "help1": {
236
225
  },
237
226
  "meta2": {
238
227
  },
228
+ "negation2": {
229
+ },
239
230
  "pos2": {
240
231
  },
241
232
  "punctuation2": {
@@ -361,7 +352,7 @@
361
352
  }
362
353
  ],
363
354
  "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)"
355
+ "( 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: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\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\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n)"
365
356
  ],
366
357
  "metadata": {
367
358
  "opChoices": [
@@ -382,10 +373,13 @@
382
373
  },
383
374
  "objects": {
384
375
  "nameToUUID": {
376
+ "articles": "articles2",
385
377
  "dialogues": "dialogues2",
378
+ "evaluate": "evaluate2",
386
379
  "gdefaults": "gdefaults2",
387
380
  "help": "help1",
388
381
  "meta": "meta2",
382
+ "negation": "negation2",
389
383
  "pos": "pos2",
390
384
  "punctuation": "punctuation2",
391
385
  "sdefaults": "sdefaults2",
@@ -393,6 +387,8 @@
393
387
  "tokenize": "tokenize2"
394
388
  },
395
389
  "namespaced": {
390
+ "articles2": {
391
+ },
396
392
  "dialogues2": {
397
393
  "idSuffix": "",
398
394
  "mentioned": [
@@ -400,12 +396,16 @@
400
396
  "variables": {
401
397
  }
402
398
  },
399
+ "evaluate2": {
400
+ },
403
401
  "gdefaults2": {
404
402
  },
405
403
  "help1": {
406
404
  },
407
405
  "meta2": {
408
406
  },
407
+ "negation2": {
408
+ },
409
409
  "pos2": {
410
410
  },
411
411
  "punctuation2": {
@@ -440,11 +440,11 @@
440
440
  "value": "help",
441
441
  "word": "help"
442
442
  },
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)",
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 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: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\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\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n)",
444
444
  "paraphrases": "help",
445
445
  "paraphrasesParenthesized": "(help)",
446
446
  "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"
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 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: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\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\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n"
448
448
  ]
449
449
  }
450
450
  ]
@@ -457,7 +457,7 @@
457
457
  ],
458
458
  "query": "help",
459
459
  "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"
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 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: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\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\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n"
461
461
  ]
462
462
  }
463
463
  ]
@@ -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