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.
- package/common/animals.js +17 -20
- package/common/articles.js +6 -11
- package/common/avatar.js +5 -9
- package/common/characters.js +22 -26
- package/common/colors.instance.json +28 -0
- package/common/colors.js +4 -8
- package/common/comparable.js +5 -9
- package/common/concept.js +120 -124
- package/common/countable.js +5 -9
- package/common/crew.js +36 -41
- package/common/currency.js +25 -43
- package/common/dialogues.js +46 -49
- package/common/dimension.instance.json +8 -8
- package/common/dimension.js +7 -13
- package/common/edible.instance.json +112 -0
- package/common/edible.js +3 -8
- package/common/emotions.js +35 -38
- package/common/evaluate.js +5 -11
- package/common/events.js +6 -10
- package/common/fastfood.instance.json +401 -317
- package/common/fastfood.js +53 -63
- package/common/formulas.instance.json +10 -10
- package/common/formulas.js +7 -14
- package/common/gdefaults.js +8 -10
- package/common/help.js +7 -12
- package/common/hierarchy.js +8 -12
- package/common/javascript.js +7 -14
- package/common/kirk.js +5 -8
- package/common/length.js +4 -8
- package/common/listener.js +5 -11
- package/common/math.instance.json +16 -16
- package/common/math.js +6 -10
- package/common/meta.js +5 -22
- package/common/nameable.js +6 -13
- package/common/negation.js +5 -5
- package/common/numbers.js +5 -9
- package/common/ordering.instance.json +68 -0
- package/common/ordering.js +80 -86
- package/common/people.js +8 -12
- package/common/percentages.js +5 -9
- package/common/pipboy.instance.json +84 -28
- package/common/pipboy.js +7 -15
- package/common/pokemon.js +7 -20
- package/common/pos.js +4 -5
- package/common/pressure.js +4 -8
- package/common/properties.js +6 -12
- package/common/punctuation.js +5 -5
- package/common/reports.instance.json +1 -1
- package/common/reports.js +9 -14
- package/common/scorekeeper.js +8 -12
- package/common/sdefaults.js +4 -5
- package/common/sizeable.js +5 -9
- package/common/spock.js +5 -8
- package/common/stgame.js +18 -23
- package/common/stm.js +9 -15
- package/common/tell.js +9 -13
- package/common/temperature.instance.json +0 -112
- package/common/temperature.js +4 -8
- package/common/tester.js +1 -1
- package/common/testing.js +5 -9
- package/common/time.js +18 -23
- package/common/tokenize.js +4 -5
- package/common/ui.js +6 -12
- package/common/weight.js +4 -8
- package/common/yesno.js +5 -5
- package/package.json +2 -2
package/common/emotions.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
const {
|
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
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
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
|
package/common/evaluate.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
const {
|
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
|
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 {
|
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
|
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,
|