theprogrammablemind_4wp 7.5.0-beta.1 → 7.5.0-beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/config.js +31 -6
package/package.json CHANGED
@@ -61,6 +61,6 @@
61
61
  "json-stable-stringify": "^1.0.1",
62
62
  "node-fetch": "^2.6.1"
63
63
  },
64
- "version": "7.5.0-beta.1",
64
+ "version": "7.5.0-beta.2",
65
65
  "license": "ISC"
66
66
  }
package/src/config.js CHANGED
@@ -593,18 +593,24 @@ class Config {
593
593
  }
594
594
  }
595
595
 
596
- addHierarchyProperties (properties) {
597
- if (typeof properties.child !== 'string') {
596
+ addHierarchyProperties (edge) {
597
+ const { child, parent } = edge
598
+ if (typeof child !== 'string') {
598
599
  throw `addHierarchy expected child property to be a string. got ${JSON.stringify(child)}`
599
600
  }
600
- if (typeof properties.parent !== 'string') {
601
- throw `addHierarchy expected parent properties to be a string. got ${JSON.stringify(parent)}`
601
+ if (typeof parent !== 'string') {
602
+ throw `addHierarchy expected parent property to be a string. got ${JSON.stringify(parent)}`
602
603
  }
603
604
  if (!this.config.hierarchy) {
604
605
  this.config.hierarchy = []
605
606
  }
606
- // this.config.hierarchy.push([properties.child, properties.parent])
607
- this.config.hierarchy.push(properties)
607
+ if (global.entodictonDebugHierarchy) {
608
+ if (deepEqual(global.entodictonDebugHierarchy, [child, parent])) {
609
+ debugger; // debug hierarchy hit
610
+ }
611
+ }
612
+ this.config.hierarchy.push(edge)
613
+ // TODO greg11 this.hierarchy.addEdge(edge)
608
614
  this._delta.json.hierarchy.push([child, parent])
609
615
  }
610
616
 
@@ -615,6 +621,7 @@ class Config {
615
621
  if (typeof parent !== 'string') {
616
622
  throw `addHierarchy expected parent to be a string. got ${JSON.stringify(parent)}`
617
623
  }
624
+
618
625
  if (!this.config.hierarchy) {
619
626
  this.config.hierarchy = []
620
627
  }
@@ -623,6 +630,7 @@ class Config {
623
630
  debugger; // debug hierarchy hit
624
631
  }
625
632
  }
633
+
626
634
  if (this.config.hierarchy.find( (element) => {
627
635
  const hc = hierarchyCanonical(element)
628
636
  if (child == hc.child && parent == hc.parent) {
@@ -633,6 +641,7 @@ class Config {
633
641
  }
634
642
 
635
643
  this.config.hierarchy.push([child, parent])
644
+ // this.hierarchy.addEdge([child, parent])
636
645
  this._delta.json.hierarchy.push([child, parent])
637
646
  }
638
647
 
@@ -1006,6 +1015,15 @@ class Config {
1006
1015
  'flatten',
1007
1016
  ]
1008
1017
  helpers.validProps(valid, config, 'config')
1018
+
1019
+ config.operators = config.operators || []
1020
+ config.bridges = config.bridges || []
1021
+ config.words = config.words || {}
1022
+ config.generators = config.generators || []
1023
+ config.semantics = config.semantics || []
1024
+ config.hierarchy = config.hierarchy || []
1025
+ config.associations = config.associations || { negative: [], positive: [] }
1026
+ config.priorities = config.priorities || []
1009
1027
  }
1010
1028
 
1011
1029
  this.allowDelta = false
@@ -1648,6 +1666,13 @@ class Config {
1648
1666
  return false
1649
1667
  }
1650
1668
 
1669
+ /* TODO greg11
1670
+ if (!this.hierarchy) {
1671
+ debugBreak()
1672
+ return false
1673
+ }
1674
+ */
1675
+
1651
1676
  for (const key in this.config.words) {
1652
1677
  const values = this.config.words[key]
1653
1678
  if (values.some((word) => (Object.keys(word).includes('uuid') && !word.uuid))) {