tpmkms 9.8.0-beta.8 → 9.9.0

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 (65) hide show
  1. package/common/actions.instance.json +4 -4
  2. package/common/actions.js +9 -9
  3. package/common/askfor.instance.json +12 -184
  4. package/common/askfor.js +19 -11
  5. package/common/asking.js +13 -5
  6. package/common/can.instance.json +2 -18
  7. package/common/can.js +2 -2
  8. package/common/comparable.instance.json +6 -12
  9. package/common/concept.instance.json +8 -4
  10. package/common/concept.js +2 -0
  11. package/common/conjunction.js +6 -4
  12. package/common/control.js +5 -5
  13. package/common/countable.js +1 -0
  14. package/common/dateTimeSelectors.instance.json +1 -1
  15. package/common/dateTimeSelectors.js +1 -1
  16. package/common/dates.instance.json +11 -1
  17. package/common/dates.js +6 -1
  18. package/common/debug.instance.json +5 -1
  19. package/common/debug.js +2 -0
  20. package/common/dialogues.js +37 -35
  21. package/common/dimension.instance.json +144 -446
  22. package/common/dimension.js +14 -8
  23. package/common/drone.instance.json +43 -19
  24. package/common/drone.js +29 -35
  25. package/common/drone_v1.instance.json +13 -3
  26. package/common/drone_v1.js +14 -9
  27. package/common/evaluate.js +2 -2
  28. package/common/fastfood.instance.json +12 -4
  29. package/common/fastfood.js +27 -12
  30. package/common/formulas.instance.json +138 -12
  31. package/common/formulas.js +15 -6
  32. package/common/gdefaults.js +2 -71
  33. package/common/helpers/dialogues.js +1 -10
  34. package/common/helpers/properties.js +6 -10
  35. package/common/helpers.js +5 -2
  36. package/common/hierarchy.js +11 -7
  37. package/common/math.instance.json +141 -4
  38. package/common/math.js +18 -5
  39. package/common/menus.instance.json +6 -2
  40. package/common/menus.js +5 -2
  41. package/common/meta.js +12 -12
  42. package/common/nameable.js +6 -2
  43. package/common/ordering.instance.json +1 -2
  44. package/common/percentages.js +4 -2
  45. package/common/pipboy.instance.json +38 -27
  46. package/common/pipboy.js +21 -14
  47. package/common/properties.instance.json +2319 -560
  48. package/common/properties.js +146 -37
  49. package/common/punctuation.js +1 -0
  50. package/common/rates.instance.json +1 -1
  51. package/common/rates.js +2 -2
  52. package/common/reminders.instance.json +16 -0
  53. package/common/reminders.js +23 -19
  54. package/common/reports.instance.json +4 -6
  55. package/common/reports.js +12 -12
  56. package/common/sdefaults.js +11 -9
  57. package/common/stm.js +11 -14
  58. package/common/testing.js +2 -2
  59. package/common/time.instance.json +42 -15
  60. package/common/time.js +7 -6
  61. package/common/ui.js +5 -5
  62. package/common/words.js +106 -1
  63. package/common/wp.instance.json +10 -3
  64. package/common/wp.js +5 -1
  65. package/package.json +2 -2
@@ -87,7 +87,23 @@
87
87
  "isA": [
88
88
  "mathematicalExpression"
89
89
  ],
90
- "evaluator": "async ({e, context}) => {\n const x = toValue(await e(context.x)) \n const y = toValue(await e(context.y))\n if (!x || !y) {\n // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }\n context.isResponse = false\n } else {\n context.evalue = { marker: 'number', value: apply(x, y) }\n // context.evalue = apply(x, y)\n context.evalue.isResponse = true\n context.evalue.paraphrase = false\n // context.paraphrase = false\n // context.isResponse = true\n }\n /*\n if (!context.value) {\n context.isResponse = false\n context.paraphrase = true\n }\n */\n }"
90
+ "check": [
91
+ "marker",
92
+ "text",
93
+ "verbatim",
94
+ "value",
95
+ "evalue",
96
+ "isResponse",
97
+ {
98
+ "properties": "modifiers"
99
+ },
100
+ {
101
+ "properties": "postModifiers"
102
+ },
103
+ "x",
104
+ "y"
105
+ ],
106
+ "semantic": "async ({e, context}) => {\n const x = toValue(await e(context.x, where())) \n const y = toValue(await e(context.y, where()))\n if (!x || !y) {\n // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }\n context.isResponse = false\n } else {\n context.evalue = { marker: 'number', value: apply(x, y) }\n // context.evalue = apply(x, y)\n context.evalue.isResponse = true\n context.evalue.paraphrase = false\n // context.paraphrase = false\n // context.isResponse = true\n }\n /*\n if (!context.value) {\n context.isResponse = false\n context.paraphrase = true\n }\n */\n }"
91
107
  },
92
108
  {
93
109
  "where": "/home/dev/code/theprogrammablemind/kms/common/math.js:33",
@@ -118,7 +134,23 @@
118
134
  "isA": [
119
135
  "mathematicalExpression"
120
136
  ],
121
- "evaluator": "async ({e, context}) => {\n const x = toValue(await e(context.x)) \n const y = toValue(await e(context.y))\n if (!x || !y) {\n // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }\n context.isResponse = false\n } else {\n context.evalue = { marker: 'number', value: apply(x, y) }\n // context.evalue = apply(x, y)\n context.evalue.isResponse = true\n context.evalue.paraphrase = false\n // context.paraphrase = false\n // context.isResponse = true\n }\n /*\n if (!context.value) {\n context.isResponse = false\n context.paraphrase = true\n }\n */\n }"
137
+ "check": [
138
+ "marker",
139
+ "text",
140
+ "verbatim",
141
+ "value",
142
+ "evalue",
143
+ "isResponse",
144
+ {
145
+ "properties": "modifiers"
146
+ },
147
+ {
148
+ "properties": "postModifiers"
149
+ },
150
+ "x",
151
+ "y"
152
+ ],
153
+ "semantic": "async ({e, context}) => {\n const x = toValue(await e(context.x, where())) \n const y = toValue(await e(context.y, where()))\n if (!x || !y) {\n // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }\n context.isResponse = false\n } else {\n context.evalue = { marker: 'number', value: apply(x, y) }\n // context.evalue = apply(x, y)\n context.evalue.isResponse = true\n context.evalue.paraphrase = false\n // context.paraphrase = false\n // context.isResponse = true\n }\n /*\n if (!context.value) {\n context.isResponse = false\n context.paraphrase = true\n }\n */\n }"
122
154
  },
123
155
  {
124
156
  "where": "/home/dev/code/theprogrammablemind/kms/common/math.js:33",
@@ -158,7 +190,23 @@
158
190
  "isA": [
159
191
  "mathematicalExpression"
160
192
  ],
161
- "evaluator": "async ({e, context}) => {\n const x = toValue(await e(context.x)) \n const y = toValue(await e(context.y))\n if (!x || !y) {\n // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }\n context.isResponse = false\n } else {\n context.evalue = { marker: 'number', value: apply(x, y) }\n // context.evalue = apply(x, y)\n context.evalue.isResponse = true\n context.evalue.paraphrase = false\n // context.paraphrase = false\n // context.isResponse = true\n }\n /*\n if (!context.value) {\n context.isResponse = false\n context.paraphrase = true\n }\n */\n }"
193
+ "check": [
194
+ "marker",
195
+ "text",
196
+ "verbatim",
197
+ "value",
198
+ "evalue",
199
+ "isResponse",
200
+ {
201
+ "properties": "modifiers"
202
+ },
203
+ {
204
+ "properties": "postModifiers"
205
+ },
206
+ "x",
207
+ "y"
208
+ ],
209
+ "semantic": "async ({e, context}) => {\n const x = toValue(await e(context.x, where())) \n const y = toValue(await e(context.y, where()))\n if (!x || !y) {\n // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }\n context.isResponse = false\n } else {\n context.evalue = { marker: 'number', value: apply(x, y) }\n // context.evalue = apply(x, y)\n context.evalue.isResponse = true\n context.evalue.paraphrase = false\n // context.paraphrase = false\n // context.isResponse = true\n }\n /*\n if (!context.value) {\n context.isResponse = false\n context.paraphrase = true\n }\n */\n }"
162
210
  },
163
211
  {
164
212
  "where": "/home/dev/code/theprogrammablemind/kms/common/math.js:33",
@@ -197,7 +245,29 @@
197
245
  "isA": [
198
246
  "mathematicalExpression"
199
247
  ],
200
- "evaluator": "async ({e, context}) => {\n const x = toValue(await e(context.x)) \n const y = toValue(await e(context.y))\n if (!x || !y) {\n // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }\n context.isResponse = false\n } else {\n context.evalue = { marker: 'number', value: apply(x, y) }\n // context.evalue = apply(x, y)\n context.evalue.isResponse = true\n context.evalue.paraphrase = false\n // context.paraphrase = false\n // context.isResponse = true\n }\n /*\n if (!context.value) {\n context.isResponse = false\n context.paraphrase = true\n }\n */\n }"
248
+ "check": [
249
+ "marker",
250
+ "text",
251
+ "verbatim",
252
+ "value",
253
+ "evalue",
254
+ "isResponse",
255
+ {
256
+ "properties": "modifiers"
257
+ },
258
+ {
259
+ "properties": "postModifiers"
260
+ },
261
+ "x",
262
+ "y"
263
+ ],
264
+ "semantic": "async ({e, context}) => {\n const x = toValue(await e(context.x, where())) \n const y = toValue(await e(context.y, where()))\n if (!x || !y) {\n // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }\n context.isResponse = false\n } else {\n context.evalue = { marker: 'number', value: apply(x, y) }\n // context.evalue = apply(x, y)\n context.evalue.isResponse = true\n context.evalue.paraphrase = false\n // context.paraphrase = false\n // context.isResponse = true\n }\n /*\n if (!context.value) {\n context.isResponse = false\n context.paraphrase = true\n }\n */\n }"
265
+ }
266
+ ],
267
+ "semantics": [
268
+ {
269
+ "match": "({context, isA, callId, isMany}) => {\n return context.marker == 'same' && isA(context.two, 'mathematicalExpression') && !isMany(context.one)\n }",
270
+ "apply": "({context}) => {\n // dont so the other one for is\n }"
201
271
  }
202
272
  ]
203
273
  }
@@ -541,6 +611,22 @@
541
611
  "bridge": "{ ...next(operator) }",
542
612
  "isA": [
543
613
  "mathematicalExpression"
614
+ ],
615
+ "check": [
616
+ "marker",
617
+ "text",
618
+ "verbatim",
619
+ "value",
620
+ "evalue",
621
+ "isResponse",
622
+ {
623
+ "properties": "modifiers"
624
+ },
625
+ {
626
+ "properties": "postModifiers"
627
+ },
628
+ "x",
629
+ "y"
544
630
  ]
545
631
  },
546
632
  {
@@ -570,6 +656,22 @@
570
656
  "bridge": "{ ...next(operator) }",
571
657
  "isA": [
572
658
  "mathematicalExpression"
659
+ ],
660
+ "check": [
661
+ "marker",
662
+ "text",
663
+ "verbatim",
664
+ "value",
665
+ "evalue",
666
+ "isResponse",
667
+ {
668
+ "properties": "modifiers"
669
+ },
670
+ {
671
+ "properties": "postModifiers"
672
+ },
673
+ "x",
674
+ "y"
573
675
  ]
574
676
  },
575
677
  {
@@ -608,6 +710,22 @@
608
710
  "bridge": "{ ...next(operator) }",
609
711
  "isA": [
610
712
  "mathematicalExpression"
713
+ ],
714
+ "check": [
715
+ "marker",
716
+ "text",
717
+ "verbatim",
718
+ "value",
719
+ "evalue",
720
+ "isResponse",
721
+ {
722
+ "properties": "modifiers"
723
+ },
724
+ {
725
+ "properties": "postModifiers"
726
+ },
727
+ "x",
728
+ "y"
611
729
  ]
612
730
  },
613
731
  {
@@ -645,8 +763,27 @@
645
763
  "bridge": "{ ...next(operator) }",
646
764
  "isA": [
647
765
  "mathematicalExpression"
766
+ ],
767
+ "check": [
768
+ "marker",
769
+ "text",
770
+ "verbatim",
771
+ "value",
772
+ "evalue",
773
+ "isResponse",
774
+ {
775
+ "properties": "modifiers"
776
+ },
777
+ {
778
+ "properties": "postModifiers"
779
+ },
780
+ "x",
781
+ "y"
648
782
  ]
649
783
  }
784
+ ],
785
+ "semantics": [
786
+ {}
650
787
  ]
651
788
  }
652
789
  ],
package/common/math.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
- const { defaultContextCheck } = require('./helpers')
2
+ const { defaultContextCheck, defaultContextCheckProperties } = require('./helpers')
3
3
  const dialogues = require('./dialogues')
4
4
  const numbers = require('./numbers')
5
5
  const punctuation = require('./punctuation')
@@ -47,9 +47,10 @@ function mathematicalOperator(name, words, apply, before = []) {
47
47
  bridge: "{ ...next(operator) }",
48
48
  isA: ['mathematicalExpression'],
49
49
  // generatorp: async ({gp, context}) => `${await gp(context.x)} ${context.word} ${await gp(context.y)}`,
50
- evaluator: async ({e, context}) => {
51
- const x = toValue(await e(context.x))
52
- const y = toValue(await e(context.y))
50
+ check: defaultContextCheckProperties(['x', 'y']),
51
+ semantic: async ({e, context}) => {
52
+ const x = toValue(await e(context.x, where()))
53
+ const y = toValue(await e(context.y, where()))
53
54
  if (!x || !y) {
54
55
  // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }
55
56
  context.isResponse = false
@@ -107,6 +108,16 @@ const config = {
107
108
  ...mathematicalOperator('times', ['times', '*'], (x, y) => x * y, [['plusOperator', 0], ['minusOperator', 0]]),
108
109
  ...mathematicalOperator('divideBy', ['/'], (x, y) => x / y, [['plusOperator', 0], ['minusOperator', 0]]),
109
110
  ],
111
+ semantics: [
112
+ {
113
+ match: ({context, isA, callId, isMany}) => {
114
+ return context.marker == 'same' && isA(context.two, 'mathematicalExpression') && !isMany(context.one)
115
+ },
116
+ apply: ({context}) => {
117
+ // dont so the other one for is
118
+ }
119
+ },
120
+ ],
110
121
  };
111
122
 
112
123
  const template = {
@@ -129,7 +140,9 @@ knowledgeModule( {
129
140
  name: './math.test.json',
130
141
  contents: tests,
131
142
  checks: {
132
- context: [defaultContextCheck()],
143
+ context: [
144
+ defaultContextCheck()
145
+ ],
133
146
  }
134
147
  },
135
148
  })
@@ -14,6 +14,7 @@
14
14
  "bridges": [
15
15
  {
16
16
  "id": "close_menus",
17
+ "where": "/home/dev/code/theprogrammablemind/kms/common/menus.js:130",
17
18
  "isA": [
18
19
  "verb"
19
20
  ],
@@ -25,6 +26,7 @@
25
26
  },
26
27
  {
27
28
  "id": "show_menus",
29
+ "where": "/home/dev/code/theprogrammablemind/kms/common/menus.js:141",
28
30
  "isA": [
29
31
  "verb"
30
32
  ],
@@ -43,7 +45,7 @@
43
45
  "semantics": [
44
46
  {
45
47
  "match": "({context, isA}) => isA(context, 'showable_menus')",
46
- "apply": "async ({context, insert, s, fragments}) => {\n const instantiation = await fragments(\"show showable\", { 'showable_menus': context })\n await s(instantiation)\n }"
48
+ "apply": "async ({context, insert, e, fragments}) => {\n const instantiation = await fragments(\"show showable\", { 'showable_menus': context })\n await e(instantiation, where())\n }"
47
49
  }
48
50
  ]
49
51
  },
@@ -1702,6 +1704,7 @@
1702
1704
  "bridges": [
1703
1705
  {
1704
1706
  "id": "close_menus",
1707
+ "where": "/home/dev/code/theprogrammablemind/kms/common/menus.js:130",
1705
1708
  "isA": [
1706
1709
  "verb"
1707
1710
  ],
@@ -1712,6 +1715,7 @@
1712
1715
  },
1713
1716
  {
1714
1717
  "id": "show_menus",
1718
+ "where": "/home/dev/code/theprogrammablemind/kms/common/menus.js:141",
1715
1719
  "isA": [
1716
1720
  "verb"
1717
1721
  ],
@@ -1728,7 +1732,7 @@
1728
1732
  ],
1729
1733
  "semantics": [
1730
1734
  {
1731
- "where": "/home/dev/code/theprogrammablemind/kms/common/menus.js:156"
1735
+ "where": "/home/dev/code/theprogrammablemind/kms/common/menus.js:159"
1732
1736
  }
1733
1737
  ]
1734
1738
  },
package/common/menus.js CHANGED
@@ -127,6 +127,7 @@ const template = {
127
127
  bridges: [
128
128
  {
129
129
  id: 'close_menus',
130
+ where: where(),
130
131
  isA: ['verb'],
131
132
  associations: ['menus'],
132
133
  bridge: "{ ...next(operator), closee: after[0], generate: ['this', 'closee'] }",
@@ -136,6 +137,8 @@ const template = {
136
137
  },
137
138
  {
138
139
  id: 'show_menus',
140
+ where: where(),
141
+ where: where(),
139
142
  isA: ['verb'],
140
143
  bridge: "{ ...next(operator), show: after[0], generate: ['this', 'show'] }",
141
144
  semantic: ({context, api}) => {
@@ -155,9 +158,9 @@ const template = {
155
158
  {
156
159
  where: where(),
157
160
  match: ({context, isA}) => isA(context, 'showable_menus'),
158
- apply: async ({context, insert, s, fragments}) => {
161
+ apply: async ({context, insert, e, fragments}) => {
159
162
  const instantiation = await fragments("show showable", { 'showable_menus': context })
160
- await s(instantiation)
163
+ await e(instantiation, where())
161
164
  }
162
165
  },
163
166
  ]
package/common/meta.js CHANGED
@@ -78,7 +78,7 @@ const config = {
78
78
  id: 'synonymOfWord',
79
79
  operator: "((synonym/*) [synonymOfWord|of] (word))",
80
80
  bridge: "{ ...next(operator), word: after[0] }",
81
- evaluator: ({context}) => {
81
+ semantic: ({context}) => {
82
82
  }
83
83
  },
84
84
  */
@@ -192,10 +192,10 @@ const config = {
192
192
  {
193
193
  where: where(),
194
194
  match: ({context}) => context.marker == 'orList',
195
- apply: async ({context, s}) => {
195
+ apply: async ({context, e}) => {
196
196
  const response = []
197
197
  for (const value of context.value) {
198
- response.push(await s(value))
198
+ response.push(await e(value, where()))
199
199
  }
200
200
  context.evalue = {
201
201
  marker: 'orList',
@@ -219,7 +219,7 @@ const config = {
219
219
  function invertMappings(mappings) {
220
220
  return mappings.map( ({ from, to }) => { return { to: from, from: to } } )
221
221
  }
222
- return async ({context, s, config}) => {
222
+ return async ({context, e, config}) => {
223
223
  DEFINITIONs = _.cloneDeep(DEFINITIONs)
224
224
  //const mappings = mappingss[0]
225
225
  let toPrimes = []
@@ -229,7 +229,7 @@ const config = {
229
229
  }
230
230
  // next move add debug arg to s and g
231
231
  TO.query = true
232
- toPrimes.push([await s(TO), mappings])
232
+ toPrimes.push([await e(TO, where()), mappings])
233
233
  }
234
234
 
235
235
  let hasResponse = false
@@ -323,12 +323,12 @@ const config = {
323
323
  return ({context}) => context.evalue == defContext.from.value && !context.query && !context.objects
324
324
  }
325
325
  function apply(mappings, TO) {
326
- return async ({context, s}) => {
326
+ return async ({context, e}) => {
327
327
  TO = _.cloneDeep(TO)
328
328
  for (const { from, to } of mappings) {
329
329
  hashIndexesSet(TO, to, hashIndexesGet(context, from))
330
330
  }
331
- toPrime = await s(TO)
331
+ toPrime = await e(TO, where())
332
332
  context.result = toPrime.result
333
333
  }
334
334
  }
@@ -349,14 +349,15 @@ const config = {
349
349
 
350
350
  // setup the read semantic
351
351
  {
352
+ // TODO change this disable to callOnce
352
353
  function matchByMarker(defContext) {
353
- return ({context, uuid}) => context.marker == defContext.from.marker && (context.query || context.evaluate) && !context[`disable${uuid}`]
354
+ return ({context, uuid}) => context.marker == defContext.from.marker && !context[`disable${uuid}`]
354
355
  }
355
356
  function matchByValue(defContext) {
356
- return ({context, uuid}) => context.value == defContext.from.value && (context.query || context.evaluate) && !context[`disable${uuid}`]
357
+ return ({context, uuid, stack}) => context.value == defContext.from.value && !context[`disable${uuid}`]
357
358
  }
358
359
  function apply(mappings, TO) {
359
- return async ({uuid, context, s, g, config}) => {
360
+ return async ({uuid, context, e, g, config}) => {
360
361
  TO = _.cloneDeep(TO)
361
362
  for (const { from, to } of mappings) {
362
363
  hashIndexesSet(TO, to, hashIndexesGet(context, from))
@@ -366,11 +367,10 @@ const config = {
366
367
  if (context.query) {
367
368
  TO.query = context.query
368
369
  } else {
369
- TO.evaluate = context.evaluate
370
370
  TO.metaDefinition = true
371
371
  }
372
372
  TO[`disable${uuid}`] = true
373
- toPrime = await s(TO)
373
+ toPrime = await e(TO, where())
374
374
  if (context.query) {
375
375
  if (toPrime.evalue) {
376
376
  context.evalue = toPrime.evalue
@@ -88,6 +88,7 @@ const config = {
88
88
  },
89
89
  {
90
90
  id: 'getNamesByType',
91
+ where: where(),
91
92
  scope: "testing",
92
93
  isA: ['verb'],
93
94
  bridge: "{ ...next(operator), type: after[0] }",
@@ -113,6 +114,7 @@ const config = {
113
114
  },
114
115
  {
115
116
  id: 'call',
117
+ where: where(),
116
118
  isA: ['verb'],
117
119
  words: englishHelpers.conjugateVerb('call'),
118
120
  bridge: `{
@@ -124,7 +126,7 @@ const config = {
124
126
  `,
125
127
  // generatorp: async ({context, g, gs}) => `call ${await g(context.nameable)} ${await gs(context.name)}`,
126
128
  semantic: async ({config, context, api, e, verbatim, g}) => {
127
- const nameable = (await e(context.nameable))?.evalue
129
+ const nameable = (await e(context.nameable, where()))?.evalue
128
130
  if (!nameable) {
129
131
  verbatim(`${await g(context.nameable)} is not known`)
130
132
  return
@@ -188,7 +190,9 @@ knowledgeModule( {
188
190
  context: [
189
191
  defaultContextCheck({ extra: ['pullFromContext'] }),
190
192
  ],
191
- objects: ['mentioned', { km: 'stm' }],
193
+ objects: [
194
+ { km: 'stm' }
195
+ ],
192
196
  },
193
197
  include: {
194
198
  words: [ "peter james chunkington", "banana" ],
@@ -203,8 +203,7 @@
203
203
  "types": [
204
204
  "unknown"
205
205
  ],
206
- "level": 0,
207
- "evaluate": false
206
+ "level": 0
208
207
  },
209
208
  "two": {
210
209
  "marker": "xfx",
@@ -12,6 +12,7 @@ const config = {
12
12
  bridges: [
13
13
  {
14
14
  id: "percent",
15
+ where: where(),
15
16
  words: ['percent', '%'],
16
17
  separators: '?',
17
18
  bridge: "{ ...next(operator), modifiers: ['scale'], scale: before[0] }",
@@ -19,11 +20,12 @@ const config = {
19
20
  },
20
21
  {
21
22
  id: "percentageOf",
23
+ where: where(),
22
24
  words: ['percent', '%'],
23
25
  bridge: "{ ...next(operator), percentage: before[0], isResponse: true, semanticIsEvaluate: true, value: after[0] }",
24
- evaluator: async ({context, e}) => {
26
+ semantic: async ({context, e}) => {
25
27
  const scale = context.percentage.scale
26
- const number = await e(context.value)
28
+ const number = await e(context.value, where())
27
29
  const percentage = number.value * scale.value / 100
28
30
  const result = { ...number, value: percentage, evalue: percentage, word: null, text: null }
29
31
  context.evalue = result