tpmkms 9.5.1-beta.11 → 9.5.1-beta.14
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/can.instance.json +2168 -5
- package/common/can.js +99 -35
- package/common/colors.instance.json +28 -0
- package/common/crew.instance.json +138 -124
- package/common/dates.instance.json +84 -0
- package/common/dialogues.js +12 -9
- package/common/dimension.instance.json +15 -11
- package/common/dimension.js +23 -4
- package/common/dimension.test.json +1758 -2351
- package/common/edible.instance.json +56 -0
- package/common/emotions.instance.json +47 -70
- package/common/fastfood.instance.json +542 -210
- package/common/gdefaults.js +49 -10
- package/common/help.test.json +65 -11
- package/common/helpers/properties.js +32 -12
- package/common/hierarchy.js +1 -0
- package/common/latin.instance.json +10 -10
- package/common/latin.js +5 -5
- package/common/length.instance.json +18 -0
- package/common/length.test.json +2241 -1801
- package/common/ordering.instance.json +4 -2
- package/common/people.instance.json +54 -1
- package/common/pipboy.instance.json +56 -0
- package/common/pressure.instance.json +4 -0
- package/common/properties.instance.json +3 -11
- package/common/reports.instance.json +2 -2
- package/common/temperature.instance.json +4 -0
- package/common/weight.instance.json +17 -0
- package/common/words.instance.json +2 -0
- package/common/words.js +53 -0
- package/common/words.test.json +2 -0
- package/common/wp.instance.json +56 -0
- package/main.js +0 -2
- package/package.json +6 -5
- package/common/listener.js +0 -50
- package/common/listener.test.json +0 -142
package/common/words.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const { knowledgeModule, where } = require('./runtime').theprogrammablemind
|
|
2
|
+
const { defaultContextCheck } = require('./helpers')
|
|
3
|
+
const words_tests = require('./words.test.json')
|
|
4
|
+
const words_instance = require('./words.instance.json')
|
|
5
|
+
const tokenize = require('./tokenize')
|
|
6
|
+
|
|
7
|
+
function initializer({objects, config, isModule}) {
|
|
8
|
+
objects.words = []
|
|
9
|
+
config.addArgs((args) => ({
|
|
10
|
+
getWordFromDictionary: (partial) => {
|
|
11
|
+
for (const word of objects.words) {
|
|
12
|
+
let matches = true
|
|
13
|
+
for (const key in partial) {
|
|
14
|
+
if (partial[key] !== word[key]) {
|
|
15
|
+
matches = false
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (matches) {
|
|
19
|
+
return word
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
addWordToDictionary: (context) => {
|
|
24
|
+
objects.words.push(context)
|
|
25
|
+
}
|
|
26
|
+
}))
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const template = {
|
|
30
|
+
configs: [],
|
|
31
|
+
fragments: [],
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
knowledgeModule( {
|
|
35
|
+
config: { name: 'words' },
|
|
36
|
+
includes: [tokenize],
|
|
37
|
+
initializer,
|
|
38
|
+
|
|
39
|
+
module,
|
|
40
|
+
description: 'talking about words',
|
|
41
|
+
test: {
|
|
42
|
+
name: './words.test.json',
|
|
43
|
+
contents: words_tests,
|
|
44
|
+
checks: {
|
|
45
|
+
context: [defaultContextCheck()],
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
template: {
|
|
49
|
+
template,
|
|
50
|
+
instance: words_instance,
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
})
|
package/common/wp.instance.json
CHANGED
|
@@ -24903,6 +24903,20 @@
|
|
|
24903
24903
|
0
|
|
24904
24904
|
]
|
|
24905
24905
|
],
|
|
24906
|
+
[
|
|
24907
|
+
[
|
|
24908
|
+
"is",
|
|
24909
|
+
0
|
|
24910
|
+
],
|
|
24911
|
+
[
|
|
24912
|
+
"list",
|
|
24913
|
+
1
|
|
24914
|
+
],
|
|
24915
|
+
[
|
|
24916
|
+
"unknown",
|
|
24917
|
+
0
|
|
24918
|
+
]
|
|
24919
|
+
],
|
|
24906
24920
|
[
|
|
24907
24921
|
[
|
|
24908
24922
|
"is",
|
|
@@ -48293,6 +48307,20 @@
|
|
|
48293
48307
|
0
|
|
48294
48308
|
]
|
|
48295
48309
|
],
|
|
48310
|
+
[
|
|
48311
|
+
[
|
|
48312
|
+
"is",
|
|
48313
|
+
0
|
|
48314
|
+
],
|
|
48315
|
+
[
|
|
48316
|
+
"list",
|
|
48317
|
+
1
|
|
48318
|
+
],
|
|
48319
|
+
[
|
|
48320
|
+
"unknown",
|
|
48321
|
+
0
|
|
48322
|
+
]
|
|
48323
|
+
],
|
|
48296
48324
|
[
|
|
48297
48325
|
[
|
|
48298
48326
|
"is",
|
|
@@ -55003,6 +55031,34 @@
|
|
|
55003
55031
|
0
|
|
55004
55032
|
]
|
|
55005
55033
|
],
|
|
55034
|
+
[
|
|
55035
|
+
[
|
|
55036
|
+
"is",
|
|
55037
|
+
0
|
|
55038
|
+
],
|
|
55039
|
+
[
|
|
55040
|
+
"list",
|
|
55041
|
+
1
|
|
55042
|
+
],
|
|
55043
|
+
[
|
|
55044
|
+
"unknown",
|
|
55045
|
+
0
|
|
55046
|
+
]
|
|
55047
|
+
],
|
|
55048
|
+
[
|
|
55049
|
+
[
|
|
55050
|
+
"is",
|
|
55051
|
+
0
|
|
55052
|
+
],
|
|
55053
|
+
[
|
|
55054
|
+
"list",
|
|
55055
|
+
1
|
|
55056
|
+
],
|
|
55057
|
+
[
|
|
55058
|
+
"unknown",
|
|
55059
|
+
0
|
|
55060
|
+
]
|
|
55061
|
+
],
|
|
55006
55062
|
[
|
|
55007
55063
|
[
|
|
55008
55064
|
"is",
|
package/main.js
CHANGED
|
@@ -24,7 +24,6 @@ const ordinals = require('./common/ordinals')
|
|
|
24
24
|
const properties = require('./common/properties')
|
|
25
25
|
const sizeable = require('./common/sizeable')
|
|
26
26
|
const dateTimeSelectors = require('./common/dateTimeSelectors')
|
|
27
|
-
const listener = require('./common/listener')
|
|
28
27
|
const tokenize = require('./common/tokenize')
|
|
29
28
|
const articles = require('./common/articles')
|
|
30
29
|
const nameable = require('./common/nameable')
|
|
@@ -90,7 +89,6 @@ module.exports = {
|
|
|
90
89
|
properties,
|
|
91
90
|
sizeable,
|
|
92
91
|
dateTimeSelectors,
|
|
93
|
-
listener,
|
|
94
92
|
tokenize,
|
|
95
93
|
articles,
|
|
96
94
|
nameable,
|
package/package.json
CHANGED
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
"name": "Hidden",
|
|
57
57
|
"description": "Don't show in the UI",
|
|
58
58
|
"includes": [
|
|
59
|
-
"listener",
|
|
60
59
|
"tokenize"
|
|
61
60
|
]
|
|
62
61
|
},
|
|
@@ -245,8 +244,6 @@
|
|
|
245
244
|
"common/length.instance.json",
|
|
246
245
|
"common/length.js",
|
|
247
246
|
"common/length.test.json",
|
|
248
|
-
"common/listener.js",
|
|
249
|
-
"common/listener.test.json",
|
|
250
247
|
"common/math.instance.json",
|
|
251
248
|
"common/math.js",
|
|
252
249
|
"common/math.test.json",
|
|
@@ -336,6 +333,9 @@
|
|
|
336
333
|
"common/weight.instance.json",
|
|
337
334
|
"common/weight.js",
|
|
338
335
|
"common/weight.test.json",
|
|
336
|
+
"common/words.instance.json",
|
|
337
|
+
"common/words.js",
|
|
338
|
+
"common/words.test.json",
|
|
339
339
|
"common/wp.instance.json",
|
|
340
340
|
"common/wp.js",
|
|
341
341
|
"common/wp.test.json",
|
|
@@ -350,14 +350,15 @@
|
|
|
350
350
|
"bluebird": "^3.7.2",
|
|
351
351
|
"deep-equal": "^2.0.5",
|
|
352
352
|
"lodash": "^4.17.21",
|
|
353
|
+
"lokijs": "^1.5.12",
|
|
353
354
|
"node-fetch": "^2.6.1",
|
|
354
355
|
"object-path": "^0.11.8",
|
|
355
356
|
"pluralize": "^8.0.0",
|
|
356
357
|
"scriptjs": "^2.5.9",
|
|
357
358
|
"table": "^6.7.1",
|
|
358
359
|
"uuid": "^9.0.0",
|
|
359
|
-
"theprogrammablemind": "9.5.1-beta.
|
|
360
|
+
"theprogrammablemind": "9.5.1-beta.14"
|
|
360
361
|
},
|
|
361
|
-
"version": "9.5.1-beta.
|
|
362
|
+
"version": "9.5.1-beta.14",
|
|
362
363
|
"license": "UNLICENSED"
|
|
363
364
|
}
|
package/common/listener.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
const { knowledgeModule, where } = require('./runtime').theprogrammablemind
|
|
2
|
-
const { defaultContextCheck } = require('./helpers')
|
|
3
|
-
const helpers = require('./helpers')
|
|
4
|
-
const gdefaults = require('./gdefaults')
|
|
5
|
-
const listener_tests = require('./listener.test.json')
|
|
6
|
-
|
|
7
|
-
const config = {
|
|
8
|
-
name: 'listener',
|
|
9
|
-
operators: [
|
|
10
|
-
{ pattern: "([call])", scope: "testing" },
|
|
11
|
-
],
|
|
12
|
-
bridges: [
|
|
13
|
-
{
|
|
14
|
-
id: 'call',
|
|
15
|
-
semantic: ({context}) => {
|
|
16
|
-
context.wasCalled = true
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
semantics: [
|
|
21
|
-
{
|
|
22
|
-
match: ({context}) => context.marker == 'call',
|
|
23
|
-
apply: ({context, defer}) => {
|
|
24
|
-
defer(({context}) => {
|
|
25
|
-
if (context.wasCalled) {
|
|
26
|
-
context.sawWasCalled = true
|
|
27
|
-
}
|
|
28
|
-
})
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
knowledgeModule( {
|
|
35
|
-
config,
|
|
36
|
-
includes: [gdefaults],
|
|
37
|
-
|
|
38
|
-
module,
|
|
39
|
-
description: 'test of listeners',
|
|
40
|
-
test: {
|
|
41
|
-
name: './listener.test.json',
|
|
42
|
-
contents: listener_tests,
|
|
43
|
-
checks: {
|
|
44
|
-
context: [
|
|
45
|
-
defaultContextCheck(),
|
|
46
|
-
],
|
|
47
|
-
objects: ['mentioned', { km: 'gdefaults' }],
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
})
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"associations": [
|
|
4
|
-
],
|
|
5
|
-
"config": {
|
|
6
|
-
},
|
|
7
|
-
"contexts": [
|
|
8
|
-
{
|
|
9
|
-
"context_index": 1,
|
|
10
|
-
"dead": true,
|
|
11
|
-
"default": true,
|
|
12
|
-
"level": 1,
|
|
13
|
-
"marker": "call",
|
|
14
|
-
"range": {
|
|
15
|
-
"end": 3,
|
|
16
|
-
"start": 0
|
|
17
|
-
},
|
|
18
|
-
"sawWasCalled": true,
|
|
19
|
-
"text": "call",
|
|
20
|
-
"topLevel": true,
|
|
21
|
-
"touchedBy": [
|
|
22
|
-
"listener#call2"
|
|
23
|
-
],
|
|
24
|
-
"value": "call",
|
|
25
|
-
"wasCalled": true,
|
|
26
|
-
"word": "call"
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
"generatedParenthesized": [
|
|
30
|
-
""
|
|
31
|
-
],
|
|
32
|
-
"metadata": {
|
|
33
|
-
"opChoices": [
|
|
34
|
-
{
|
|
35
|
-
"counter": 1,
|
|
36
|
-
"op": [
|
|
37
|
-
"call",
|
|
38
|
-
0
|
|
39
|
-
],
|
|
40
|
-
"ops": [
|
|
41
|
-
[
|
|
42
|
-
"call",
|
|
43
|
-
0
|
|
44
|
-
]
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
]
|
|
48
|
-
},
|
|
49
|
-
"objects": {
|
|
50
|
-
"nameToUUID": {
|
|
51
|
-
"gdefaults": "gdefaults2",
|
|
52
|
-
"listener": "listener1",
|
|
53
|
-
"tokenize": "tokenize2"
|
|
54
|
-
},
|
|
55
|
-
"namespaced": {
|
|
56
|
-
"gdefaults2": {
|
|
57
|
-
},
|
|
58
|
-
"listener1": {
|
|
59
|
-
},
|
|
60
|
-
"tokenize2": {
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
"processed": [
|
|
64
|
-
{
|
|
65
|
-
"context": {
|
|
66
|
-
"context_index": 1,
|
|
67
|
-
"dead": true,
|
|
68
|
-
"default": true,
|
|
69
|
-
"level": 1,
|
|
70
|
-
"marker": "call",
|
|
71
|
-
"range": {
|
|
72
|
-
"end": 3,
|
|
73
|
-
"start": 0
|
|
74
|
-
},
|
|
75
|
-
"sawWasCalled": true,
|
|
76
|
-
"text": "call",
|
|
77
|
-
"topLevel": true,
|
|
78
|
-
"touchedBy": [
|
|
79
|
-
"listener#call2"
|
|
80
|
-
],
|
|
81
|
-
"value": "call",
|
|
82
|
-
"wasCalled": true,
|
|
83
|
-
"word": "call"
|
|
84
|
-
},
|
|
85
|
-
"generatedParenthesized": "",
|
|
86
|
-
"paraphrases": "call",
|
|
87
|
-
"paraphrasesParenthesized": "(call)",
|
|
88
|
-
"responses": [
|
|
89
|
-
""
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
]
|
|
93
|
-
},
|
|
94
|
-
"paraphrases": [
|
|
95
|
-
"call"
|
|
96
|
-
],
|
|
97
|
-
"paraphrasesParenthesized": [
|
|
98
|
-
"(call)"
|
|
99
|
-
],
|
|
100
|
-
"query": "call",
|
|
101
|
-
"responses": [
|
|
102
|
-
""
|
|
103
|
-
],
|
|
104
|
-
"summaries": [
|
|
105
|
-
{
|
|
106
|
-
"length": 1,
|
|
107
|
-
"summaries": [
|
|
108
|
-
{
|
|
109
|
-
"counter": 1,
|
|
110
|
-
"operators": [
|
|
111
|
-
{
|
|
112
|
-
"marker": [
|
|
113
|
-
"call",
|
|
114
|
-
0
|
|
115
|
-
],
|
|
116
|
-
"range": {
|
|
117
|
-
"end": 3,
|
|
118
|
-
"start": 0
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
]
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
"counter": 2,
|
|
125
|
-
"operators": [
|
|
126
|
-
{
|
|
127
|
-
"marker": [
|
|
128
|
-
"call",
|
|
129
|
-
1
|
|
130
|
-
],
|
|
131
|
-
"range": {
|
|
132
|
-
"end": 3,
|
|
133
|
-
"start": 0
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
]
|
|
137
|
-
}
|
|
138
|
-
]
|
|
139
|
-
}
|
|
140
|
-
]
|
|
141
|
-
}
|
|
142
|
-
]
|