ekms 9.6.3 → 9.7.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 (84) hide show
  1. package/common/actions.instance.json +2771 -15
  2. package/common/actions.js +116 -8
  3. package/common/actions.test.json +79138 -384
  4. package/common/angle.instance.json +138 -834
  5. package/common/angle.test.json +172 -127
  6. package/common/animals.instance.json +260 -0
  7. package/common/articles.js +1 -2
  8. package/common/avatar.test.json +173 -33
  9. package/common/can.instance.json +40 -0
  10. package/common/colors.instance.json +308 -0
  11. package/common/comparable.instance.json +120 -0
  12. package/common/compass.instance.json +63 -18
  13. package/common/concept.js +2 -1
  14. package/common/conjunction.js +11 -17
  15. package/common/control.js +42 -0
  16. package/common/control.test.json +2 -0
  17. package/common/crew.instance.json +520 -0
  18. package/common/dates.instance.json +184 -0
  19. package/common/dialogues.js +3 -3
  20. package/common/dimension.instance.json +264 -69
  21. package/common/dimension.js +5 -5
  22. package/common/dimension.test.json +545 -441
  23. package/common/drone.instance.json +15927 -2638
  24. package/common/drone.js +359 -71
  25. package/common/drone.test.json +587651 -44132
  26. package/common/drone_v1.instance.json +492 -59
  27. package/common/drone_v1.js +9 -9
  28. package/common/edible.instance.json +696 -0
  29. package/common/emotions.instance.json +20 -0
  30. package/common/evaluate.js +1 -1
  31. package/common/fastfood.instance.json +1310 -216
  32. package/common/fastfood.js +1 -1
  33. package/common/formulas.instance.json +20 -5
  34. package/common/formulas.js +1 -1
  35. package/common/gdefaults.js +32 -5
  36. package/common/help.test.json +23 -3
  37. package/common/helpers/conjunction.js +2 -0
  38. package/common/helpers/formulas.js +6 -0
  39. package/common/helpers/properties.js +9 -7
  40. package/common/helpers.js +11 -6
  41. package/common/hierarchy.js +2 -0
  42. package/common/kirk.instance.json +20 -0
  43. package/common/length.instance.json +1117 -5708
  44. package/common/length.test.json +29761 -12488
  45. package/common/logging.js +41 -0
  46. package/common/logging.test.json +2 -0
  47. package/common/math.instance.json +30 -12
  48. package/common/math.js +6 -5
  49. package/common/menus.instance.json +140 -35
  50. package/common/meta.js +1 -1
  51. package/common/nameable.js +7 -9
  52. package/common/nameable.test.json +252 -150
  53. package/common/ordering.instance.json +40 -0
  54. package/common/ordinals.js +51 -5
  55. package/common/people.instance.json +160 -0
  56. package/common/pipboy.instance.json +396 -85
  57. package/common/pipboy.js +1 -1
  58. package/common/pokemon.instance.json +260 -0
  59. package/common/pressure.instance.json +108 -370
  60. package/common/properties.instance.json +20 -0
  61. package/common/properties.js +5 -4
  62. package/common/properties.test.json +2754 -2142
  63. package/common/rates.instance.json +1 -1
  64. package/common/rates.js +3 -3
  65. package/common/rates.test.json +6914 -2428
  66. package/common/reminders.js +1 -1
  67. package/common/reports.instance.json +49 -176
  68. package/common/reports.js +2 -2
  69. package/common/scorekeeper.js +1 -1
  70. package/common/sdefaults.js +18 -5
  71. package/common/spock.instance.json +20 -0
  72. package/common/stm.js +115 -53
  73. package/common/stm.test.json +2670 -54
  74. package/common/temperature.instance.json +709 -2284
  75. package/common/time.instance.json +14333 -2220
  76. package/common/time.js +48 -2
  77. package/common/time.test.json +13239 -0
  78. package/common/tokenize.js +2 -0
  79. package/common/ui.instance.json +20 -5
  80. package/common/ui.js +1 -1
  81. package/common/weight.instance.json +621 -1886
  82. package/common/wp.instance.json +336 -70
  83. package/main.js +4 -0
  84. package/package.json +11 -5
@@ -893,7 +893,7 @@ class State {
893
893
  }
894
894
 
895
895
  this.api.add(item)
896
- this.api.args.mentioned({ context: food })
896
+ this.api.args.remember({ context: food })
897
897
 
898
898
  for (const addIt of addsInsteadOfModifications) {
899
899
  this.add(addIt)
@@ -257,6 +257,16 @@
257
257
  "hierarchyAble",
258
258
  false
259
259
  ],
260
+ [
261
+ "deletable",
262
+ "deletable",
263
+ false
264
+ ],
265
+ [
266
+ "delete",
267
+ "verb",
268
+ false
269
+ ],
260
270
  [
261
271
  "descending",
262
272
  "hierarchyAble",
@@ -547,11 +557,6 @@
547
557
  "concept",
548
558
  false
549
559
  ],
550
- [
551
- "mathematicalExpression",
552
- "number",
553
- false
554
- ],
555
560
  [
556
561
  "mathematical_operator",
557
562
  "adjective",
@@ -647,6 +652,11 @@
647
652
  "thisAble",
648
653
  false
649
654
  ],
655
+ [
656
+ "memorable",
657
+ "deletable",
658
+ false
659
+ ],
650
660
  [
651
661
  "memorable",
652
662
  "theAble",
@@ -917,6 +927,11 @@
917
927
  "theAble",
918
928
  false
919
929
  ],
930
+ [
931
+ "recall",
932
+ "verb",
933
+ false
934
+ ],
920
935
  [
921
936
  "remember",
922
937
  "verb",
@@ -1,4 +1,4 @@
1
- const { knowledgeModule, where, Digraph } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where, Digraph, debug } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const dialogues = require('./dialogues.js')
4
4
  const pos = require('./pos.js')
@@ -272,6 +272,12 @@ const config = {
272
272
  apply: ({context}) => context.word,
273
273
  },
274
274
 
275
+ {
276
+ where: where(),
277
+ match: ({context}) => context.marker == 'answerNotKnown',
278
+ apply: ({context}) => 'That is not known',
279
+ },
280
+
275
281
  {
276
282
  where: where(),
277
283
  match: ({context}) => context.marker != null,
@@ -319,6 +325,7 @@ function initializer({config}) {
319
325
  if (Array.isArray(interpolate)) {
320
326
  const strings = []
321
327
  let separator = ''
328
+ const byPosition = []
322
329
  for (const element of interpolate) {
323
330
  // { "word": { "marker": "canPassive" } ie { word: <selectionCriteria> }
324
331
  if (element.word) {
@@ -363,13 +370,30 @@ function initializer({config}) {
363
370
  if (element.context) {
364
371
  value = { ...value, ...element.context }
365
372
  }
366
- strings.push(separator)
367
- if (Array.isArray(value)) {
368
- strings.push(await args.gsp(value))
373
+ async function handleProperty(value) {
374
+ strings.push(separator)
375
+ if (Array.isArray(value)) {
376
+ strings.push(await args.gsp(value))
377
+ } else {
378
+ strings.push(await args.gp(value))
379
+ }
380
+ separator = ' '
381
+ }
382
+ if (element.byPosition) {
383
+ const element = { start: value.range.start, insert: ((value) => () => handleProperty(value))(value) }
384
+ if (byPosition.length == 0) {
385
+ byPosition.push(element)
386
+ } else {
387
+ const index = byPosition.findIndex((element) => element.start < value.range.start)
388
+ if (index == -1) {
389
+ byPosition.unshift(element)
390
+ } else {
391
+ byPosition.splice(index+1, 0, element)
392
+ }
393
+ }
369
394
  } else {
370
- strings.push(await args.gp(value))
395
+ await handleProperty(value)
371
396
  }
372
- separator = ' '
373
397
  }
374
398
  } else if (element.context) {
375
399
  let value = element.context
@@ -390,6 +414,9 @@ function initializer({config}) {
390
414
  }
391
415
  }
392
416
  }
417
+ for (const { insert } of byPosition) {
418
+ await insert()
419
+ }
393
420
  return strings.join('')
394
421
  } else {
395
422
  return await helpers.processTemplateString(interpolate, evaluator)
@@ -237,10 +237,12 @@
237
237
  "articles": "articles2",
238
238
  "asking": "asking2",
239
239
  "conjunction": "conjunction2",
240
+ "control": "control2",
240
241
  "dialogues": "dialogues2",
241
242
  "evaluate": "evaluate2",
242
243
  "gdefaults": "gdefaults2",
243
244
  "help": "help1",
245
+ "logging": "logging2",
244
246
  "meta": "meta2",
245
247
  "negation": "negation2",
246
248
  "pos": "pos2",
@@ -260,6 +262,9 @@
260
262
  "conjunction2": {
261
263
  "km": "conjunction2"
262
264
  },
265
+ "control2": {
266
+ "km": "control2"
267
+ },
263
268
  "dialogues2": {
264
269
  "idSuffix": "",
265
270
  "km": "dialogues2",
@@ -277,6 +282,11 @@
277
282
  "help1": {
278
283
  "km": "help1"
279
284
  },
285
+ "logging2": {
286
+ "km": "logging2",
287
+ "messages": [
288
+ ]
289
+ },
280
290
  "meta2": {
281
291
  "km": "meta2"
282
292
  },
@@ -673,7 +683,7 @@
673
683
  }
674
684
  ],
675
685
  "generatedParenthesized": [
676
- "( 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 setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n NAME: asking\n DESCRIPTION: asking the user questions\n\n SAMPLE SENTENCES\n\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n whichOnesTestSetup apple banana pear\\npear\n whichOnesTestSetup apple banana pear\\ngoat\n whichOnesTestSetup apple banana pear\\nnevermind\n whichOnesTestSetup apple banana pear\\napple and pear\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\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: conjunction\n DESCRIPTION: framework for conjunction\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n\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: 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 every distributable\n each distributable\n this theable\n this\n this thisable\n that thisable\n that\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n)"
686
+ "( 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 setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n NAME: asking\n DESCRIPTION: asking the user questions\n\n SAMPLE SENTENCES\n\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n whichOnesTestSetup apple banana pear\\npear\n whichOnesTestSetup apple banana pear\\ngoat\n whichOnesTestSetup apple banana pear\\nnevermind\n whichOnesTestSetup apple banana pear\\napple and pear\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\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: conjunction\n DESCRIPTION: framework for conjunction\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n\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 delete deletable\n remember m1\\ndelete m1\n remember m1\\nrecall m1\n recall m1\n remember m1\\ndelete m1\\nrecall m1\n remember m1\\nforget m1\\nrecall m1\n\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 every distributable\n each distributable\n this theable\n this\n this thisable\n that thisable\n that\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n\n)"
677
687
  ],
678
688
  "metadata": {
679
689
  "opChoices": [
@@ -699,10 +709,12 @@
699
709
  "articles": "articles2",
700
710
  "asking": "asking2",
701
711
  "conjunction": "conjunction2",
712
+ "control": "control2",
702
713
  "dialogues": "dialogues2",
703
714
  "evaluate": "evaluate2",
704
715
  "gdefaults": "gdefaults2",
705
716
  "help": "help1",
717
+ "logging": "logging2",
706
718
  "meta": "meta2",
707
719
  "negation": "negation2",
708
720
  "pos": "pos2",
@@ -722,6 +734,9 @@
722
734
  "conjunction2": {
723
735
  "km": "conjunction2"
724
736
  },
737
+ "control2": {
738
+ "km": "control2"
739
+ },
725
740
  "dialogues2": {
726
741
  "idSuffix": "",
727
742
  "km": "dialogues2",
@@ -739,6 +754,11 @@
739
754
  "help1": {
740
755
  "km": "help1"
741
756
  },
757
+ "logging2": {
758
+ "km": "logging2",
759
+ "messages": [
760
+ ]
761
+ },
742
762
  "meta2": {
743
763
  "km": "meta2"
744
764
  },
@@ -798,7 +818,7 @@
798
818
  "paraphrasesParenthesized": [
799
819
  ],
800
820
  "responses": [
801
- " 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 setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n NAME: asking\n DESCRIPTION: asking the user questions\n\n SAMPLE SENTENCES\n\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n whichOnesTestSetup apple banana pear\\npear\n whichOnesTestSetup apple banana pear\\ngoat\n whichOnesTestSetup apple banana pear\\nnevermind\n whichOnesTestSetup apple banana pear\\napple and pear\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\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: conjunction\n DESCRIPTION: framework for conjunction\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n\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: 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 every distributable\n each distributable\n this theable\n this\n this thisable\n that thisable\n that\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n"
821
+ " 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 setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n NAME: asking\n DESCRIPTION: asking the user questions\n\n SAMPLE SENTENCES\n\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n whichOnesTestSetup apple banana pear\\npear\n whichOnesTestSetup apple banana pear\\ngoat\n whichOnesTestSetup apple banana pear\\nnevermind\n whichOnesTestSetup apple banana pear\\napple and pear\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\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: conjunction\n DESCRIPTION: framework for conjunction\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n\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 delete deletable\n remember m1\\ndelete m1\n remember m1\\nrecall m1\n recall m1\n remember m1\\ndelete m1\\nrecall m1\n remember m1\\nforget m1\\nrecall m1\n\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 every distributable\n each distributable\n this theable\n this\n this thisable\n that thisable\n that\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n\n"
802
822
  ]
803
823
  }
804
824
  ]
@@ -811,7 +831,7 @@
811
831
  ],
812
832
  "query": "help",
813
833
  "responses": [
814
- " 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 setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n NAME: asking\n DESCRIPTION: asking the user questions\n\n SAMPLE SENTENCES\n\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n whichOnesTestSetup apple banana pear\\npear\n whichOnesTestSetup apple banana pear\\ngoat\n whichOnesTestSetup apple banana pear\\nnevermind\n whichOnesTestSetup apple banana pear\\napple and pear\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\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: conjunction\n DESCRIPTION: framework for conjunction\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n\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: 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 every distributable\n each distributable\n this theable\n this\n this thisable\n that thisable\n that\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n"
834
+ " 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 setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n NAME: asking\n DESCRIPTION: asking the user questions\n\n SAMPLE SENTENCES\n\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n whichOnesTestSetup apple banana pear\\npear\n whichOnesTestSetup apple banana pear\\ngoat\n whichOnesTestSetup apple banana pear\\nnevermind\n whichOnesTestSetup apple banana pear\\napple and pear\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\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: conjunction\n DESCRIPTION: framework for conjunction\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n\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 delete deletable\n remember m1\\ndelete m1\n remember m1\\nrecall m1\n recall m1\n remember m1\\ndelete m1\\nrecall m1\n remember m1\\nforget m1\\nrecall m1\n\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 every distributable\n each distributable\n this theable\n this\n this thisable\n that thisable\n that\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n\n"
815
835
  ],
816
836
  "summaries": [
817
837
  {
@@ -5,6 +5,7 @@ function asList(context, maybe=false) {
5
5
  return {
6
6
  marker: 'list',
7
7
  // types: [context.marker],
8
+ listable: true,
8
9
  value: context
9
10
  }
10
11
  } else if (context.marker === 'list') {
@@ -15,6 +16,7 @@ function asList(context, maybe=false) {
15
16
  } else {
16
17
  return {
17
18
  marker: 'list',
19
+ listable: true,
18
20
  types: [context.marker],
19
21
  value: [context]
20
22
  }
@@ -97,6 +97,7 @@ class API {
97
97
  }
98
98
 
99
99
  gets(name) {
100
+ // debugger
100
101
  if (!this._objects.formulas[name.value]) {
101
102
  return []
102
103
  }
@@ -131,6 +132,11 @@ class API {
131
132
 
132
133
  // currently only supportings x = f(x) type formulas
133
134
  add(name, formula, equality) {
135
+ /*
136
+ if (name.value == 'minute' || name.value == 'minutes') {
137
+ debugger
138
+ }
139
+ */ // greg66
134
140
  if (!this._objects.formulas[name.value]) {
135
141
  this._objects.formulas[name.value] = []
136
142
  }
@@ -170,7 +170,7 @@ class API {
170
170
  }
171
171
  const selected = instance.evalue.value.map( (r) => r[property] )
172
172
  context.constraints = undefined;
173
- context.evalue = { marker: 'list', value: selected }
173
+ context.evalue = { marker: 'list', listable: true, value: selected }
174
174
  },
175
175
  })
176
176
  config.addGenerator({
@@ -575,9 +575,9 @@ class API {
575
575
  const response = _.clone(context)
576
576
  response.isResponse = true
577
577
  response.query = undefined
578
- context.evalue = { marker: 'list', value: [response] }
578
+ context.evalue = { marker: 'list', listable: true, value: [response] }
579
579
  } else {
580
- context.evalue = { marker: 'list', value: unflatten(matches) }
580
+ context.evalue = { marker: 'list', listable: true, value: unflatten(matches) }
581
581
  context.evalue.isResponse = true
582
582
  }
583
583
  context.evalue.truthValue = matches.length > 0
@@ -588,8 +588,8 @@ class API {
588
588
  }
589
589
 
590
590
  // ADD this line back and remove it to check
591
- // context.response = { marker: 'list', value: [response], isResponse: true }
592
- // Object.assign(context, { marker: 'list', value: responses, focusable: ['value'], paraphrase: true, truthValue: matches.length > 0 })
591
+ // context.response = { marker: 'list', listable: true, value: [response], isResponse: true }
592
+ // Object.assign(context, { marker: 'list', listable: true, value: responses, focusable: ['value'], paraphrase: true, truthValue: matches.length > 0 })
593
593
  } else {
594
594
  // see if anything is preferred greg
595
595
  // what does greg like
@@ -598,7 +598,7 @@ class API {
598
598
  // Object.assign(context, { marker: 'idontknow', query: _.clone(context) })
599
599
  context.evalue = { marker: 'idontknow', query: _.clone(context), isResponse: true }
600
600
  } else {
601
- context.evalue = { marker: 'list', value: matches, isResponse: true }
601
+ context.evalue = { marker: 'list', listable: true, value: matches, isResponse: true }
602
602
  }
603
603
  context.isResponse = true
604
604
  context.evalue.truthValue = matches.length > 0 && matches[0].marker == ordering.marker
@@ -641,12 +641,14 @@ class API {
641
641
  const api = km('properties').api
642
642
  context.evalue = {
643
643
  marker: 'list',
644
+ listable: true,
644
645
  value: unflatten(api.relation_get(context, before.concat(after).map( (arg) => arg.tag ) ))
645
646
  }
646
647
  context.evalue.isResponse = true
647
648
  context.isResponse = true
648
649
  if (context.evalue.value.length == 0) {
649
650
  context.evalue.marker = 'answerNotKnown';
651
+ context.evalue.listable = true
650
652
  context.evalue.value = [];
651
653
  } else {
652
654
  // context.evalue.truthValue = true
@@ -815,7 +817,7 @@ class API {
815
817
  values.push(`${await g(key)}: ${await g({ ...objectProps[key].value, paraphrase: true })}`)
816
818
  }
817
819
  }
818
- return { marker: 'list', value: values }
820
+ return { marker: 'list', listable: true, value: values }
819
821
  } else {
820
822
  return (await this.propertiesFH.getValue([object, property])).value
821
823
  }
package/common/helpers.js CHANGED
@@ -161,12 +161,15 @@ function focus(context) {
161
161
  // fromList
162
162
  function propertyToArray(value) {
163
163
  if (Array.isArray(value)) {
164
- return value
165
- } else if (value.marker == 'list') {
166
- return value.value
167
- } else {
168
- return [value]
164
+ return value;
165
+ }
166
+
167
+ if (value?.listable || value?.marker == 'list') {
168
+ return value.value.flatMap(item => propertyToArray(item));
169
169
  }
170
+
171
+ // Single value → wrap in array
172
+ return [value];
170
173
  }
171
174
 
172
175
  // values is marker: 'list' or some context
@@ -181,6 +184,7 @@ function concats(values) {
181
184
  }
182
185
  return {
183
186
  marker: 'list',
187
+ listable: true,
184
188
  value: combined
185
189
  }
186
190
  }
@@ -223,7 +227,7 @@ function defaultObjectCheck(extra = []) {
223
227
  }
224
228
  }
225
229
 
226
- function defaultContextCheckProperties(extra) {
230
+ function defaultContextCheckProperties(extra = []) {
227
231
  return ['marker', 'text', 'verbatim', 'value', 'evalue', 'isResponse', { properties: 'modifiers' }, { properties: 'postModifiers' }, ...extra]
228
232
  }
229
233
 
@@ -232,6 +236,7 @@ function defaultContextCheck({marker, extra = [], exported = false} = {}) {
232
236
  if (marker) {
233
237
  match = ({context}) => context.marker == marker
234
238
  } else {
239
+ match = () => true
235
240
  }
236
241
  return {
237
242
  marker,
@@ -24,6 +24,7 @@ function getTypes( km, digraph, concept, instance ) {
24
24
  instance = {
25
25
  marker: 'list',
26
26
  value: words,
27
+ listable: true,
27
28
  paraphrase: true,
28
29
  }
29
30
  instance.focus = true
@@ -278,6 +279,7 @@ const config = {
278
279
  const values = children.map( (t) => conceptApi.getWordForValue(t, { number: isA(type, 'concept') ? 'one' : 'many'}))
279
280
  context.evalue = {
280
281
  marker: 'list',
282
+ listable: true,
281
283
  value: values,
282
284
  }
283
285
  if (children.length > 1) {
@@ -395,6 +395,16 @@
395
395
  "theAble",
396
396
  false
397
397
  ],
398
+ [
399
+ "deletable",
400
+ "deletable",
401
+ false
402
+ ],
403
+ [
404
+ "delete",
405
+ "verb",
406
+ false
407
+ ],
398
408
  [
399
409
  "distributable",
400
410
  "queryable",
@@ -965,6 +975,11 @@
965
975
  "adjective",
966
976
  false
967
977
  ],
978
+ [
979
+ "memorable",
980
+ "deletable",
981
+ false
982
+ ],
968
983
  [
969
984
  "memorable",
970
985
  "theAble",
@@ -1415,6 +1430,11 @@
1415
1430
  "theAble",
1416
1431
  false
1417
1432
  ],
1433
+ [
1434
+ "recall",
1435
+ "verb",
1436
+ false
1437
+ ],
1418
1438
  [
1419
1439
  "remember",
1420
1440
  "verb",