ekms 7.12.8-beta.1 → 7.12.8-beta.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. package/common/animals.instance.json +89 -249
  2. package/common/animals.js +1 -1
  3. package/common/avatar.js +7 -5
  4. package/common/characters.js +12 -5
  5. package/common/crew.instance.json +289 -577
  6. package/common/crew.js +1 -1
  7. package/common/currency.js +0 -2
  8. package/common/dialogues.js +16 -14
  9. package/common/dimension.instance.json +13 -13
  10. package/common/dimension.js +1 -1
  11. package/common/edible.instance.json +293 -297
  12. package/common/edible.js +1 -1
  13. package/common/emotions.instance.json +29 -65
  14. package/common/emotions.js +1 -1
  15. package/common/fastfood.instance.json +517 -1473
  16. package/common/fastfood.js +1 -1
  17. package/common/formulas.instance.json +9 -9
  18. package/common/formulas.js +2 -2
  19. package/common/gdefaults.js +2 -0
  20. package/common/help.js +7 -2
  21. package/common/help.test.json +9 -5
  22. package/common/helpers.js +5 -0
  23. package/common/javascript.js +8 -6
  24. package/common/kirk.instance.json +1 -1
  25. package/common/kirk.js +1 -1
  26. package/common/length.instance.json +49 -229
  27. package/common/length.js +1 -1
  28. package/common/math.instance.json +21 -41
  29. package/common/math.js +1 -1
  30. package/common/meta.instance.json +1 -1
  31. package/common/meta.js +35 -10
  32. package/common/numbers.js +28 -24
  33. package/common/ordering.instance.json +37 -101
  34. package/common/ordering.js +1 -1
  35. package/common/people.instance.json +50 -78
  36. package/common/people.js +1 -1
  37. package/common/pipboy.instance.json +197 -201
  38. package/common/pipboy.js +1 -1
  39. package/common/pokemon.instance.json +41 -97
  40. package/common/pokemon.js +1 -1
  41. package/common/pressure.instance.json +13 -33
  42. package/common/pressure.js +1 -1
  43. package/common/properties.instance.json +21 -49
  44. package/common/properties.js +13 -8
  45. package/common/reports.instance.json +7 -63
  46. package/common/reports.js +9 -7
  47. package/common/scorekeeper.instance.json +1 -1
  48. package/common/scorekeeper.js +9 -7
  49. package/common/spock.instance.json +1 -1
  50. package/common/spock.js +1 -1
  51. package/common/tell.js +4 -2
  52. package/common/temperature.instance.json +17 -133
  53. package/common/temperature.js +1 -1
  54. package/common/time.js +36 -20
  55. package/common/time.test.json +66 -44
  56. package/common/tokenize.js +46 -0
  57. package/common/tokenize.test.json +2 -0
  58. package/common/ui.instance.json +1 -1
  59. package/common/weight.instance.json +33 -201
  60. package/common/weight.js +1 -1
  61. package/main.js +2 -0
  62. package/package.json +7 -3
package/common/meta.js CHANGED
@@ -1,15 +1,16 @@
1
1
  const { Config, knowledgeModule, ensureTestFile, where, unflatten, flattens } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const _ = require('lodash')
4
+ const gdefaults = require('./gdefaults.js')
4
5
  ensureTestFile(module, 'meta', 'test')
5
6
  ensureTestFile(module, 'meta', 'instance')
6
7
  const meta_tests = require('./meta.test.json')
7
8
  const meta_instance = require('./meta.instance.json')
8
9
  const { hashIndexesGet, hashIndexesSet, translationMapping, translationMappings } = require('./helpers/meta.js')
9
- const { zip } = require('./helpers.js')
10
+ const { zip, words } = require('./helpers.js')
10
11
 
11
12
  const template = {
12
- queries: [
13
+ configs: [
13
14
  // "if f then g",
14
15
  //"if e or f then g",
15
16
  ]
@@ -59,6 +60,23 @@ let configStruct = {
59
60
  { child: 'orAble', parent: 'ifAble' },
60
61
  ],
61
62
  bridges: [
63
+ /*
64
+ {
65
+ id: "synonym",
66
+ // implicit words in singular/plural
67
+ words: words('synonym'),
68
+ operator: "([synonym])",
69
+ },
70
+ {
71
+ id: 'synonymOfWord',
72
+ operator: "((synonym/*) [synonymOfWord|of] (word))",
73
+ bridge: "{ ...next(operator), word: after[0] }",
74
+ evaluator: ({context}) => {
75
+ debugger
76
+ debugger
77
+ }
78
+ },
79
+ */
62
80
  {id: "orList", level: 0, selector: {left: [{ marker: 'orAble' }], right: [{ marker: 'orAble' }], passthrough: true}, bridge: "{ ...next(operator), value: append(before, after) }"},
63
81
  {id: "orList", level: 1, selector: {left: [{ marker: 'orAble' }], passthrough: true}, bridge: "{ ...operator, value: append(before, operator.value) }"},
64
82
 
@@ -81,14 +99,16 @@ let configStruct = {
81
99
  ],
82
100
  version: '3',
83
101
  words: {
84
- // 'testWord2': [{"id": "testWord2", "initial": "{ value: 'testWord2Value' }" }],
85
- // TODO make this development and select out for module
86
- // 'x': [{id: "x", initial: "{ value: 'x' }", development: true }],
87
- // 'f': [{id: "ifAble", initial: "{ word: 'f' }", development: true }],
88
- // 'g': [{id: "ifAble", initial: "{ word: 'g' }", development: true }],
89
- 'f': [{id: "f", initial: "{ value: 'f', word: 'f' }", development: true }],
90
- 'x': [{id: "x", initial: "{ value: 'x', word: 'x' }", development: true }],
91
- 'gq': [{id: "g", initial: "{ word: 'gq', query: true }", development: true }],
102
+ "literals": {
103
+ // 'testWord2': [{"id": "testWord2", "initial": "{ value: 'testWord2Value' }" }],
104
+ // TODO make this development and select out for module
105
+ // 'x': [{id: "x", initial: "{ value: 'x' }", development: true }],
106
+ // 'f': [{id: "ifAble", initial: "{ word: 'f' }", development: true }],
107
+ // 'g': [{id: "ifAble", initial: "{ word: 'g' }", development: true }],
108
+ 'f': [{id: "f", initial: "{ value: 'f', word: 'f' }", development: true }],
109
+ 'x': [{id: "x", initial: "{ value: 'x', word: 'x' }", development: true }],
110
+ 'gq': [{id: "g", initial: "{ word: 'gq', query: true }", development: true }],
111
+ }
92
112
  },
93
113
  generators: [
94
114
  {
@@ -362,6 +382,9 @@ let configStruct = {
362
382
 
363
383
  const createConfig = () => {
364
384
  const config = new Config(configStruct, module)
385
+ config.stop_auto_rebuild()
386
+ config.add(gdefaults())
387
+
365
388
  config.initializer( ({config, addGenerator, isModule}) => {
366
389
  if (!isModule) {
367
390
  addGenerator({
@@ -371,6 +394,8 @@ const createConfig = () => {
371
394
  })
372
395
  }
373
396
  })
397
+
398
+ config.restart_auto_rebuild()
374
399
  return config
375
400
  }
376
401
 
package/common/numbers.js CHANGED
@@ -20,30 +20,34 @@ let configStruct = {
20
20
  debug: false,
21
21
  version: '3',
22
22
  words: {
23
- // start with a space for regular expressions
24
- " ([0-9]+$)": [{"id": "number", "initial": "{ value: int(group[0]), instance: true }" }],
25
- " ([0-9]+[.][0-9]+$)": [{"id": "number", "initial": "{ value: float(group[0]), instance: true }" }],
26
- " ([.][0-9]+$)": [{"id": "number", "initial": "{ value: float(group[0]), instance: true }" }],
27
- "one": [{"id": "number", "initial": "{ value: 1, instance:true }" }],
28
- "ones": [{"id": "number", "initial": "{ value: 1, number: 'many', instance:true }" }],
29
- "two": [{"id": "number", "initial": "{ value: 2 , instance:true}" }],
30
- "twos": [{"id": "number", "initial": "{ value: 2 , number: 'many', instance:true}" }],
31
- "three": [{"id": "number", "initial": "{ value: 3, instance:true }" }],
32
- "threes": [{"id": "number", "initial": "{ value: 3, number: 'many', instance:true }" }],
33
- "four": [{"id": "number", "initial": "{ value: 4, instance:true }" }],
34
- "fours": [{"id": "number", "initial": "{ value: 4, number: 'many', instance:true }" }],
35
- "five": [{"id": "number", "initial": "{ value: 5, instance:true }" }],
36
- "fives": [{"id": "number", "initial": "{ value: 5, number: 'many', instance:true }" }],
37
- "six": [{"id": "number", "initial": "{ value: 6, instance:true }" }],
38
- "sixes": [{"id": "number", "initial": "{ value: 6, number: 'many', instance:true }" }],
39
- "seven": [{"id": "number", "initial": "{ value: 7, instance:true }" }],
40
- "sevens": [{"id": "number", "initial": "{ value: 7, number: 'many', instance:true }" }],
41
- "eight": [{"id": "number", "initial": "{ value: 8, instance:true }" }],
42
- "eights": [{"id": "number", "initial": "{ value: 8, number: 'many', instance:true }" }],
43
- "nine": [{"id": "number", "initial": "{ value: 9, instance:true }" }],
44
- "nines": [{"id": "number", "initial": "{ value: 9, number: 'many', instance:true }" }],
45
- "ten": [{"id": "number", "initial": "{ value: 10, instance:true }" }],
46
- "tens": [{"id": "number", "initial": "{ value: 10, number: 'many', instance:true }" }],
23
+ "literals": {
24
+ // start with a space for regular expressions
25
+ "one": [{"id": "number", "initial": "{ value: 1, instance:true }" }],
26
+ "ones": [{"id": "number", "initial": "{ value: 1, number: 'many', instance:true }" }],
27
+ "two": [{"id": "number", "initial": "{ value: 2 , instance:true}" }],
28
+ "twos": [{"id": "number", "initial": "{ value: 2 , number: 'many', instance:true}" }],
29
+ "three": [{"id": "number", "initial": "{ value: 3, instance:true }" }],
30
+ "threes": [{"id": "number", "initial": "{ value: 3, number: 'many', instance:true }" }],
31
+ "four": [{"id": "number", "initial": "{ value: 4, instance:true }" }],
32
+ "fours": [{"id": "number", "initial": "{ value: 4, number: 'many', instance:true }" }],
33
+ "five": [{"id": "number", "initial": "{ value: 5, instance:true }" }],
34
+ "fives": [{"id": "number", "initial": "{ value: 5, number: 'many', instance:true }" }],
35
+ "six": [{"id": "number", "initial": "{ value: 6, instance:true }" }],
36
+ "sixes": [{"id": "number", "initial": "{ value: 6, number: 'many', instance:true }" }],
37
+ "seven": [{"id": "number", "initial": "{ value: 7, instance:true }" }],
38
+ "sevens": [{"id": "number", "initial": "{ value: 7, number: 'many', instance:true }" }],
39
+ "eight": [{"id": "number", "initial": "{ value: 8, instance:true }" }],
40
+ "eights": [{"id": "number", "initial": "{ value: 8, number: 'many', instance:true }" }],
41
+ "nine": [{"id": "number", "initial": "{ value: 9, instance:true }" }],
42
+ "nines": [{"id": "number", "initial": "{ value: 9, number: 'many', instance:true }" }],
43
+ "ten": [{"id": "number", "initial": "{ value: 10, instance:true }" }],
44
+ "tens": [{"id": "number", "initial": "{ value: 10, number: 'many', instance:true }" }],
45
+ },
46
+ patterns: [
47
+ { "pattern": [{ type: 'digit' }, { repeat: true }], defs: [{id: "number", uuid: '1', initial: "{ value: int(text), instance: true }" }]},
48
+ { "pattern": [{ type: 'digit' }, { repeat: true }, '.', { type: 'digit' }, { repeat: true }], defs: [{id: "number", uuid: '1', initial: "{ value: float(text), instance: true }" }]},
49
+ { "pattern": ['.', { type: 'digit' }, { repeat: true }], defs: [{id: "number", uuid: '1', initial: "{ value: float(text), instance: true }" }]},
50
+ ],
47
51
  },
48
52
 
49
53
  hierarchy: [
@@ -1,5 +1,5 @@
1
1
  {
2
- "queries": [
2
+ "configs": [
3
3
  "wants is xfx between wanter and wantee",
4
4
  "if x likes y or x loves y then x wants y"
5
5
  ],
@@ -517,15 +517,15 @@
517
517
  },
518
518
  "one": {
519
519
  "number": "one",
520
+ "value": "wants",
521
+ "unknown": true,
522
+ "text": "wants",
520
523
  "marker": "unknown",
524
+ "word": "wants",
521
525
  "range": {
522
526
  "start": 0,
523
527
  "end": 37
524
528
  },
525
- "word": "wants",
526
- "text": "wants",
527
- "value": "wants",
528
- "unknown": true,
529
529
  "dead": true,
530
530
  "types": [
531
531
  "unknown"
@@ -563,28 +563,28 @@
563
563
  "isList": true,
564
564
  "value": [
565
565
  {
566
+ "value": "wanter",
567
+ "unknown": true,
568
+ "text": "wanter",
566
569
  "marker": "type",
570
+ "word": "wanter",
567
571
  "range": {
568
572
  "start": 21,
569
573
  "end": 26
570
574
  },
571
- "word": "wanter",
572
- "text": "wanter",
573
- "value": "wanter",
574
- "unknown": true,
575
575
  "dead": true,
576
576
  "level": 1
577
577
  },
578
578
  {
579
+ "value": "wantee",
580
+ "unknown": true,
581
+ "text": "wantee",
579
582
  "marker": "type",
583
+ "word": "wantee",
580
584
  "range": {
581
585
  "start": 32,
582
586
  "end": 37
583
587
  },
584
- "word": "wantee",
585
- "text": "wantee",
586
- "value": "wantee",
587
- "unknown": true,
588
588
  "dead": true,
589
589
  "level": 1
590
590
  }
@@ -719,24 +719,6 @@
719
719
  1
720
720
  ]
721
721
  ],
722
- [
723
- [
724
- "between",
725
- 0
726
- ],
727
- [
728
- "is",
729
- 0
730
- ],
731
- [
732
- "unknown",
733
- 0
734
- ],
735
- [
736
- "xfx",
737
- 0
738
- ]
739
- ],
740
722
  [
741
723
  [
742
724
  "between",
@@ -1624,15 +1606,15 @@
1624
1606
  "text": "ikes y"
1625
1607
  },
1626
1608
  "liker": {
1609
+ "value": "x",
1610
+ "unknown": true,
1611
+ "text": "x",
1627
1612
  "marker": "unknown",
1613
+ "word": "x",
1628
1614
  "range": {
1629
1615
  "start": 3,
1630
1616
  "end": 3
1631
1617
  },
1632
- "word": "x",
1633
- "text": "x",
1634
- "value": "x",
1635
- "unknown": true,
1636
1618
  "dead": true,
1637
1619
  "types": [
1638
1620
  "unknown"
@@ -1640,15 +1622,15 @@
1640
1622
  "level": 1
1641
1623
  },
1642
1624
  "likee": {
1625
+ "value": "y",
1626
+ "unknown": true,
1627
+ "text": "y",
1643
1628
  "marker": "unknown",
1629
+ "word": "y",
1644
1630
  "range": {
1645
1631
  "start": 11,
1646
1632
  "end": 11
1647
1633
  },
1648
- "word": "y",
1649
- "text": "y",
1650
- "value": "y",
1651
- "unknown": true,
1652
1634
  "dead": true,
1653
1635
  "types": [
1654
1636
  "unknown"
@@ -1689,15 +1671,15 @@
1689
1671
  "text": ""
1690
1672
  },
1691
1673
  "lover": {
1674
+ "value": "x",
1675
+ "unknown": true,
1676
+ "text": "x",
1692
1677
  "marker": "unknown",
1678
+ "word": "x",
1693
1679
  "range": {
1694
1680
  "start": 16,
1695
1681
  "end": 16
1696
1682
  },
1697
- "word": "x",
1698
- "text": "x",
1699
- "value": "x",
1700
- "unknown": true,
1701
1683
  "dead": true,
1702
1684
  "types": [
1703
1685
  "unknown"
@@ -1705,15 +1687,15 @@
1705
1687
  "level": 1
1706
1688
  },
1707
1689
  "lovee": {
1690
+ "value": "y",
1691
+ "unknown": true,
1692
+ "text": "y",
1708
1693
  "marker": "unknown",
1694
+ "word": "y",
1709
1695
  "range": {
1710
1696
  "start": 24,
1711
1697
  "end": 24
1712
1698
  },
1713
- "word": "y",
1714
- "text": "y",
1715
- "value": "y",
1716
- "unknown": true,
1717
1699
  "dead": true,
1718
1700
  "types": [
1719
1701
  "unknown"
@@ -1760,15 +1742,15 @@
1760
1742
  "text": ""
1761
1743
  },
1762
1744
  "wanter": {
1745
+ "value": "x",
1746
+ "unknown": true,
1747
+ "text": "x",
1763
1748
  "marker": "unknown",
1749
+ "word": "x",
1764
1750
  "range": {
1765
1751
  "start": 31,
1766
1752
  "end": 31
1767
1753
  },
1768
- "word": "x",
1769
- "text": "x",
1770
- "value": "x",
1771
- "unknown": true,
1772
1754
  "dead": true,
1773
1755
  "types": [
1774
1756
  "unknown"
@@ -1776,15 +1758,15 @@
1776
1758
  "level": 1
1777
1759
  },
1778
1760
  "wantee": {
1761
+ "value": "y",
1762
+ "unknown": true,
1763
+ "text": "y",
1779
1764
  "marker": "unknown",
1765
+ "word": "y",
1780
1766
  "range": {
1781
1767
  "start": 39,
1782
1768
  "end": 39
1783
1769
  },
1784
- "word": "y",
1785
- "text": "y",
1786
- "value": "y",
1787
- "unknown": true,
1788
1770
  "dead": true,
1789
1771
  "types": [
1790
1772
  "unknown"
@@ -2052,20 +2034,6 @@
2052
2034
  "want",
2053
2035
  1
2054
2036
  ]
2055
- ],
2056
- [
2057
- [
2058
- "if",
2059
- 0
2060
- ],
2061
- [
2062
- "then",
2063
- 0
2064
- ],
2065
- [
2066
- "unknown",
2067
- 0
2068
- ]
2069
2037
  ]
2070
2038
  ],
2071
2039
  "learned_contextual_priorities": [],
@@ -2184,24 +2152,6 @@
2184
2152
  1
2185
2153
  ]
2186
2154
  ],
2187
- [
2188
- [
2189
- "between",
2190
- 0
2191
- ],
2192
- [
2193
- "is",
2194
- 0
2195
- ],
2196
- [
2197
- "unknown",
2198
- 0
2199
- ],
2200
- [
2201
- "xfx",
2202
- 0
2203
- ]
2204
- ],
2205
2155
  [
2206
2156
  [
2207
2157
  "between",
@@ -2446,20 +2396,6 @@
2446
2396
  1
2447
2397
  ]
2448
2398
  ],
2449
- [
2450
- [
2451
- "if",
2452
- 0
2453
- ],
2454
- [
2455
- "then",
2456
- 0
2457
- ],
2458
- [
2459
- "unknown",
2460
- 0
2461
- ]
2462
- ],
2463
2399
  [
2464
2400
  [
2465
2401
  "is",
@@ -6,7 +6,7 @@ const ordering_instance = require('./ordering.instance.json')
6
6
  const { API } = require('./helpers/ordering')
7
7
 
8
8
  const template ={
9
- "queries": [
9
+ configs: [
10
10
  "wants is xfx between wanter and wantee",
11
11
  // "if a likes or loves b then a wants b",
12
12
  "if x likes y or x loves y then x wants y",