theprogrammablemind_4wp 9.4.3 → 9.4.4-beta.1
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.
- package/client.js +34 -19
- package/package.json +1 -1
- package/src/config.js +1 -0
package/client.js
CHANGED
@@ -1316,7 +1316,7 @@ const knowledgeModuleImpl = async ({
|
|
1316
1316
|
parser.add_argument('--parenthesized', { action: 'store_true', help: 'Show the generated phrases with parenthesis.' })
|
1317
1317
|
parser.add_argument('-c', '--clean', { help: 'Remove data from the test files. a === association' })
|
1318
1318
|
parser.add_argument('-od', '--objectDiff', { action: 'store_true', help: 'When showing the objects use a colour diff' })
|
1319
|
-
parser.add_argument('-p', '--print', { help: 'Print the specified elements c === config, w === words, b === bridges, o === operators d === objects (d for data), h === hierarchy, g === generators, s === semantics, l === load t=tests ordering p === priorities a === associations j === JSON sent to server. for example --print wb' })
|
1319
|
+
parser.add_argument('-p', '--print', { help: 'Print the specified elements c === config, w === words, b === bridges, o === operators d === objects (d for data), h === hierarchy, ha === hierarchy ancestors g === generators, s === semantics, l === load t=tests ordering p === priorities a === associations j === JSON sent to server. for example --print wb' })
|
1320
1320
|
parser.add_argument('-s', '--save', { action: 'store_true', help: 'When running with the --query flag this will save the current run to the test file. When running without the --query flag all tests will be run and resaved.' })
|
1321
1321
|
parser.add_argument('-fr', '--failRebuild', { action: 'store_true', help: 'If a rebuild is required fail out.' })
|
1322
1322
|
parser.add_argument('-sd', '--saveDeveloper', { action: 'store_true', help: 'Same as -s but the query will not show up in the info command.' })
|
@@ -1466,7 +1466,13 @@ const knowledgeModuleImpl = async ({
|
|
1466
1466
|
}
|
1467
1467
|
configPrinted = true
|
1468
1468
|
if (args.print) {
|
1469
|
-
|
1469
|
+
let print = args.print
|
1470
|
+
const hasArg = (arg) => {
|
1471
|
+
const result = print.includes(arg)
|
1472
|
+
print = print.replaceAll(arg, '')
|
1473
|
+
return result
|
1474
|
+
}
|
1475
|
+
if (hasArg('t')) {
|
1470
1476
|
console.log('Test queries')
|
1471
1477
|
let counter = 0
|
1472
1478
|
for (const test of config.tests) {
|
@@ -1474,19 +1480,18 @@ const knowledgeModuleImpl = async ({
|
|
1474
1480
|
counter += 1
|
1475
1481
|
}
|
1476
1482
|
}
|
1477
|
-
if (
|
1483
|
+
if (hasArg('c')) {
|
1478
1484
|
const { data } = setupProcessB({ config })
|
1479
1485
|
console.log('Config as sent to server')
|
1480
1486
|
console.log(JSON.stringify(data, null, 2))
|
1481
1487
|
}
|
1482
|
-
|
1483
|
-
if (args.print.includes('l')) {
|
1488
|
+
if (hasArg('l')) {
|
1484
1489
|
console.log('Module load ordering')
|
1485
1490
|
for (const km of config.configs) {
|
1486
1491
|
console.log(` ${km.name}`)
|
1487
1492
|
}
|
1488
1493
|
}
|
1489
|
-
if (
|
1494
|
+
if (hasArg('w')) {
|
1490
1495
|
// { literals: Object, patterns: Array(2), hierarchy: Array(97) }
|
1491
1496
|
console.log('literals')
|
1492
1497
|
for (const word in config.config.words.literals) {
|
@@ -1497,21 +1502,36 @@ const knowledgeModuleImpl = async ({
|
|
1497
1502
|
console.log(' ' + JSON.stringify(pattern))
|
1498
1503
|
}
|
1499
1504
|
}
|
1500
|
-
if (
|
1505
|
+
if (hasArg('b')) {
|
1501
1506
|
for (const bridge of config.config.bridges) {
|
1502
1507
|
console.log(JSON.stringify(bridge))
|
1503
1508
|
}
|
1504
1509
|
}
|
1505
|
-
if (
|
1510
|
+
if (hasArg('o')) {
|
1506
1511
|
for (const operator of config.config.operators) {
|
1507
1512
|
console.log(JSON.stringify(operator))
|
1508
1513
|
}
|
1509
1514
|
}
|
1510
|
-
if (
|
1515
|
+
if (hasArg('j')) {
|
1511
1516
|
const { data } = setupProcessB({ config })
|
1512
1517
|
console.log(JSON.stringify(data, null, 2))
|
1513
1518
|
}
|
1514
|
-
if (
|
1519
|
+
if (hasArg('ha')) {
|
1520
|
+
const nodes = new Set()
|
1521
|
+
for (const edge of config.config.hierarchy) {
|
1522
|
+
nodes.add(edge[0])
|
1523
|
+
nodes.add(edge[1])
|
1524
|
+
}
|
1525
|
+
for (const node of nodes) {
|
1526
|
+
console.log(`${node}: ${[...config.hierarchy.ancestors(node)]}`)
|
1527
|
+
}
|
1528
|
+
}
|
1529
|
+
if (hasArg('h')) {
|
1530
|
+
for (const edge of config.config.hierarchy) {
|
1531
|
+
console.log(JSON.stringify(edge))
|
1532
|
+
}
|
1533
|
+
}
|
1534
|
+
if (hasArg('a')) {
|
1515
1535
|
console.log('associations ================')
|
1516
1536
|
const properties = ['negative', 'positive']
|
1517
1537
|
for (const property of properties) {
|
@@ -1521,20 +1541,15 @@ const knowledgeModuleImpl = async ({
|
|
1521
1541
|
}
|
1522
1542
|
}
|
1523
1543
|
}
|
1524
|
-
if (
|
1544
|
+
if (hasArg('d')) {
|
1525
1545
|
console.log(JSON.stringify(config.config.objects, null, 2))
|
1526
1546
|
}
|
1527
|
-
if (
|
1547
|
+
if (hasArg('p')) {
|
1528
1548
|
for (const priority of config.config.priorities) {
|
1529
1549
|
console.log(JSON.stringify(priority))
|
1530
1550
|
}
|
1531
1551
|
}
|
1532
|
-
if (
|
1533
|
-
for (const edge of config.config.hierarchy) {
|
1534
|
-
console.log(JSON.stringify(edge))
|
1535
|
-
}
|
1536
|
-
}
|
1537
|
-
if (args.print.includes('g')) {
|
1552
|
+
if (hasArg('g')) {
|
1538
1553
|
const easyToRead = _.cloneDeep(config.config.generators)
|
1539
1554
|
for (const semantic of easyToRead) {
|
1540
1555
|
semantic.match = semantic.match.toString()
|
@@ -1545,7 +1560,7 @@ const knowledgeModuleImpl = async ({
|
|
1545
1560
|
}
|
1546
1561
|
console.dir(easyToRead)
|
1547
1562
|
}
|
1548
|
-
if (
|
1563
|
+
if (hasArg('s')) {
|
1549
1564
|
const easyToRead = _.cloneDeep(config.config.semantics)
|
1550
1565
|
for (const semantic of easyToRead) {
|
1551
1566
|
semantic.match = semantic.match.toString()
|
package/package.json
CHANGED