tpmkms 9.7.1-beta.11 → 9.7.1-beta.13

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 (38) hide show
  1. package/common/actions.instance.json +11 -1
  2. package/common/actions.js +1 -1
  3. package/common/angle.instance.json +27 -0
  4. package/common/articles.js +38 -4
  5. package/common/can.instance.json +1 -1
  6. package/common/comparable.instance.json +12 -6
  7. package/common/conjunction.js +2 -2
  8. package/common/countable.js +39 -5
  9. package/common/crew.instance.json +1005 -158
  10. package/common/crew.js +3 -3
  11. package/common/dialogues.js +3 -4
  12. package/common/dimension.instance.json +136 -10
  13. package/common/dimension.js +5 -5
  14. package/common/drone.instance.json +406 -369
  15. package/common/drone.js +38 -8
  16. package/common/drone_v1.instance.json +105 -0
  17. package/common/edible.instance.json +72 -0
  18. package/common/emotions.instance.json +143 -4
  19. package/common/fastfood.instance.json +456 -313
  20. package/common/fastfood.js +7 -0
  21. package/common/gdefaults.js +12 -121
  22. package/common/hierarchy.js +0 -1
  23. package/common/length.instance.json +27 -0
  24. package/common/ordering.instance.json +2 -1
  25. package/common/ordinals.js +9 -3
  26. package/common/pipboy.instance.json +2 -2
  27. package/common/pipboy.js +3 -3
  28. package/common/pressure.instance.json +27 -0
  29. package/common/properties.instance.json +322 -37
  30. package/common/properties.js +38 -31
  31. package/common/reports.instance.json +5 -3
  32. package/common/stm.js +15 -9
  33. package/common/temperature.instance.json +27 -0
  34. package/common/time.instance.json +167 -0
  35. package/common/weight.instance.json +27 -0
  36. package/common/wp.instance.json +21 -21
  37. package/common/wp.js +62 -10
  38. package/package.json +2 -2
@@ -166,7 +166,7 @@
166
166
  },
167
167
  "semantics": [
168
168
  {
169
- "match": "({context, isA}) => !context.pullFromContext && (isA(context.marker, 'action') || isA(context.marker, 'doAction'))",
169
+ "match": "({context, isA, stack, namespaced}) => !context.pullFromContext && !context.evaluate && (isA(context.marker, 'action') || isA(context.marker, 'doAction')) && !namespaced.get('actions', context, 'logged')",
170
170
  "apply": "async ({context, _continue, testLog, g, remember}) => {\n remember(context)\n await testLog(() => g(context))\n _continue()\n }"
171
171
  }
172
172
  ]
@@ -397,6 +397,11 @@
397
397
  "adjective",
398
398
  false
399
399
  ],
400
+ [
401
+ "ageMarker",
402
+ "propertyMarker",
403
+ false
404
+ ],
400
405
  [
401
406
  "all",
402
407
  "quantifier",
@@ -2102,6 +2107,11 @@
2102
2107
  "thisAble",
2103
2108
  false
2104
2109
  ],
2110
+ [
2111
+ "propertyMarker",
2112
+ "propertyMarker",
2113
+ false
2114
+ ],
2105
2115
  [
2106
2116
  "propertyOf",
2107
2117
  "preposition",
package/common/actions.js CHANGED
@@ -147,7 +147,7 @@ const config = {
147
147
  {
148
148
  where: where(),
149
149
  priority: -1,
150
- match: ({context, isA}) => !context.pullFromContext && (isA(context.marker, 'action') || isA(context.marker, 'doAction')),
150
+ match: ({context, isA, stack, namespaced}) => !context.pullFromContext && !context.evaluate && (isA(context.marker, 'action') || isA(context.marker, 'doAction')) && !namespaced.get('actions', context, 'logged'),
151
151
  apply: async ({context, _continue, testLog, g, remember}) => {
152
152
  remember(context)
153
153
  await testLog(() => g(context))
@@ -4420,6 +4420,33 @@
4420
4420
  "unit"
4421
4421
  ],
4422
4422
  "propertyOf": true,
4423
+ "interpolate": [
4424
+ {
4425
+ "property": "property"
4426
+ },
4427
+ {
4428
+ "word": "of"
4429
+ },
4430
+ {
4431
+ "property": "object"
4432
+ }
4433
+ ],
4434
+ "property": {
4435
+ "value": "unit",
4436
+ "number": "many",
4437
+ "text": "units",
4438
+ "marker": "unit",
4439
+ "dead": true,
4440
+ "word": "units",
4441
+ "range": {
4442
+ "start": 24,
4443
+ "end": 28
4444
+ },
4445
+ "types": [
4446
+ "unit"
4447
+ ],
4448
+ "level": 0
4449
+ },
4423
4450
  "object": {
4424
4451
  "value": "angle",
4425
4452
  "number": "one",
@@ -1,7 +1,7 @@
1
1
  const { knowledgeModule, where, stableId, debug } = require('./runtime').theprogrammablemind
2
2
  const gdefaults = require('./gdefaults.js')
3
3
  const pos = require('./pos.js')
4
- const { defaultContextCheck } = require('./helpers')
4
+ const { defaultContextCheckProperties, defaultContextCheck } = require('./helpers')
5
5
  const tests = require('./articles.test.json')
6
6
 
7
7
  const config = {
@@ -32,12 +32,34 @@ const config = {
32
32
  {
33
33
  id: 'each',
34
34
  isA: ['article'],
35
- bridge: '{ ...after[0], focusableForPhrase: true, pullFromContext: true, concept: true, wantsValue: true, distributer: operator, modifiers: append(["distributer"], after[0].modifiers)}'
35
+ bridge: `{
36
+ ...after[0],
37
+ focusableForPhrase: true,
38
+ pullFromContext: true,
39
+ concept: true,
40
+ wantsValue: true,
41
+ distributer: operator,
42
+ eachArgument: after[0],
43
+ flatten_ignore: ['eachArgument'],
44
+ interpolate: [ { property: 'distributer' }, { property: 'eachArgument' } ],
45
+ modifiers: append(["distributer"], after[0].modifiers)
46
+ }`
36
47
  },
37
48
  {
38
49
  id: 'every',
39
50
  isA: ['article'],
40
- bridge: '{ ...after[0], focusableForPhrase: true, pullFromContext: true, concept: true, wantsValue: true, distributer: operator, modifiers: append(["distributer"], after[0].modifiers)}'
51
+ bridge: `{
52
+ ...after[0],
53
+ focusableForPhrase: true,
54
+ pullFromContext: true,
55
+ concept: true,
56
+ wantsValue: true,
57
+ distributer: operator,
58
+ everyArgument: after[0],
59
+ flatten_ignore: ['everyArgument'],
60
+ interpolate: [ { property: "distributer" }, { property: 'everyArgument' } ],
61
+ modifiers: append(["distributer"], after[0].modifiers)
62
+ }`
41
63
  },
42
64
  {
43
65
  id: 'distributable',
@@ -46,9 +68,21 @@ const config = {
46
68
  {
47
69
  id: 'the',
48
70
  isA: ['article'],
71
+ check: defaultContextCheckProperties(),
49
72
  localHierarchy: [['unknown', 'theAble']],
50
73
  level: 0,
51
- bridge: '{ ...after[0], focusableForPhrase: true, pullFromContext: true, concept: true, wantsValue: true, determiner: "the", modifiers: append(["determiner"], after[0].modifiers)}'
74
+ bridge: `{
75
+ ...after[0],
76
+ focusableForPhrase: true,
77
+ pullFromContext: true,
78
+ concept: true,
79
+ wantsValue: true,
80
+ checks: append(after[0].checks, ['determiner']),
81
+ determiner: operator,
82
+ theable: after[0],
83
+ flatten_ignore: ['theable'],
84
+ interpolate: [{ property: 'determiner' }, { property: 'theable' }]
85
+ }`
52
86
  },
53
87
  {
54
88
  id: "a",
@@ -708,7 +708,7 @@
708
708
  ""
709
709
  ],
710
710
  "paraphrases": [
711
- "canobject canverbs cansubject"
711
+ "canobject canPassive beCanPassive canverbs byCanPassive cansubject"
712
712
  ],
713
713
  "paraphrasesParenthesized": [],
714
714
  "generatedParenthesized": [],
@@ -2774,7 +2774,8 @@
2774
2774
  "queryable",
2775
2775
  "unknown"
2776
2776
  ],
2777
- "level": 0
2777
+ "level": 0,
2778
+ "evaluate": false
2778
2779
  },
2779
2780
  "two": {
2780
2781
  "value": "concepts",
@@ -3493,7 +3494,8 @@
3493
3494
  "queryable",
3494
3495
  "unknown"
3495
3496
  ],
3496
- "level": 0
3497
+ "level": 0,
3498
+ "evaluate": false
3497
3499
  },
3498
3500
  "two": {
3499
3501
  "value": "condition",
@@ -4528,7 +4530,8 @@
4528
4530
  "types": [
4529
4531
  "unknown"
4530
4532
  ],
4531
- "level": 0
4533
+ "level": 0,
4534
+ "evaluate": false
4532
4535
  },
4533
4536
  {
4534
4537
  "value": "lowest",
@@ -4559,7 +4562,8 @@
4559
4562
  "types": [
4560
4563
  "unknown"
4561
4564
  ],
4562
- "level": 0
4565
+ "level": 0,
4566
+ "evaluate": false
4563
4567
  },
4564
4568
  {
4565
4569
  "value": "maximum",
@@ -4575,7 +4579,8 @@
4575
4579
  "types": [
4576
4580
  "unknown"
4577
4581
  ],
4578
- "level": 0
4582
+ "level": 0,
4583
+ "evaluate": false
4579
4584
  },
4580
4585
  {
4581
4586
  "value": "minimum",
@@ -4591,7 +4596,8 @@
4591
4596
  "types": [
4592
4597
  "unknown"
4593
4598
  ],
4594
- "level": 0
4599
+ "level": 0,
4600
+ "evaluate": false
4595
4601
  }
4596
4602
  ],
4597
4603
  "level": 1
@@ -64,7 +64,7 @@ const config = {
64
64
  {
65
65
  where: where(),
66
66
  notes: 'handle lists',
67
- match: ({context, hierarchy}) => context.marker == 'list' && context.value,
67
+ match: ({context, hierarchy}) => context.marker == 'list' && context.value && (!context.interpolate || context.isResponse),
68
68
  apply: async ({context, gs}) => {
69
69
  if (context.newLinesOnly) {
70
70
  return await gs(toFinalValue(context), '\n')
@@ -76,7 +76,7 @@ const config = {
76
76
 
77
77
  {
78
78
  where: where(),
79
- match: ({context, callId}) => context.listable && context.value,
79
+ match: ({context, callId}) => context.listable && context.value && (!context.interpolate || context.isResponse),
80
80
  apply: ({context, gs}) => {
81
81
  return gs(context.value, ' ', ' ' + context.word + ' ')
82
82
  },
@@ -27,17 +27,39 @@ const config = {
27
27
  id: "counting",
28
28
  convolution: true,
29
29
  before: ['verb', 'article'],
30
- bridge: "{ ...after, modifiers: append(['quantity'], after[0].modifiers), quantity: before[0], number: default(before[0].number, before[0].value), instance: true }"
30
+ bridge: `{
31
+ ...after,
32
+ countable: after[0],
33
+ interpolate: [{ property: 'quantity', isQuantifier: true }, { property: 'countable', isQuantified: true }],
34
+ modifiers: append(['quantity'], after[0].modifiers),
35
+ quantity: before[0],
36
+ number: default(before[0].number, before[0].value),
37
+ instance: true
38
+ }`
31
39
  },
32
40
  {
33
41
  id: "countOfPieces",
34
42
  convolution: true,
35
- bridge: "{ ...next(operator), modifiers: append(['count'], after[0].modifiers), count: before[0], word: after.word, instance: true }"
43
+ bridge: `{
44
+ ...next(operator),
45
+ countOfPiecesOperator: after[0],
46
+ interpolate: [{ property: 'count' }, { property: 'countOfPiecesOperator' }],
47
+ modifiers: append(['count'], after[0].modifiers),
48
+ count: before[0],
49
+ word: after.word,
50
+ instance: true }`
36
51
  },
37
52
  {
38
53
  id: "countingPieces",
39
54
  convolution: true,
40
- bridge: "{ ...after, modifiers: append(['pieces'], after[0].modifiers), pieces: before[0], instance: true }"
55
+ bridge: `{
56
+ ...after[0],
57
+ countingPiecesOperator: after[0],
58
+ interpolate: [ { property: 'pieces' }, { property: 'countingPiecesOperator' }],
59
+ modifiers: append(['pieces'], after[0].modifiers),
60
+ pieces: before[0],
61
+ instance: true
62
+ }`
41
63
  },
42
64
  {
43
65
  id: "hasCountOfPieces",
@@ -48,11 +70,23 @@ const config = {
48
70
  },
49
71
  {
50
72
  id: "more",
51
- bridge: "{ ...next(after[0]), more: operator, modifiers: append(['more'], after[0].modifiers) }",
73
+ bridge: `{
74
+ ...next(after[0]),
75
+ more: operator,
76
+ moreOperator: after[0],
77
+ interpolate: [ { property: 'more' }, { property: 'moreOperator' }],
78
+ modifiers: append(['more'], after[0].modifiers)
79
+ }`,
52
80
  },
53
81
  {
54
82
  id: "less",
55
- bridge: "{ ...next(after[0]), less: operator, modifiers: append(['less'], after[0].modifiers) }",
83
+ bridge: `{
84
+ ...next(after[0]),
85
+ less: operator,
86
+ lessOperator: after[0],
87
+ interpolate: [{ property: 'less' }, { property: 'lessOperator' }],
88
+ modifiers: append(['less'], after[0].modifiers)
89
+ }`,
56
90
  },
57
91
  {
58
92
  id: "quantifier",