tpmkms 9.7.1-beta.12 → 9.7.1-beta.14

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.
@@ -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": [],
@@ -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",