ekms 8.0.0-beta.75 → 8.0.0-beta.76

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,14 +29,14 @@
29
29
  ],
30
30
  "semantics": [
31
31
  {
32
- "where": "/home/dev/code/theprogrammablemind/kms/node_modules/theprogrammablemind/src/helpers.js:5",
32
+ "where": "/home/dev/code/theprogrammablemind/kms/common/formulas.js:109",
33
33
  "match": "({context, api}) => context.evaluate && api.get(context)",
34
34
  "apply": "async ({context, api, e}) => {\n const { formula } = api.get(context)\n // console.log('greg24 -----------', JSON.stringify(formula, null, 2))\n context.evalue = await e(formula) \n }"
35
35
  }
36
36
  ],
37
37
  "bridges": [
38
38
  {
39
- "where": "/home/dev/code/theprogrammablemind/kms/node_modules/theprogrammablemind/src/helpers.js:5",
39
+ "where": "/home/dev/code/theprogrammablemind/kms/common/formulas.js:120",
40
40
  "id": "formulaForVariable",
41
41
  "isA": [
42
42
  "preposition",
@@ -48,7 +48,7 @@
48
48
  "evaluator": "({context, api, objects}) => {\n const formulas = api.gets(context.variable).map((f) => { return { ...f.equality, paraphrase: true } })\n context.evalue = { marker: 'list', value: formulas }\n }"
49
49
  },
50
50
  {
51
- "where": "/home/dev/code/theprogrammablemind/kms/node_modules/theprogrammablemind/src/helpers.js:5",
51
+ "where": "/home/dev/code/theprogrammablemind/kms/common/formulas.js:132",
52
52
  "id": "solve",
53
53
  "bridge": "{ ...next(operator), equality: after[0], variable: after[2] }",
54
54
  "generatorp": "async ({context, gp}) => `${context.word} ${await gp(context.equality)} for ${await gp(context.variable)}`",
@@ -74,7 +74,7 @@
74
74
  ]
75
75
  },
76
76
  {
77
- "where": "/home/dev/code/theprogrammablemind/kms/node_modules/theprogrammablemind/src/helpers.js:5",
77
+ "where": "/home/dev/code/theprogrammablemind/kms/common/formulas.js:159",
78
78
  "id": "calculate",
79
79
  "isA": [
80
80
  "verb"
@@ -90,7 +90,7 @@
90
90
  "semantic": "async ({context, e}) => {\n context.evalue = await e(context.expression)\n context.isResponse = true\n }"
91
91
  },
92
92
  {
93
- "where": "/home/dev/code/theprogrammablemind/kms/node_modules/theprogrammablemind/src/helpers.js:5",
93
+ "where": "/home/dev/code/theprogrammablemind/kms/common/formulas.js:171",
94
94
  "id": "equals",
95
95
  "bridge": "{ ...next(operator), left: before[0], right: after[0] }",
96
96
  "words": [
@@ -614,11 +614,6 @@
614
614
  "theAble",
615
615
  false
616
616
  ],
617
- [
618
- "property",
619
- "unknown",
620
- false
621
- ],
622
617
  [
623
618
  "punctuation",
624
619
  "punctuation",
@@ -829,11 +824,6 @@
829
824
  "hierarchyAble",
830
825
  false
831
826
  ],
832
- [
833
- "unknown",
834
- "object",
835
- false
836
- ],
837
827
  [
838
828
  "unknown",
839
829
  "queryable",
@@ -1088,12 +1078,12 @@
1088
1078
  ],
1089
1079
  "semantics": [
1090
1080
  {
1091
- "where": "/home/dev/code/theprogrammablemind/kms/node_modules/theprogrammablemind/src/helpers.js:5"
1081
+ "where": "/home/dev/code/theprogrammablemind/kms/common/formulas.js:109"
1092
1082
  }
1093
1083
  ],
1094
1084
  "bridges": [
1095
1085
  {
1096
- "where": "/home/dev/code/theprogrammablemind/kms/node_modules/theprogrammablemind/src/helpers.js:5",
1086
+ "where": "/home/dev/code/theprogrammablemind/kms/common/formulas.js:120",
1097
1087
  "id": "formulaForVariable",
1098
1088
  "isA": [
1099
1089
  "preposition",
@@ -1103,7 +1093,7 @@
1103
1093
  "bridge": "{ number: before[0].number, ...next(operator), what: before[0], equality: after[0], variable: after[1] }"
1104
1094
  },
1105
1095
  {
1106
- "where": "/home/dev/code/theprogrammablemind/kms/node_modules/theprogrammablemind/src/helpers.js:5",
1096
+ "where": "/home/dev/code/theprogrammablemind/kms/common/formulas.js:132",
1107
1097
  "id": "solve",
1108
1098
  "bridge": "{ ...next(operator), equality: after[0], variable: after[2] }"
1109
1099
  },
@@ -1127,7 +1117,7 @@
1127
1117
  ]
1128
1118
  },
1129
1119
  {
1130
- "where": "/home/dev/code/theprogrammablemind/kms/node_modules/theprogrammablemind/src/helpers.js:5",
1120
+ "where": "/home/dev/code/theprogrammablemind/kms/common/formulas.js:159",
1131
1121
  "id": "calculate",
1132
1122
  "isA": [
1133
1123
  "verb"
@@ -1141,7 +1131,7 @@
1141
1131
  ]
1142
1132
  },
1143
1133
  {
1144
- "where": "/home/dev/code/theprogrammablemind/kms/node_modules/theprogrammablemind/src/helpers.js:5",
1134
+ "where": "/home/dev/code/theprogrammablemind/kms/common/formulas.js:171",
1145
1135
  "id": "equals",
1146
1136
  "bridge": "{ ...next(operator), left: before[0], right: after[0] }",
1147
1137
  "words": [
@@ -63,6 +63,9 @@ class API {
63
63
 
64
64
  setupObjectHierarchy(config, id, { types } = {}) {
65
65
  for (let type of types) {
66
+ if (typeof type !== 'string') {
67
+ type = type.word
68
+ }
66
69
  config.addHierarchy(id, type)
67
70
  }
68
71
  }
@@ -316,7 +316,12 @@ class API {
316
316
  allowDups: true,
317
317
  })
318
318
  // config.addOperator({ id: operator, level: 1, words: [operator] })
319
- config.addBridge({ id: operator, level: 1, bridge: '{ ...next(operator) }', allowDups: true })
319
+ config.addBridge({
320
+ id: operator,
321
+ level: 1,
322
+ bridge: '{ ...next(operator) }',
323
+ allowDups: true,
324
+ })
320
325
  config.addPriority({ "context": [['does', 0], [operator, 1], ], "choose": [0] })
321
326
  config.addPriority({ "context": [['doesnt', 0], [operator, 1], ], "choose": [0] })
322
327
  config.addPriority({ "context": [[operator, 0], ['does', 0], ], "choose": [0] })
@@ -355,7 +360,13 @@ class API {
355
360
 
356
361
  const unflattenArgs = [ ...before.map( (arg) => arg.tag ), ...after.map( (arg) => arg.tag ) ]
357
362
  const focusable = [ ...before.map( (arg) => arg.tag ), ...after.map( (arg) => arg.tag ) ]
358
- config.addBridge({ id: operator, level: 0, localHierarchy, bridge: `{ ... next(operator) ${doParams} ${beforeArgs} ${afterArgs}, unflatten: ${JSON.stringify(unflattenArgs)}, focusable: ${JSON.stringify(focusable)} }`, allowDups: true })
363
+ config.addBridge({
364
+ id: operator,
365
+ level: 0,
366
+ localHierarchy: [...localHierarchy, ['object', 'unknown']],
367
+ bridge: `{ ... next(operator) ${doParams} ${beforeArgs} ${afterArgs}, unflatten: ${JSON.stringify(unflattenArgs)}, focusable: ${JSON.stringify(focusable)} }`,
368
+ allowDups: true
369
+ })
359
370
  if (words.length > 0) {
360
371
  for (const word of words) {
361
372
  config.addWord(word, { id: operator, initial: `{ value: "${operator}" }` })
@@ -1130,11 +1130,6 @@
1130
1130
  "theAble",
1131
1131
  false
1132
1132
  ],
1133
- [
1134
- "property",
1135
- "unknown",
1136
- false
1137
- ],
1138
1133
  [
1139
1134
  "punctuation",
1140
1135
  "punctuation",
@@ -1340,11 +1335,6 @@
1340
1335
  "hierarchyAble",
1341
1336
  false
1342
1337
  ],
1343
- [
1344
- "unknown",
1345
- "object",
1346
- false
1347
- ],
1348
1338
  [
1349
1339
  "unknown",
1350
1340
  "queryable",