ekms 8.0.0-beta.6 → 8.0.0-beta.9
Sign up to get free protection for your applications and to get access to all the features.
- package/common/negation.instance.json +2 -0
- package/common/negation.js +34 -0
- package/common/negation.test.json +308 -0
- package/main.js +48 -45
- package/package.json +7 -3
@@ -0,0 +1,34 @@
|
|
1
|
+
const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
|
2
|
+
const { words, defaultContextCheck } = require('./helpers')
|
3
|
+
const gdefaults = require('./gdefaults')
|
4
|
+
const negation_tests = require('./negation.test.json')
|
5
|
+
|
6
|
+
let configStruct = {
|
7
|
+
name: 'negation',
|
8
|
+
operators: [
|
9
|
+
"([not] ([negatable]))",
|
10
|
+
],
|
11
|
+
bridges: [
|
12
|
+
{
|
13
|
+
id: 'not',
|
14
|
+
bridge: '{ ...after[0], negated: operator, modifiers: append(["negated"], after[0].modifiers) }',
|
15
|
+
},
|
16
|
+
{ id: 'negatable', words: words('negatable') },
|
17
|
+
],
|
18
|
+
};
|
19
|
+
|
20
|
+
const createConfig = () => new Config(configStruct, module).add(gdefaults())
|
21
|
+
|
22
|
+
knowledgeModule( {
|
23
|
+
module,
|
24
|
+
createConfig,
|
25
|
+
description: 'negation',
|
26
|
+
test: {
|
27
|
+
name: './negation.test.json',
|
28
|
+
contents: negation_tests,
|
29
|
+
checks: {
|
30
|
+
context: defaultContextCheck,
|
31
|
+
},
|
32
|
+
},
|
33
|
+
})
|
34
|
+
|
@@ -0,0 +1,308 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"associations": [
|
4
|
+
[
|
5
|
+
[
|
6
|
+
"negatable",
|
7
|
+
0
|
8
|
+
],
|
9
|
+
[
|
10
|
+
"not",
|
11
|
+
0
|
12
|
+
]
|
13
|
+
]
|
14
|
+
],
|
15
|
+
"config": {
|
16
|
+
},
|
17
|
+
"contexts": [
|
18
|
+
{
|
19
|
+
"dead": true,
|
20
|
+
"level": 1,
|
21
|
+
"marker": "negatable",
|
22
|
+
"modifiers": [
|
23
|
+
"negated"
|
24
|
+
],
|
25
|
+
"negated": {
|
26
|
+
"default": true,
|
27
|
+
"level": 0,
|
28
|
+
"marker": "not",
|
29
|
+
"range": {
|
30
|
+
"end": 2,
|
31
|
+
"start": 0
|
32
|
+
},
|
33
|
+
"text": "not",
|
34
|
+
"value": "not",
|
35
|
+
"word": "not"
|
36
|
+
},
|
37
|
+
"number": "one",
|
38
|
+
"range": {
|
39
|
+
"end": 12,
|
40
|
+
"start": 0
|
41
|
+
},
|
42
|
+
"text": "not negatable",
|
43
|
+
"topLevel": true,
|
44
|
+
"types": [
|
45
|
+
"negatable"
|
46
|
+
],
|
47
|
+
"word": "negatable"
|
48
|
+
}
|
49
|
+
],
|
50
|
+
"developerTest": false,
|
51
|
+
"generatedParenthesized": [
|
52
|
+
""
|
53
|
+
],
|
54
|
+
"metadata": {
|
55
|
+
"opChoices": [
|
56
|
+
{
|
57
|
+
"counter": 1,
|
58
|
+
"op": [
|
59
|
+
"negatable",
|
60
|
+
0
|
61
|
+
],
|
62
|
+
"ops": [
|
63
|
+
[
|
64
|
+
"negatable",
|
65
|
+
0
|
66
|
+
],
|
67
|
+
[
|
68
|
+
"not",
|
69
|
+
0
|
70
|
+
]
|
71
|
+
]
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"counter": 2,
|
75
|
+
"op": [
|
76
|
+
"not",
|
77
|
+
0
|
78
|
+
],
|
79
|
+
"ops": [
|
80
|
+
[
|
81
|
+
"not",
|
82
|
+
0
|
83
|
+
]
|
84
|
+
]
|
85
|
+
}
|
86
|
+
]
|
87
|
+
},
|
88
|
+
"objects": {
|
89
|
+
"nameToUUID": {
|
90
|
+
"gdefaults": "gdefaults2",
|
91
|
+
"negation": "negation1",
|
92
|
+
"tokenize": "tokenize2"
|
93
|
+
},
|
94
|
+
"namespaced": {
|
95
|
+
"gdefaults2": {
|
96
|
+
},
|
97
|
+
"negation1": {
|
98
|
+
},
|
99
|
+
"tokenize2": {
|
100
|
+
}
|
101
|
+
},
|
102
|
+
"processed": [
|
103
|
+
{
|
104
|
+
"context": {
|
105
|
+
"dead": true,
|
106
|
+
"level": 1,
|
107
|
+
"marker": "negatable",
|
108
|
+
"modifiers": [
|
109
|
+
"negated"
|
110
|
+
],
|
111
|
+
"negated": {
|
112
|
+
"default": true,
|
113
|
+
"level": 0,
|
114
|
+
"marker": "not",
|
115
|
+
"range": {
|
116
|
+
"end": 2,
|
117
|
+
"start": 0
|
118
|
+
},
|
119
|
+
"text": "not",
|
120
|
+
"value": "not",
|
121
|
+
"word": "not"
|
122
|
+
},
|
123
|
+
"number": "one",
|
124
|
+
"range": {
|
125
|
+
"end": 12,
|
126
|
+
"start": 0
|
127
|
+
},
|
128
|
+
"text": "not negatable",
|
129
|
+
"topLevel": true,
|
130
|
+
"types": [
|
131
|
+
"negatable"
|
132
|
+
],
|
133
|
+
"word": "negatable"
|
134
|
+
},
|
135
|
+
"generatedParenthesized": "",
|
136
|
+
"paraphrases": "not negatable",
|
137
|
+
"paraphrasesParenthesized": "((not) (negatable))",
|
138
|
+
"responses": [
|
139
|
+
""
|
140
|
+
]
|
141
|
+
}
|
142
|
+
]
|
143
|
+
},
|
144
|
+
"paraphrases": [
|
145
|
+
"not negatable"
|
146
|
+
],
|
147
|
+
"paraphrasesParenthesized": [
|
148
|
+
"((not) (negatable))"
|
149
|
+
],
|
150
|
+
"query": "not negatable",
|
151
|
+
"responses": [
|
152
|
+
""
|
153
|
+
]
|
154
|
+
},
|
155
|
+
{
|
156
|
+
"associations": [
|
157
|
+
[
|
158
|
+
[
|
159
|
+
"negatable",
|
160
|
+
0
|
161
|
+
],
|
162
|
+
[
|
163
|
+
"not",
|
164
|
+
0
|
165
|
+
]
|
166
|
+
]
|
167
|
+
],
|
168
|
+
"config": {
|
169
|
+
},
|
170
|
+
"contexts": [
|
171
|
+
{
|
172
|
+
"dead": true,
|
173
|
+
"level": 1,
|
174
|
+
"marker": "negatable",
|
175
|
+
"modifiers": [
|
176
|
+
"negated"
|
177
|
+
],
|
178
|
+
"negated": {
|
179
|
+
"default": true,
|
180
|
+
"level": 0,
|
181
|
+
"marker": "not",
|
182
|
+
"range": {
|
183
|
+
"end": 2,
|
184
|
+
"start": 0
|
185
|
+
},
|
186
|
+
"text": "not",
|
187
|
+
"value": "not",
|
188
|
+
"word": "not"
|
189
|
+
},
|
190
|
+
"number": "many",
|
191
|
+
"range": {
|
192
|
+
"end": 13,
|
193
|
+
"start": 0
|
194
|
+
},
|
195
|
+
"text": "not negatables",
|
196
|
+
"topLevel": true,
|
197
|
+
"types": [
|
198
|
+
"negatable"
|
199
|
+
],
|
200
|
+
"word": "negatables"
|
201
|
+
}
|
202
|
+
],
|
203
|
+
"developerTest": false,
|
204
|
+
"generatedParenthesized": [
|
205
|
+
""
|
206
|
+
],
|
207
|
+
"metadata": {
|
208
|
+
"opChoices": [
|
209
|
+
{
|
210
|
+
"counter": 1,
|
211
|
+
"op": [
|
212
|
+
"negatable",
|
213
|
+
0
|
214
|
+
],
|
215
|
+
"ops": [
|
216
|
+
[
|
217
|
+
"negatable",
|
218
|
+
0
|
219
|
+
],
|
220
|
+
[
|
221
|
+
"not",
|
222
|
+
0
|
223
|
+
]
|
224
|
+
]
|
225
|
+
},
|
226
|
+
{
|
227
|
+
"counter": 2,
|
228
|
+
"op": [
|
229
|
+
"not",
|
230
|
+
0
|
231
|
+
],
|
232
|
+
"ops": [
|
233
|
+
[
|
234
|
+
"not",
|
235
|
+
0
|
236
|
+
]
|
237
|
+
]
|
238
|
+
}
|
239
|
+
]
|
240
|
+
},
|
241
|
+
"objects": {
|
242
|
+
"nameToUUID": {
|
243
|
+
"gdefaults": "gdefaults2",
|
244
|
+
"negation": "negation1",
|
245
|
+
"tokenize": "tokenize2"
|
246
|
+
},
|
247
|
+
"namespaced": {
|
248
|
+
"gdefaults2": {
|
249
|
+
},
|
250
|
+
"negation1": {
|
251
|
+
},
|
252
|
+
"tokenize2": {
|
253
|
+
}
|
254
|
+
},
|
255
|
+
"processed": [
|
256
|
+
{
|
257
|
+
"context": {
|
258
|
+
"dead": true,
|
259
|
+
"level": 1,
|
260
|
+
"marker": "negatable",
|
261
|
+
"modifiers": [
|
262
|
+
"negated"
|
263
|
+
],
|
264
|
+
"negated": {
|
265
|
+
"default": true,
|
266
|
+
"level": 0,
|
267
|
+
"marker": "not",
|
268
|
+
"range": {
|
269
|
+
"end": 2,
|
270
|
+
"start": 0
|
271
|
+
},
|
272
|
+
"text": "not",
|
273
|
+
"value": "not",
|
274
|
+
"word": "not"
|
275
|
+
},
|
276
|
+
"number": "many",
|
277
|
+
"range": {
|
278
|
+
"end": 13,
|
279
|
+
"start": 0
|
280
|
+
},
|
281
|
+
"text": "not negatables",
|
282
|
+
"topLevel": true,
|
283
|
+
"types": [
|
284
|
+
"negatable"
|
285
|
+
],
|
286
|
+
"word": "negatables"
|
287
|
+
},
|
288
|
+
"generatedParenthesized": "",
|
289
|
+
"paraphrases": "not negatables",
|
290
|
+
"paraphrasesParenthesized": "((not) (negatables))",
|
291
|
+
"responses": [
|
292
|
+
""
|
293
|
+
]
|
294
|
+
}
|
295
|
+
]
|
296
|
+
},
|
297
|
+
"paraphrases": [
|
298
|
+
"not negatables"
|
299
|
+
],
|
300
|
+
"paraphrasesParenthesized": [
|
301
|
+
"((not) (negatables))"
|
302
|
+
],
|
303
|
+
"query": "not negatables",
|
304
|
+
"responses": [
|
305
|
+
""
|
306
|
+
]
|
307
|
+
}
|
308
|
+
]
|
package/main.js
CHANGED
@@ -16,6 +16,7 @@ const ordering = require('./common/ordering')
|
|
16
16
|
const properties = require('./common/properties')
|
17
17
|
const sizeable = require('./common/sizeable')
|
18
18
|
const yesno = require('./common/yesno')
|
19
|
+
const negation = require('./common/negation')
|
19
20
|
const tokenize = require('./common/tokenize')
|
20
21
|
const dialogues = require('./common/dialogues')
|
21
22
|
const gdefaults = require('./common/gdefaults')
|
@@ -47,50 +48,52 @@ const kirk = require('./common/kirk')
|
|
47
48
|
const spock = require('./common/spock')
|
48
49
|
|
49
50
|
module.exports = {
|
50
|
-
Config: tpm.Config,
|
51
|
+
Config: tpm.Config,
|
52
|
+
helpers,
|
51
53
|
defaultContextCheck: helpers.defaultContextCheck,
|
52
|
-
currency,
|
53
|
-
numbers,
|
54
|
-
colors,
|
55
|
-
people,
|
56
|
-
time,
|
57
|
-
avatar,
|
58
|
-
comparable,
|
59
|
-
concept,
|
60
|
-
countable,
|
61
|
-
help,
|
62
|
-
hierarchy,
|
63
|
-
ordering,
|
64
|
-
properties,
|
65
|
-
sizeable,
|
66
|
-
yesno,
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
54
|
+
currency,
|
55
|
+
numbers,
|
56
|
+
colors,
|
57
|
+
people,
|
58
|
+
time,
|
59
|
+
avatar,
|
60
|
+
comparable,
|
61
|
+
concept,
|
62
|
+
countable,
|
63
|
+
help,
|
64
|
+
hierarchy,
|
65
|
+
ordering,
|
66
|
+
properties,
|
67
|
+
sizeable,
|
68
|
+
yesno,
|
69
|
+
negation,
|
70
|
+
tokenize,
|
71
|
+
dialogues,
|
72
|
+
gdefaults,
|
73
|
+
meta,
|
74
|
+
pos,
|
75
|
+
punctuation,
|
76
|
+
stm,
|
77
|
+
sdefaults,
|
78
|
+
ui,
|
79
|
+
math,
|
80
|
+
formulas,
|
81
|
+
dimension,
|
82
|
+
length,
|
83
|
+
pressure,
|
84
|
+
temperature,
|
85
|
+
weight,
|
86
|
+
animals,
|
87
|
+
edible,
|
88
|
+
javascript,
|
89
|
+
scorekeeper,
|
90
|
+
reports,
|
91
|
+
tell,
|
92
|
+
pipboy,
|
93
|
+
fastfood,
|
94
|
+
characters,
|
95
|
+
crew,
|
96
|
+
stgame,
|
97
|
+
kirk,
|
98
|
+
spock,
|
96
99
|
}
|
package/package.json
CHANGED
@@ -36,7 +36,8 @@
|
|
36
36
|
"ordering",
|
37
37
|
"properties",
|
38
38
|
"sizeable",
|
39
|
-
"yesno"
|
39
|
+
"yesno",
|
40
|
+
"negation"
|
40
41
|
]
|
41
42
|
},
|
42
43
|
{
|
@@ -194,6 +195,9 @@
|
|
194
195
|
"common/meta.instance.json",
|
195
196
|
"common/meta.js",
|
196
197
|
"common/meta.test.json",
|
198
|
+
"common/negation.instance.json",
|
199
|
+
"common/negation.js",
|
200
|
+
"common/negation.test.json",
|
197
201
|
"common/numbers.js",
|
198
202
|
"common/numbers.test.json",
|
199
203
|
"common/ordering.instance.json",
|
@@ -272,8 +276,8 @@
|
|
272
276
|
"table": "^6.7.1",
|
273
277
|
"base-64": "^1.0.0",
|
274
278
|
"argparse": "^2.0.1",
|
275
|
-
"theprogrammablemind": "8.0.0-beta.
|
279
|
+
"theprogrammablemind": "8.0.0-beta.9"
|
276
280
|
},
|
277
|
-
"version": "8.0.0-beta.
|
281
|
+
"version": "8.0.0-beta.9",
|
278
282
|
"license": "UNLICENSED"
|
279
283
|
}
|