ekms 8.0.0-beta.42 → 8.0.0-beta.43

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. package/common/animals.js +17 -20
  2. package/common/articles.js +6 -11
  3. package/common/avatar.js +5 -9
  4. package/common/characters.js +22 -26
  5. package/common/colors.instance.json +28 -0
  6. package/common/colors.js +4 -8
  7. package/common/comparable.js +5 -9
  8. package/common/concept.js +120 -124
  9. package/common/countable.js +5 -9
  10. package/common/crew.js +36 -41
  11. package/common/currency.js +25 -43
  12. package/common/dialogues.js +46 -49
  13. package/common/dimension.instance.json +8 -8
  14. package/common/dimension.js +7 -13
  15. package/common/edible.instance.json +112 -0
  16. package/common/edible.js +3 -8
  17. package/common/emotions.js +35 -38
  18. package/common/evaluate.js +5 -11
  19. package/common/events.js +6 -10
  20. package/common/fastfood.instance.json +401 -317
  21. package/common/fastfood.js +53 -63
  22. package/common/formulas.instance.json +10 -10
  23. package/common/formulas.js +7 -14
  24. package/common/gdefaults.js +8 -10
  25. package/common/help.js +7 -12
  26. package/common/hierarchy.js +8 -12
  27. package/common/javascript.js +7 -14
  28. package/common/kirk.js +5 -8
  29. package/common/length.js +4 -8
  30. package/common/listener.js +5 -11
  31. package/common/math.instance.json +16 -16
  32. package/common/math.js +6 -10
  33. package/common/meta.js +5 -22
  34. package/common/nameable.js +6 -13
  35. package/common/negation.js +5 -5
  36. package/common/numbers.js +5 -9
  37. package/common/ordering.instance.json +68 -0
  38. package/common/ordering.js +80 -86
  39. package/common/people.js +8 -12
  40. package/common/percentages.js +5 -9
  41. package/common/pipboy.instance.json +84 -28
  42. package/common/pipboy.js +7 -15
  43. package/common/pokemon.js +7 -20
  44. package/common/pos.js +4 -5
  45. package/common/pressure.js +4 -8
  46. package/common/properties.js +6 -12
  47. package/common/punctuation.js +5 -5
  48. package/common/reports.instance.json +1 -1
  49. package/common/reports.js +9 -14
  50. package/common/scorekeeper.js +8 -12
  51. package/common/sdefaults.js +4 -5
  52. package/common/sizeable.js +5 -9
  53. package/common/spock.js +5 -8
  54. package/common/stgame.js +18 -23
  55. package/common/stm.js +9 -15
  56. package/common/tell.js +9 -13
  57. package/common/temperature.instance.json +0 -112
  58. package/common/temperature.js +4 -8
  59. package/common/tester.js +1 -1
  60. package/common/testing.js +5 -9
  61. package/common/time.js +18 -23
  62. package/common/tokenize.js +4 -5
  63. package/common/ui.js +6 -12
  64. package/common/weight.js +4 -8
  65. package/common/yesno.js +5 -5
  66. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- const { Config, knowledgeModule, ensureTestFile, where } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, ensureTestFile, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const hierarchy = require('./hierarchy')
4
4
  ensureTestFile(module, 'emotions', 'test')
@@ -23,49 +23,46 @@ const template ={
23
23
  ],
24
24
  }
25
25
 
26
- const createConfig = async () => {
27
- const config = new Config({
28
- name: 'emotions',
29
- operators: [
30
- "([sentientBeing|])",
31
- "([emotion|])",
32
- ],
33
- bridges: [
34
- { id: 'sentientBeing', level: 0, bridge: '{ ...next(operator) }' },
35
- // just here so it loads and the sentence can make the semantics
36
- // { id: 'feel', level: 0, bridge: '{ ...next(operator) }' },
37
- { id: 'emotion', level: 0, bridge: '{ ...next(operator) }' },
38
- ],
39
- priorities: [
40
- { "context": [['feel', 0], ['means', 0], ], "choose": [0] },
41
- ],
26
+ const config = {
27
+ name: 'emotions',
28
+ operators: [
29
+ "([sentientBeing|])",
30
+ "([emotion|])",
31
+ ],
32
+ bridges: [
33
+ { id: 'sentientBeing', level: 0, bridge: '{ ...next(operator) }' },
34
+ // just here so it loads and the sentence can make the semantics
35
+ // { id: 'feel', level: 0, bridge: '{ ...next(operator) }' },
36
+ { id: 'emotion', level: 0, bridge: '{ ...next(operator) }' },
37
+ ],
38
+ priorities: [
39
+ { "context": [['feel', 0], ['means', 0], ], "choose": [0] },
40
+ ],
42
41
 
43
- hierarchy: [
44
- ['emotion', 'unknown'],
45
- ['sentientBeing', 'unknown'],
46
- ]
47
- }, module)
48
- config.stop_auto_rebuild()
49
- await config.add(hierarchy)
50
- await config.initializer( ({config, apis}) => {
51
- const api = apis('properties')
52
- api.createActionPrefix({
53
- operator: 'feel',
54
- create: ['feel'/*, 'emotion'*/],
55
- before: [{tag: 'sentientBeing', id: 'sentientBeing'}],
56
- after: [{tag: 'emotion', id: 'emotion'}],
57
- doAble: true,
58
- config })
59
- })
60
- await config.restart_auto_rebuild()
61
- //config.load(template, emotions_instance)
62
- return config
42
+ hierarchy: [
43
+ ['emotion', 'unknown'],
44
+ ['sentientBeing', 'unknown'],
45
+ ]
46
+ }
47
+
48
+ const initializer = ({config, apis}) => {
49
+ const api = apis('properties')
50
+ api.createActionPrefix({
51
+ operator: 'feel',
52
+ create: ['feel'/*, 'emotion'*/],
53
+ before: [{tag: 'sentientBeing', id: 'sentientBeing'}],
54
+ after: [{tag: 'emotion', id: 'emotion'}],
55
+ doAble: true,
56
+ config })
63
57
  }
64
58
 
65
59
  knowledgeModule( {
60
+ config,
61
+ includes: [hierarchy],
62
+ initializer,
63
+
66
64
  module,
67
65
  description: 'emotions related concepts',
68
- createConfig,
69
66
  test: {
70
67
  name: './emotions.test.json',
71
68
  contents: emotions_tests
@@ -1,10 +1,10 @@
1
- const { Config, knowledgeModule, ensureTestFile, where, unflatten, flattens } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, ensureTestFile, where, unflatten, flattens } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const tests = require('./evaluate.test.json')
4
4
  const pos = require('./pos')
5
5
  const gdefaults = require('./gdefaults')
6
6
 
7
- const configStruct = {
7
+ const config = {
8
8
  name: 'evaluate',
9
9
  operators: [
10
10
  "([evaluate] (value))",
@@ -30,18 +30,12 @@ const configStruct = {
30
30
  ],
31
31
  };
32
32
 
33
- const createConfig = async () => {
34
- const config = new Config(configStruct, module)
35
- config.stop_auto_rebuild()
36
- await config.add(pos, gdefaults)
37
- await config.restart_auto_rebuild()
38
- return config
39
- }
40
-
41
33
  knowledgeModule({
34
+ config,
35
+ includes: [pos, gdefaults],
36
+
42
37
  module,
43
38
  description: 'Explicit handling of evaluate',
44
- createConfig,
45
39
  test: {
46
40
  name: './evaluate.test.json',
47
41
  contents: tests,
package/common/events.js CHANGED
@@ -1,4 +1,4 @@
1
- const { Config, knowledgeModule, ensureTestFile, where } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, ensureTestFile, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const dialogues = require('./dialogues')
4
4
  const _ = require('lodash')
@@ -19,7 +19,7 @@ class API {
19
19
  }
20
20
  }
21
21
 
22
- let configStruct = {
22
+ let config = {
23
23
  name: 'events',
24
24
  operators: [
25
25
  "([after] ([event]) ([action]))",
@@ -117,17 +117,13 @@ let configStruct = {
117
117
  ],
118
118
  };
119
119
 
120
- const createConfig = async () => {
121
- const config = new Config(configStruct, module)
122
- await config.setApi(new API())
123
- await config.add(dialogues)
124
- return config
125
- }
126
-
127
120
  knowledgeModule({
121
+ config,
122
+ api: () => new API(),
123
+ includes: [dialogues],
124
+
128
125
  module,
129
126
  description: 'do stuff after events',
130
- createConfig,
131
127
  test: {
132
128
  name: './events.test.json',
133
129
  contents: events_tests,