theprogrammablemind_4wp 7.5.8-beta.27 → 7.5.8-beta.29
Sign up to get free protection for your applications and to get access to all the features.
- package/client.js +37 -1
- package/package.json +1 -1
- package/src/config.js +2 -4
package/client.js
CHANGED
@@ -700,7 +700,12 @@ const _process = async (config, query, { initializer, commandLineArgs, credentia
|
|
700
700
|
|
701
701
|
if (writeTests) {
|
702
702
|
const actual_config = getConfigForTest(config, testConfig)
|
703
|
-
|
703
|
+
const saveObjects = {...config.config.objects}
|
704
|
+
saveObjects.nameToUUID = {}
|
705
|
+
for (let km of config.configs) {
|
706
|
+
saveObjects.nameToUUID[km.name] = km.uuid
|
707
|
+
}
|
708
|
+
writeTest(testsFN, query, saveObjects, response.generated, response.paraphrases, response.responses, response.contexts, response.associations, response.metadata, actual_config, saveDeveloper, response.paraphrasesParenthesized, response.generatedParenthesized)
|
704
709
|
}
|
705
710
|
|
706
711
|
return response
|
@@ -1157,6 +1162,37 @@ const defaultInnerProcess = (config, errorHandler, responses) => {
|
|
1157
1162
|
} else {
|
1158
1163
|
console.log('objects', runtime.util.inspect(config.get('objects'), { depth: Infinity, sorted: true }))
|
1159
1164
|
}
|
1165
|
+
|
1166
|
+
const pickEm = () => {
|
1167
|
+
const picked = {}
|
1168
|
+
const namespaced = config.get('objects')['namespaced']
|
1169
|
+
for (let prop of (config.testConfig.check || [])) {
|
1170
|
+
if (prop.km) {
|
1171
|
+
/*
|
1172
|
+
const objects = namespaced[prop.km]]
|
1173
|
+
picked[prop.km] = {}
|
1174
|
+
for (let p of c.testConfig.check) {
|
1175
|
+
if (p.km) {
|
1176
|
+
continue
|
1177
|
+
}
|
1178
|
+
picked[p] = objects[p]
|
1179
|
+
}
|
1180
|
+
*/
|
1181
|
+
console.log('TODO implement this if needed')
|
1182
|
+
} else {
|
1183
|
+
const objects = namespaced[config.uuid]
|
1184
|
+
picked[prop] = objects[prop]
|
1185
|
+
}
|
1186
|
+
}
|
1187
|
+
return picked
|
1188
|
+
}
|
1189
|
+
|
1190
|
+
const picked = pickEm()
|
1191
|
+
if (!_.isEmpty(picked)) {
|
1192
|
+
console.log('--- checked object properties ---')
|
1193
|
+
console.log(JSON.stringify(picked, null, 2))
|
1194
|
+
}
|
1195
|
+
|
1160
1196
|
console.log('--- The contexts are ----------')
|
1161
1197
|
console.log(JSON.stringify(sortJson(responses.contexts, { depth: 25 }), null, 2))
|
1162
1198
|
console.log('')
|
package/package.json
CHANGED
package/src/config.js
CHANGED
@@ -666,6 +666,7 @@ class Config {
|
|
666
666
|
addOperator: (...args) => this.addOperator(...args, uuid),
|
667
667
|
addPriorities: (...args) => this.addPriorities(...args),
|
668
668
|
addSemantic: (...args) => this.addSemantic(...args, uuid, config.name),
|
669
|
+
removeSemantic: (...args) => this.removeSemantic(...args, uuid, config.name),
|
669
670
|
addWord: (...args) => this.addWord(...args, uuid),
|
670
671
|
|
671
672
|
getHierarchy: (...args) => this.config.hierarchy,
|
@@ -716,9 +717,6 @@ class Config {
|
|
716
717
|
}
|
717
718
|
|
718
719
|
setTestConfig(testConfig) {
|
719
|
-
if (this.name == 'ui') {
|
720
|
-
console.log('ui setting testConfig')
|
721
|
-
}
|
722
720
|
this.testConfig = testConfig
|
723
721
|
}
|
724
722
|
|
@@ -1167,7 +1165,7 @@ class Config {
|
|
1167
1165
|
}
|
1168
1166
|
|
1169
1167
|
const semantics = this.config.semantics
|
1170
|
-
Object.assign(semantic, { uuid: uuid || this._uuid, km: name || this.name, index: semantics.length, id: uuidv4() })
|
1168
|
+
Object.assign(semantic, { uuid: uuid || semantic.uuid || this._uuid, km: name || this.name, index: semantics.length, id: semantic.id || uuidv4() })
|
1171
1169
|
semantics.unshift(semantic)
|
1172
1170
|
}
|
1173
1171
|
|