ekms 8.0.0-beta.9 → 8.0.0-beta.91
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.
- package/common/animals.instance.json +2915 -1553
- package/common/animals.js +17 -20
- package/common/articles.js +103 -0
- package/common/articles.test.json +310 -0
- package/common/asking.instance.json +2 -0
- package/common/asking.js +253 -0
- package/common/asking.test.json +2290 -0
- package/common/avatar.js +6 -10
- package/common/characters.js +23 -29
- package/common/colors.instance.json +7487 -4114
- package/common/colors.js +5 -9
- package/common/colors.test.json +345 -780
- package/common/comparable.instance.json +1750 -0
- package/common/comparable.js +36 -28
- package/common/comparable.test.json +1196 -2
- package/common/concept.js +121 -119
- package/common/conjunction.instance.json +2 -0
- package/common/conjunction.js +104 -0
- package/common/conjunction.test.json +322 -0
- package/common/countable.js +20 -14
- package/common/countable.test.json +1050 -0
- package/common/crew.instance.json +13553 -7026
- package/common/crew.js +37 -42
- package/common/crew.test.json +714 -452
- package/common/currency.js +28 -46
- package/common/dialogues.js +150 -426
- package/common/dialogues.test.json +0 -786
- package/common/dimension.instance.json +491 -262
- package/common/dimension.js +22 -24
- package/common/dimension.test.json +508 -1702
- package/common/edible.instance.json +20446 -10806
- package/common/edible.js +4 -9
- package/common/emotions.instance.json +192 -124
- package/common/emotions.js +36 -39
- package/common/evaluate.instance.json +2 -0
- package/common/evaluate.js +53 -0
- package/common/evaluate.test.json +574 -0
- package/common/events.js +11 -15
- package/common/fastfood.instance.json +222642 -113618
- package/common/fastfood.js +76 -86
- package/common/fastfood.test.json +268 -90
- package/common/formulas.instance.json +443 -247
- package/common/formulas.js +20 -27
- package/common/gdefaults.js +40 -27
- package/common/help.js +9 -14
- package/common/help.test.json +65 -16
- package/common/helpers/concept.js +10 -7
- package/common/helpers/dialogues.js +5 -3
- package/common/helpers/properties.js +67 -64
- package/common/helpers.js +35 -24
- package/common/hierarchy.js +17 -25
- package/common/javascript.js +12 -19
- package/common/kirk.instance.json +583 -299
- package/common/kirk.js +6 -9
- package/common/length.instance.json +9005 -5001
- package/common/length.js +5 -9
- package/common/listener.js +48 -0
- package/common/listener.test.json +104 -0
- package/common/math.instance.json +406 -1178
- package/common/math.js +17 -21
- package/common/meta.js +24 -48
- package/common/nameable.instance.json +2 -0
- package/common/nameable.js +144 -0
- package/common/nameable.test.json +3191 -0
- package/common/negation.js +11 -7
- package/common/numbers.js +28 -32
- package/common/ordering.instance.json +443 -343
- package/common/ordering.js +81 -87
- package/common/ordinals.instance.json +2 -0
- package/common/ordinals.js +60 -0
- package/common/ordinals.test.json +306 -0
- package/common/people.instance.json +2210 -1150
- package/common/people.js +9 -14
- package/common/percentages.instance.json +2 -0
- package/common/percentages.js +53 -0
- package/common/percentages.test.json +751 -0
- package/common/pipboy.instance.json +11845 -6590
- package/common/pipboy.js +53 -62
- package/common/pipboy.test.json +2835 -0
- package/common/pokemon.instance.json +4300 -2285
- package/common/pokemon.js +8 -21
- package/common/pos.js +16 -14
- package/common/pressure.instance.json +2325 -1340
- package/common/pressure.js +5 -9
- package/common/properties.instance.json +148 -88
- package/common/properties.js +149 -160
- package/common/punctuation.js +16 -8
- package/common/reports.instance.json +1019 -551
- package/common/reports.js +77 -101
- package/common/reports.test.json +15623 -10458
- package/common/scorekeeper.js +19 -31
- package/common/sdefaults.js +17 -8
- package/common/sizeable.js +7 -11
- package/common/spock.instance.json +582 -298
- package/common/spock.js +6 -9
- package/common/stgame.js +20 -20
- package/common/stm.js +173 -31
- package/common/stm.test.json +1734 -1
- package/common/tell.js +15 -19
- package/common/temperature.instance.json +2430 -1429
- package/common/temperature.js +5 -9
- package/common/tester.js +15 -4
- package/common/testing.js +8 -12
- package/common/time.js +21 -26
- package/common/tokenize.js +6 -7
- package/common/ui.instance.json +150 -463
- package/common/ui.js +22 -33
- package/common/ui.test.json +641 -5357
- package/common/weight.instance.json +8034 -4503
- package/common/weight.js +5 -9
- package/common/yesno.js +6 -6
- package/main.js +20 -4
- package/package.json +37 -6
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
|
-
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
|
@@ -74,7 +71,7 @@ knowledgeModule( {
|
|
74
71
|
template,
|
75
72
|
instance: emotions_instance,
|
76
73
|
checks: {
|
77
|
-
context: defaultContextCheck,
|
74
|
+
context: defaultContextCheck(),
|
78
75
|
},
|
79
76
|
|
80
77
|
},
|
@@ -0,0 +1,53 @@
|
|
1
|
+
const { knowledgeModule, ensureTestFile, where, unflatten, flattens } = require('./runtime').theprogrammablemind
|
2
|
+
const { defaultContextCheck } = require('./helpers')
|
3
|
+
const tests = require('./evaluate.test.json')
|
4
|
+
const pos = require('./pos')
|
5
|
+
const gdefaults = require('./gdefaults')
|
6
|
+
|
7
|
+
const config = {
|
8
|
+
name: 'evaluate',
|
9
|
+
operators: [
|
10
|
+
"([evaluate] (value))",
|
11
|
+
{ pattern: "([value1])", development: true },
|
12
|
+
],
|
13
|
+
bridges: [
|
14
|
+
{
|
15
|
+
where: where(),
|
16
|
+
id: 'value1',
|
17
|
+
evaluator: ({context}) => {
|
18
|
+
context.evalue = 'value1 after evaluation'
|
19
|
+
},
|
20
|
+
development: true,
|
21
|
+
},
|
22
|
+
{
|
23
|
+
where: where(),
|
24
|
+
id: 'evaluate',
|
25
|
+
isA: ['verb'],
|
26
|
+
bridge: "{ ...next(operator), postModifiers: ['value'], value: after[0] }",
|
27
|
+
semantic: async ({context, e}) => {
|
28
|
+
context.response = (await e(context.value)).evalue
|
29
|
+
if (context.response) {
|
30
|
+
context.isResponse = true
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
],
|
35
|
+
};
|
36
|
+
|
37
|
+
knowledgeModule({
|
38
|
+
config,
|
39
|
+
includes: [pos, gdefaults],
|
40
|
+
|
41
|
+
module,
|
42
|
+
description: 'Explicit handling of evaluate',
|
43
|
+
test: {
|
44
|
+
name: './evaluate.test.json',
|
45
|
+
contents: tests,
|
46
|
+
include: {
|
47
|
+
words: true,
|
48
|
+
},
|
49
|
+
checks: {
|
50
|
+
context: defaultContextCheck(),
|
51
|
+
},
|
52
|
+
},
|
53
|
+
})
|