tpmkms_4wp 9.4.5-beta.3 → 9.4.5-beta.4

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.
@@ -250,10 +250,17 @@ const initializer = ({config}) => {
250
250
  }
251
251
  if (Array.isArray(interpolate)) {
252
252
  const strings = []
253
+ let separator = ''
253
254
  for (const element of interpolate) {
254
- strings.push(await args.g(element))
255
+ if (typeof element == 'string') {
256
+ separator = element
257
+ } else {
258
+ strings.push(separator)
259
+ strings.push(await args.gp(element))
260
+ separator = ' '
261
+ }
255
262
  }
256
- return strings.join(" ")
263
+ return strings.join('')
257
264
  } else {
258
265
  return await helpers.processTemplateString(interpolate, evaluator)
259
266
  }
@@ -1,2 +1,179 @@
1
1
  {
2
- }
2
+ "configs": [
3
+ {
4
+ "operators": [
5
+ "((hierarchy/*) [queryMarker|ne])",
6
+ "((listable/*) [listMarker|que])",
7
+ "([hierarchiable])",
8
+ "((hierarchiable) [hierarchy|] (hierarchiable))",
9
+ "((hierarchiable) (hierarchiable) [hierarchy|])",
10
+ "([hierarchy|] (hierarchiable) (hierarchiable))"
11
+ ],
12
+ "bridges": [
13
+ {
14
+ "id": "queryMarker",
15
+ "bridge": "{ ...before[0], verb: before[0], interpolate: [before[0], '', operator], question: true }",
16
+ "separators": "|",
17
+ "before": [
18
+ "hierarchy"
19
+ ]
20
+ },
21
+ {
22
+ "id": "listMarker",
23
+ "localHierarchy": [
24
+ [
25
+ "unknown",
26
+ "listable"
27
+ ]
28
+ ],
29
+ "bridge": "{ ...before[0], verb: before[0], interpolate: [before[0], '', operator], list: true }",
30
+ "separators": "|"
31
+ },
32
+ {
33
+ "id": "hierarchiable"
34
+ },
35
+ {
36
+ "id": "hierarchy",
37
+ "localHierarchy": [
38
+ [
39
+ "unknown",
40
+ "hierarchiable"
41
+ ]
42
+ ],
43
+ "bridge": "{ ...next(operator), child: arguments[0], parent: arguments[1], question: less_than(indexes.operator, indexes.arguments[0]), interpolate: all }",
44
+ "words": [
45
+ {
46
+ "word": "sum",
47
+ "number": "singular",
48
+ "person": "first"
49
+ },
50
+ {
51
+ "word": "es",
52
+ "number": "singular",
53
+ "person": "second"
54
+ },
55
+ {
56
+ "word": "est",
57
+ "number": "singular",
58
+ "person": "third"
59
+ },
60
+ {
61
+ "word": "sumus",
62
+ "number": "plural",
63
+ "person": "first"
64
+ },
65
+ {
66
+ "word": "estis",
67
+ "number": "plural",
68
+ "person": "second"
69
+ },
70
+ {
71
+ "word": "sunt",
72
+ "number": "plural",
73
+ "person": "third"
74
+ }
75
+ ]
76
+ }
77
+ ],
78
+ "semantics": [
79
+ {
80
+ "match": "({context}) => context.marker == 'unknown'",
81
+ "apply": "({context, config, addWord}) => {\n const id = context.word\n const word = context.word\n config.addWord(word, { id, value: id })\n config.addOperator(`([${id}|])`)\n config.addBridge({ id, isA: ['hierarchiable'] })\n }"
82
+ }
83
+ ]
84
+ },
85
+ {
86
+ "apply": "({addSuffix}) => addSuffix('que')"
87
+ }
88
+ ],
89
+ "resultss": [
90
+ {
91
+ "extraConfig": true,
92
+ "operators": [
93
+ "((hierarchy/*) [queryMarker|ne])",
94
+ "((listable/*) [listMarker|que])",
95
+ "([hierarchiable])",
96
+ "((hierarchiable) [hierarchy|] (hierarchiable))",
97
+ "((hierarchiable) (hierarchiable) [hierarchy|])",
98
+ "([hierarchy|] (hierarchiable) (hierarchiable))"
99
+ ],
100
+ "bridges": [
101
+ {
102
+ "id": "queryMarker",
103
+ "bridge": "{ ...before[0], verb: before[0], interpolate: [before[0], '', operator], question: true }",
104
+ "separators": "|",
105
+ "before": [
106
+ "hierarchy"
107
+ ]
108
+ },
109
+ {
110
+ "id": "listMarker",
111
+ "localHierarchy": [
112
+ [
113
+ "unknown",
114
+ "listable"
115
+ ]
116
+ ],
117
+ "bridge": "{ ...before[0], verb: before[0], interpolate: [before[0], '', operator], list: true }",
118
+ "separators": "|"
119
+ },
120
+ {
121
+ "id": "hierarchiable"
122
+ },
123
+ {
124
+ "id": "hierarchy",
125
+ "localHierarchy": [
126
+ [
127
+ "unknown",
128
+ "hierarchiable"
129
+ ]
130
+ ],
131
+ "bridge": "{ ...next(operator), child: arguments[0], parent: arguments[1], question: less_than(indexes.operator, indexes.arguments[0]), interpolate: all }",
132
+ "words": [
133
+ {
134
+ "word": "sum",
135
+ "number": "singular",
136
+ "person": "first"
137
+ },
138
+ {
139
+ "word": "es",
140
+ "number": "singular",
141
+ "person": "second"
142
+ },
143
+ {
144
+ "word": "est",
145
+ "number": "singular",
146
+ "person": "third"
147
+ },
148
+ {
149
+ "word": "sumus",
150
+ "number": "plural",
151
+ "person": "first"
152
+ },
153
+ {
154
+ "word": "estis",
155
+ "number": "plural",
156
+ "person": "second"
157
+ },
158
+ {
159
+ "word": "sunt",
160
+ "number": "plural",
161
+ "person": "third"
162
+ }
163
+ ]
164
+ }
165
+ ],
166
+ "semantics": [
167
+ {}
168
+ ]
169
+ },
170
+ {
171
+ "apply": "({addSuffix}) => addSuffix('que')"
172
+ }
173
+ ],
174
+ "fragments": [],
175
+ "semantics": [],
176
+ "associations": [],
177
+ "summaries": [],
178
+ "learned_contextual_priorities": []
179
+ }
package/common/latin.js CHANGED
@@ -2,6 +2,7 @@ const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const gdefaults = require("./gdefaults")
4
4
  const latin_tests = require('./latin.test.json')
5
+ const latin_instance = require('./latin.instance.json')
5
6
 
6
7
  /*
7
8
  marcus est vir
@@ -12,9 +13,9 @@ const latin_tests = require('./latin.test.json')
12
13
  marcus quintus iuliaque
13
14
  */
14
15
  const config = {
15
- name: 'latin',
16
16
  operators: [
17
- "((hierarchy/*) [queryMarker])",
17
+ "((hierarchy/*) [queryMarker|ne])",
18
+ "((listable/*) [listMarker|que])",
18
19
  "([hierarchiable])",
19
20
  "((hierarchiable) [hierarchy|] (hierarchiable))",
20
21
  "((hierarchiable) (hierarchiable) [hierarchy|])",
@@ -23,10 +24,16 @@ const config = {
23
24
  bridges: [
24
25
  {
25
26
  id: "queryMarker",
26
- bridge: "{ ...before[0], question: true }",
27
+ bridge: "{ ...before[0], verb: before[0], interpolate: [before[0], '', operator], question: true }",
27
28
  separators: '|',
28
29
  before: ['hierarchy'],
29
30
  },
31
+ {
32
+ id: "listMarker",
33
+ localHierarchy: [['unknown', 'listable']],
34
+ bridge: "{ ...before[0], verb: before[0], interpolate: [before[0], '', operator], list: true }",
35
+ separators: '|',
36
+ },
30
37
  { id: "hierarchiable" },
31
38
  {
32
39
  id: "hierarchy",
@@ -42,28 +49,29 @@ const config = {
42
49
  ]
43
50
  },
44
51
  ],
45
- words: {
46
- literals: {
47
- "ne": [
48
- {
49
- id: 'queryMarker',
50
- initial: { value: 'queryMarker' },
51
- }
52
- ],
53
- },
54
- /*
55
- patterns: [
56
- {
57
- pattern: ["ne"],
58
- defs: [ { id: "queryMarker", uuid: '1', }, ],
59
- },
60
- ],
61
- */
62
- },
52
+ semantics: [
53
+ {
54
+ match: ({context}) => context.marker == 'unknown',
55
+ apply: ({context, config, addWord}) => {
56
+ const id = context.word
57
+ const word = context.word
58
+ config.addWord(word, { id, value: id })
59
+ config.addOperator(`([${id}|])`)
60
+ config.addBridge({ id, isA: ['hierarchiable'] })
61
+ }
62
+ }
63
+ ],
63
64
  };
64
65
 
66
+ const template = {
67
+ configs: [
68
+ config,
69
+ ({addSuffix}) => addSuffix('que'),
70
+ ]
71
+ }
72
+
65
73
  knowledgeModule( {
66
- config,
74
+ config: { name: 'latin' },
67
75
  includes: [gdefaults],
68
76
 
69
77
  module,
@@ -71,8 +79,20 @@ knowledgeModule( {
71
79
  test: {
72
80
  name: './latin.test.json',
73
81
  contents: latin_tests,
82
+ includes: {
83
+ words: {
84
+ literals: ['marcus'],
85
+ },
86
+ bridges: ['marcus'],
87
+ operators: ['([marcus|])'],
88
+ },
74
89
  checks: {
75
90
  context: [defaultContextCheck()],
76
91
  },
77
92
  },
93
+
94
+ template: {
95
+ template,
96
+ instance: latin_instance,
97
+ },
78
98
  })