ekms 8.0.0-beta.31 → 8.0.0-beta.33

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/common/animals.instance.json +325 -0
  2. package/common/articles.js +108 -0
  3. package/common/articles.test.json +310 -0
  4. package/common/colors.instance.json +340 -0
  5. package/common/crew.instance.json +525 -0
  6. package/common/dialogues.js +66 -102
  7. package/common/dimension.instance.json +20 -0
  8. package/common/edible.instance.json +650 -28
  9. package/common/emotions.instance.json +25 -0
  10. package/common/evaluate.instance.json +2 -0
  11. package/common/evaluate.js +55 -0
  12. package/common/evaluate.test.json +574 -0
  13. package/common/fastfood.instance.json +1989 -329
  14. package/common/formulas.instance.json +20 -0
  15. package/common/gdefaults.js +6 -6
  16. package/common/help.test.json +16 -4
  17. package/common/helpers.js +1 -1
  18. package/common/kirk.instance.json +20 -0
  19. package/common/length.instance.json +300 -0
  20. package/common/math.instance.json +25 -0
  21. package/common/nameable.instance.json +2 -0
  22. package/common/nameable.js +137 -0
  23. package/common/nameable.test.json +1545 -0
  24. package/common/ordering.instance.json +50 -0
  25. package/common/people.instance.json +165 -0
  26. package/common/pipboy.instance.json +340 -0
  27. package/common/pokemon.instance.json +265 -0
  28. package/common/pressure.instance.json +80 -0
  29. package/common/properties.instance.json +25 -0
  30. package/common/reports.instance.json +41 -1
  31. package/common/spock.instance.json +20 -0
  32. package/common/stm.js +109 -3
  33. package/common/stm.test.json +1702 -1
  34. package/common/temperature.instance.json +192 -0
  35. package/common/ui.instance.json +20 -0
  36. package/common/weight.instance.json +240 -0
  37. package/main.js +6 -0
  38. package/package.json +13 -2
@@ -2,6 +2,7 @@ const { Config, knowledgeModule, where, stableId } = require('./runtime').thepro
2
2
  const meta = require('./meta.js')
3
3
  const gdefaults = require('./gdefaults.js')
4
4
  const sdefaults = require('./sdefaults.js')
5
+ const articles = require('./articles.js')
5
6
  const pos = require('./pos.js')
6
7
  const negation = require('./negation.js')
7
8
  const punctuation = require('./punctuation.js')
@@ -50,15 +51,15 @@ let configStruct = {
50
51
  { pattern: "([nevermindTestSetup] (allowed))", development: true },
51
52
  "([why])",
52
53
  "([reason])",
53
- "([thisitthat|])",
54
- "([it])",
55
- "([this])",
56
- "([that])",
54
+ // "([thisitthat|])",
55
+ // "([it])",
56
+ // "([this])",
57
+ // "([that])",
57
58
 
58
59
  "(<what> ([whatAble|]))",
59
60
  "([what:optional])",
60
- "(<the|> ([theAble|]))",
61
- "(<a|a,an> ([theAble|]))",
61
+ // "(<the|> ([theAble|]))",
62
+ // "(<a|a,an> ([theAble|]))",
62
63
  // "([unknown])",
63
64
 
64
65
  "([be] ([briefOrWordy|]))",
@@ -177,7 +178,7 @@ let configStruct = {
177
178
  { id: "canBeQuestion", level: 1, bridge: "{ ...next(operator) }" },
178
179
  // { id: "unknown", level: 0, bridge: "{ ...next(operator), unknown: true, dead: true }" },
179
180
  // { id: "unknown", level: 1, bridge: "{ ...next(operator) }" },
180
- { id: "queryable", level: 0, bridge: "{ ...next(operator) }" },
181
+ // { id: "queryable", level: 0, bridge: "{ ...next(operator) }" },
181
182
  { id: "questionMark", level: 0, bridge: "{ ...before[0], query: [before.marker] }" },
182
183
  // { id: "isEd", level: 0, bridge: "{ ...context, query: true }" },
183
184
  // gregbug
@@ -206,6 +207,7 @@ let configStruct = {
206
207
  { id: "doesAble", level: 1, bridge: "{ ...next(operator), before: before[0] }" },
207
208
  { id: "does", level: 0, bridge: "{ query: true, what: operator.marker, ...context, number: operator.number, object.number: operator.number }*" },
208
209
 
210
+ /*
209
211
  {
210
212
  id: 'the',
211
213
  level: 0,
@@ -217,13 +219,17 @@ let configStruct = {
217
219
  // bridge: "{ ...after[0], pullFromContext: false, instance: true, concept: true, number: 'one', wantsValue: true, determiner: operator, modifiers: append(['determiner'], after[0].modifiers) }"
218
220
  bridge: "{ ...after[0], pullFromContext: false, concept: true, number: 'one', wantsValue: true, determiner: operator, modifiers: append(['determiner'], after[0].modifiers) }"
219
221
  },
222
+ */
223
+ /*
220
224
  {
221
225
  id: "theAble",
222
226
  children: ['noun'],
223
227
  bridge: "{ ...next(operator) }"
224
228
  },
229
+ */
225
230
 
226
231
  // TODO make this hierarchy thing work
232
+ /*
227
233
  {
228
234
  id: "thisitthat",
229
235
  level: 0,
@@ -231,6 +237,7 @@ let configStruct = {
231
237
  before: ['verby'],
232
238
  bridge: "{ ...next(operator) }"
233
239
  },
240
+ */
234
241
  {
235
242
  id: "nevermind",
236
243
  bridge: "{ ...next(operator) }",
@@ -279,6 +286,7 @@ let configStruct = {
279
286
  isA: ['theAble', 'queryable'],
280
287
  bridge: "{ ...next(operator) }"
281
288
  },
289
+ /*
282
290
  {
283
291
  id: "it",
284
292
  level: 0,
@@ -297,11 +305,12 @@ let configStruct = {
297
305
  isA: ['thisitthat'],
298
306
  bridge: "{ ...next(operator), unknown: true, pullFromContext: true }"
299
307
  },
308
+ */
300
309
  ],
301
310
  words: {
302
311
  "literals": {
303
312
  "?": [{"id": "questionMark", "initial": "{}" }],
304
- "the": [{"id": "the", "initial": "{ modifiers: [] }" }],
313
+ // "the": [{"id": "the", "initial": "{ modifiers: [] }" }],
305
314
  "who": [{"id": "what", "initial": "{ modifiers: [], query: true }" }],
306
315
  "yes": [{"id": "yesno", "initial": "{ value: true }" }],
307
316
  "no": [{"id": "yesno", "initial": "{ value: false }" }],
@@ -598,99 +607,54 @@ let configStruct = {
598
607
  context.isResponse = true
599
608
  }
600
609
  },
601
- {
602
- where: where(),
603
- notes: 'pull from context',
604
- // match: ({context}) => context.marker == 'it' && context.pullFromContext, // && context.value,
605
- match: ({context, callId}) => context.pullFromContext && !context.same, // && context.value,
606
- apply: async ({callId, context, kms, e, log, retry}) => {
607
- if (true) {
608
- /*
609
- {
610
- "marker": "unknown",
611
- "range": {
612
- "start": 65,
613
- "end": 73
614
- },
615
- "word": "worth",
616
- "text": "the worth",
617
- "value": "worth",
618
- "unknown": true,
619
- "types": [
620
- "unknown"
621
- ],
622
- "pullFromContext": true,
623
- "concept": true,
624
- "wantsValue": true,
625
- "determiner": "the",
626
- "modifiers": [
627
- "determiner"
628
- ],
629
- "evaluate": true
630
- }
631
-
632
- */
633
- context.value = kms.stm.api.mentions(context)
634
- if (!context.value) {
635
- // retry()
636
- context.value = { marker: 'answerNotKnown' }
637
- return
638
- }
639
-
640
- const instance = await e(context.value)
641
- if (instance.evalue && !instance.edefault) {
642
- context.value = instance.evalue
643
- }
644
- if (context.evaluate) {
645
- context.evalue = context.value
646
- }
647
- } else {
648
- /*
649
- {
650
- "marker": "unknown",
651
- "range": {
652
- "start": 24,
653
- "end": 32
654
- },
655
- "word": "price",
656
- "text": "the price",
657
- "value": "price",
658
- "unknown": true,
659
- "types": [
660
- "unknown"
661
- ],
662
- "pullFromContext": true,
663
- "concept": true,
664
- "wantsValue": true,
665
- "determiner": "the",
666
- "modifiers": [
667
- "determiner"
668
- ],
669
- "evaluate": true
670
- }
671
-
672
- */
673
- context.value = kms.stm.api.mentions(context)
674
- if (!context.value) {
675
- // retry()
676
- context.value = { marker: 'answerNotKnown' }
677
- return
678
- }
679
- // avoid loops
680
- if (context.marker != 'unknown') {
681
- if (context.value.marker != context.marker) {
682
- const instance = await e(context.value)
683
- if (instance.evalue && !instance.edefault) {
684
- context.value = instance.evalue
685
- }
686
- }
687
- }
688
- if (context.evaluate) {
689
- context.evalue = context.value
690
- }
691
- }
692
- },
693
- },
610
+ // {
611
+ // where: where(),
612
+ // notes: 'pull from context',
613
+ // // match: ({context}) => context.marker == 'it' && context.pullFromContext, // && context.value,
614
+ // match: ({context, callId}) => false && context.pullFromContext && !context.same, // && context.value,
615
+ // apply: async ({callId, context, kms, e, log, retry}) => {
616
+ // if (true) {
617
+ // /*
618
+ // {
619
+ // "marker": "unknown",
620
+ // "range": {
621
+ // "start": 65,
622
+ // "end": 73
623
+ // },
624
+ // "word": "worth",
625
+ // "text": "the worth",
626
+ // "value": "worth",
627
+ // "unknown": true,
628
+ // "types": [
629
+ // "unknown"
630
+ // ],
631
+ // "pullFromContext": true,
632
+ // "concept": true,
633
+ // "wantsValue": true,
634
+ // "determiner": "the",
635
+ // "modifiers": [
636
+ // "determiner"
637
+ // ],
638
+ // "evaluate": true
639
+ // }
640
+
641
+ // */
642
+ // context.value = kms.stm.api.mentions(context)
643
+ // if (!context.value) {
644
+ // // retry()
645
+ // context.value = { marker: 'answerNotKnown' }
646
+ // return
647
+ // }
648
+ //
649
+ // const instance = await e(context.value)
650
+ // if (instance.evalue && !instance.edefault) {
651
+ // context.value = instance.evalue
652
+ // }
653
+ // if (context.evaluate) {
654
+ // context.evalue = context.value
655
+ // }
656
+ // },
657
+ // },
694
658
  {
695
659
  where: where(),
696
660
  notes: 'what x is y?',
@@ -937,7 +901,7 @@ const createConfig = async () => {
937
901
  const config = new Config(configStruct, module)
938
902
  config.stop_auto_rebuild()
939
903
  await config.setApi(api)
940
- await config.add(gdefaults, sdefaults, pos, negation, stm, meta, punctuation)
904
+ await config.add(articles, gdefaults, sdefaults, pos, negation, stm, meta, punctuation)
941
905
  await config.initializer( ({objects, config, isModule}) => {
942
906
  /* TODO add this beck in. some stuff from config needs to be here
943
907
  config.addArgs((args) => ({
@@ -188,6 +188,11 @@
188
188
  "queryable",
189
189
  false
190
190
  ],
191
+ [
192
+ "evaluate",
193
+ "verby",
194
+ false
195
+ ],
191
196
  [
192
197
  "expression",
193
198
  "expression",
@@ -428,6 +433,11 @@
428
433
  "theAble",
429
434
  false
430
435
  ],
436
+ [
437
+ "memorable",
438
+ "theAble",
439
+ false
440
+ ],
431
441
  [
432
442
  "minusExpression",
433
443
  "mathematicalExpression",
@@ -593,6 +603,16 @@
593
603
  "theAble",
594
604
  false
595
605
  ],
606
+ [
607
+ "remember",
608
+ "verby",
609
+ false
610
+ ],
611
+ [
612
+ "stm_before",
613
+ "adjective",
614
+ false
615
+ ],
596
616
  [
597
617
  "that",
598
618
  "thisitthat",