ekms 8.0.0-beta.9 → 8.0.0-beta.90

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.
Files changed (112) hide show
  1. package/common/animals.instance.json +2915 -1553
  2. package/common/animals.js +17 -20
  3. package/common/articles.js +103 -0
  4. package/common/articles.test.json +310 -0
  5. package/common/asking.instance.json +2 -0
  6. package/common/asking.js +253 -0
  7. package/common/asking.test.json +2290 -0
  8. package/common/avatar.js +6 -10
  9. package/common/characters.js +23 -29
  10. package/common/colors.instance.json +7487 -4114
  11. package/common/colors.js +5 -9
  12. package/common/colors.test.json +345 -780
  13. package/common/comparable.instance.json +1750 -0
  14. package/common/comparable.js +36 -28
  15. package/common/comparable.test.json +1196 -2
  16. package/common/concept.js +121 -119
  17. package/common/conjunction.instance.json +2 -0
  18. package/common/conjunction.js +104 -0
  19. package/common/conjunction.test.json +322 -0
  20. package/common/countable.js +20 -14
  21. package/common/countable.test.json +1050 -0
  22. package/common/crew.instance.json +13553 -7026
  23. package/common/crew.js +37 -42
  24. package/common/crew.test.json +714 -452
  25. package/common/currency.js +28 -46
  26. package/common/dialogues.js +150 -426
  27. package/common/dialogues.test.json +0 -786
  28. package/common/dimension.instance.json +491 -262
  29. package/common/dimension.js +22 -24
  30. package/common/dimension.test.json +508 -1702
  31. package/common/edible.instance.json +20446 -10806
  32. package/common/edible.js +4 -9
  33. package/common/emotions.instance.json +192 -124
  34. package/common/emotions.js +36 -39
  35. package/common/evaluate.instance.json +2 -0
  36. package/common/evaluate.js +53 -0
  37. package/common/evaluate.test.json +574 -0
  38. package/common/events.js +11 -15
  39. package/common/fastfood.instance.json +222642 -113618
  40. package/common/fastfood.js +76 -86
  41. package/common/fastfood.test.json +268 -90
  42. package/common/formulas.instance.json +443 -247
  43. package/common/formulas.js +20 -27
  44. package/common/gdefaults.js +40 -27
  45. package/common/help.js +9 -14
  46. package/common/help.test.json +65 -16
  47. package/common/helpers/concept.js +10 -7
  48. package/common/helpers/dialogues.js +5 -3
  49. package/common/helpers/properties.js +67 -64
  50. package/common/helpers.js +35 -24
  51. package/common/hierarchy.js +17 -25
  52. package/common/javascript.js +12 -19
  53. package/common/kirk.instance.json +583 -299
  54. package/common/kirk.js +6 -9
  55. package/common/length.instance.json +9005 -5001
  56. package/common/length.js +5 -9
  57. package/common/listener.js +48 -0
  58. package/common/listener.test.json +104 -0
  59. package/common/math.instance.json +406 -1178
  60. package/common/math.js +17 -21
  61. package/common/meta.js +24 -48
  62. package/common/nameable.instance.json +2 -0
  63. package/common/nameable.js +144 -0
  64. package/common/nameable.test.json +3191 -0
  65. package/common/negation.js +11 -7
  66. package/common/numbers.js +28 -32
  67. package/common/ordering.instance.json +443 -343
  68. package/common/ordering.js +81 -87
  69. package/common/ordinals.instance.json +2 -0
  70. package/common/ordinals.js +60 -0
  71. package/common/ordinals.test.json +306 -0
  72. package/common/people.instance.json +2210 -1150
  73. package/common/people.js +9 -14
  74. package/common/percentages.instance.json +2 -0
  75. package/common/percentages.js +53 -0
  76. package/common/percentages.test.json +751 -0
  77. package/common/pipboy.instance.json +11845 -6590
  78. package/common/pipboy.js +51 -62
  79. package/common/pokemon.instance.json +4300 -2285
  80. package/common/pokemon.js +8 -21
  81. package/common/pos.js +16 -14
  82. package/common/pressure.instance.json +2325 -1340
  83. package/common/pressure.js +5 -9
  84. package/common/properties.instance.json +148 -88
  85. package/common/properties.js +149 -160
  86. package/common/punctuation.js +16 -8
  87. package/common/reports.instance.json +1019 -551
  88. package/common/reports.js +77 -101
  89. package/common/reports.test.json +15623 -10458
  90. package/common/scorekeeper.js +19 -31
  91. package/common/sdefaults.js +17 -8
  92. package/common/sizeable.js +7 -11
  93. package/common/spock.instance.json +582 -298
  94. package/common/spock.js +6 -9
  95. package/common/stgame.js +20 -20
  96. package/common/stm.js +173 -31
  97. package/common/stm.test.json +1734 -1
  98. package/common/tell.js +15 -19
  99. package/common/temperature.instance.json +2430 -1429
  100. package/common/temperature.js +5 -9
  101. package/common/tester.js +15 -4
  102. package/common/testing.js +8 -12
  103. package/common/time.js +21 -26
  104. package/common/tokenize.js +6 -7
  105. package/common/ui.instance.json +150 -463
  106. package/common/ui.js +22 -33
  107. package/common/ui.test.json +641 -5357
  108. package/common/weight.instance.json +8034 -4503
  109. package/common/weight.js +5 -9
  110. package/common/yesno.js +6 -6
  111. package/main.js +20 -4
  112. package/package.json +37 -6
@@ -1,33 +1,37 @@
1
- const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const { words, defaultContextCheck } = require('./helpers')
3
3
  const gdefaults = require('./gdefaults')
4
+ const pos = require('./pos')
4
5
  const negation_tests = require('./negation.test.json')
5
6
 
6
- let configStruct = {
7
+ let config = {
7
8
  name: 'negation',
8
9
  operators: [
9
- "([not] ([negatable]))",
10
+ "([negatable])",
11
+ "([not] (negatable/*))",
10
12
  ],
11
13
  bridges: [
12
14
  {
13
15
  id: 'not',
14
16
  bridge: '{ ...after[0], negated: operator, modifiers: append(["negated"], after[0].modifiers) }',
17
+ before: ['verb'],
18
+ localHierarchy: [['unknown', 'negatable']],
15
19
  },
16
20
  { id: 'negatable', words: words('negatable') },
17
21
  ],
18
22
  };
19
23
 
20
- const createConfig = () => new Config(configStruct, module).add(gdefaults())
21
-
22
24
  knowledgeModule( {
25
+ config,
26
+ includes: [gdefaults, pos],
27
+
23
28
  module,
24
- createConfig,
25
29
  description: 'negation',
26
30
  test: {
27
31
  name: './negation.test.json',
28
32
  contents: negation_tests,
29
33
  checks: {
30
- context: defaultContextCheck,
34
+ context: defaultContextCheck(),
31
35
  },
32
36
  },
33
37
  })
package/common/numbers.js CHANGED
@@ -1,7 +1,8 @@
1
- const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const numbers_tests = require('./numbers.test.json')
4
4
  const gdefaults = require('./gdefaults')
5
+ const sdefaults = require('./sdefaults')
5
6
 
6
7
  /*
7
8
  TODO
@@ -9,39 +10,38 @@ const gdefaults = require('./gdefaults')
9
10
  10 million 300 hundred and fifty
10
11
  */
11
12
 
12
- let configStruct = {
13
+ let config = {
13
14
  name: 'numbers',
14
15
  operators: [
15
16
  "([number])",
16
17
  ],
17
18
  bridges: [
18
- { "id": "number", "level": 0, "bridge": "{ ...next(operator) }" },
19
+ { "id": "number", "level": 0, "bridge": "{ instance: false, ...next(operator) }" },
19
20
  ],
20
21
  debug: false,
21
22
  version: '3',
22
23
  words: {
23
24
  "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 }" }],
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
45
  },
46
46
  patterns: [
47
47
  { "pattern": [{ type: 'digit' }, { repeat: true }], defs: [{id: "number", uuid: '1', initial: "{ value: int(text), instance: true }" }]},
@@ -83,21 +83,17 @@ let configStruct = {
83
83
  ],
84
84
  };
85
85
 
86
- const createConfig = () => {
87
- const config = new Config(configStruct, module)
88
- config.add(gdefaults())
89
- return config
90
- }
91
-
92
86
  knowledgeModule( {
87
+ config,
88
+ includes: [gdefaults, sdefaults],
89
+
93
90
  module,
94
- createConfig,
95
91
  description: 'talking about numbers',
96
92
  test: {
97
93
  name: './numbers.test.json',
98
94
  contents: numbers_tests,
99
95
  checks: {
100
- context: defaultContextCheck,
96
+ context: defaultContextCheck(),
101
97
  },
102
98
 
103
99
  },