ekms 7.12.8-beta.1 → 7.12.8-beta.10
Sign up to get free protection for your applications and to get access to all the features.
- package/common/animals.instance.json +89 -249
- package/common/animals.js +1 -1
- package/common/avatar.js +7 -5
- package/common/characters.js +12 -5
- package/common/crew.instance.json +289 -577
- package/common/crew.js +1 -1
- package/common/currency.js +0 -2
- package/common/dialogues.js +16 -14
- package/common/dimension.instance.json +13 -13
- package/common/dimension.js +1 -1
- package/common/edible.instance.json +293 -297
- package/common/edible.js +1 -1
- package/common/emotions.instance.json +29 -65
- package/common/emotions.js +1 -1
- package/common/fastfood.instance.json +517 -1473
- package/common/fastfood.js +1 -1
- package/common/formulas.instance.json +9 -9
- package/common/formulas.js +2 -2
- package/common/gdefaults.js +2 -0
- package/common/help.js +7 -2
- package/common/help.test.json +9 -5
- package/common/helpers.js +5 -0
- package/common/javascript.js +8 -6
- package/common/kirk.instance.json +1 -1
- package/common/kirk.js +1 -1
- package/common/length.instance.json +49 -229
- package/common/length.js +1 -1
- package/common/math.instance.json +21 -41
- package/common/math.js +1 -1
- package/common/meta.instance.json +1 -1
- package/common/meta.js +35 -10
- package/common/numbers.js +28 -24
- package/common/ordering.instance.json +37 -101
- package/common/ordering.js +1 -1
- package/common/people.instance.json +50 -78
- package/common/people.js +1 -1
- package/common/pipboy.instance.json +197 -201
- package/common/pipboy.js +1 -1
- package/common/pokemon.instance.json +41 -97
- package/common/pokemon.js +1 -1
- package/common/pressure.instance.json +13 -33
- package/common/pressure.js +1 -1
- package/common/properties.instance.json +21 -49
- package/common/properties.js +13 -8
- package/common/reports.instance.json +7 -63
- package/common/reports.js +9 -7
- package/common/scorekeeper.instance.json +1 -1
- package/common/scorekeeper.js +9 -7
- package/common/spock.instance.json +1 -1
- package/common/spock.js +1 -1
- package/common/tell.js +4 -2
- package/common/temperature.instance.json +17 -133
- package/common/temperature.js +1 -1
- package/common/time.js +36 -20
- package/common/time.test.json +66 -44
- package/common/tokenize.js +46 -0
- package/common/tokenize.test.json +2 -0
- package/common/ui.instance.json +1 -1
- package/common/weight.instance.json +33 -201
- package/common/weight.js +1 -1
- package/main.js +2 -0
- package/package.json +7 -3
package/common/fastfood.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"
|
2
|
+
"configs": [
|
3
3
|
"formulas are concepts",
|
4
4
|
{
|
5
5
|
"name": "formulas",
|
@@ -756,15 +756,15 @@
|
|
756
756
|
},
|
757
757
|
"one": {
|
758
758
|
"number": "many",
|
759
|
+
"value": "formulas",
|
760
|
+
"unknown": true,
|
761
|
+
"text": "formulas",
|
759
762
|
"marker": "unknown",
|
763
|
+
"word": "formulas",
|
760
764
|
"range": {
|
761
765
|
"start": 0,
|
762
766
|
"end": 20
|
763
767
|
},
|
764
|
-
"word": "formulas",
|
765
|
-
"text": "formulas",
|
766
|
-
"value": "formulas",
|
767
|
-
"unknown": true,
|
768
768
|
"dead": true,
|
769
769
|
"types": [
|
770
770
|
"unknown"
|
@@ -772,15 +772,15 @@
|
|
772
772
|
"level": 1
|
773
773
|
},
|
774
774
|
"two": {
|
775
|
+
"value": "concepts",
|
776
|
+
"unknown": true,
|
777
|
+
"text": "concepts",
|
775
778
|
"marker": "unknown",
|
779
|
+
"word": "concepts",
|
776
780
|
"range": {
|
777
781
|
"start": 13,
|
778
782
|
"end": 20
|
779
783
|
},
|
780
|
-
"word": "concepts",
|
781
|
-
"text": "concepts",
|
782
|
-
"value": "concepts",
|
783
|
-
"unknown": true,
|
784
784
|
"dead": true,
|
785
785
|
"types": [
|
786
786
|
"unknown"
|
package/common/formulas.js
CHANGED
@@ -12,7 +12,7 @@ const instance = require('./formulas.instance.json')
|
|
12
12
|
|
13
13
|
/*
|
14
14
|
const template = {
|
15
|
-
|
15
|
+
configs: [
|
16
16
|
// { query: "x equals y + 4", development: true },
|
17
17
|
]
|
18
18
|
}
|
@@ -186,7 +186,7 @@ let configStruct = {
|
|
186
186
|
};
|
187
187
|
|
188
188
|
const template = {
|
189
|
-
|
189
|
+
configs: [
|
190
190
|
"formulas are concepts",
|
191
191
|
configStruct,
|
192
192
|
]
|
package/common/gdefaults.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
const pluralize = require('pluralize')
|
2
2
|
const { defaultContextCheck } = require('./helpers')
|
3
3
|
const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
|
4
|
+
const tokenize = require('./tokenize.js')
|
4
5
|
const gdefaults_tests = require('./gdefaults.test.json')
|
5
6
|
const { isMany } = require('./helpers.js')
|
6
7
|
|
@@ -182,6 +183,7 @@ let configStruct = {
|
|
182
183
|
|
183
184
|
const createConfig = () => {
|
184
185
|
const config = new Config(configStruct, module)
|
186
|
+
config.add(tokenize())
|
185
187
|
config.initializer( ({config}) => {
|
186
188
|
config.addArgs((args) => {
|
187
189
|
return {
|
package/common/help.js
CHANGED
@@ -7,6 +7,9 @@ const helpers = require('./helpers')
|
|
7
7
|
const getHelp = (config, indent=2) => {
|
8
8
|
indent = ' '.repeat(indent)
|
9
9
|
let help = ''
|
10
|
+
if (config.tests.length == 0) {
|
11
|
+
return ''
|
12
|
+
}
|
10
13
|
help += `${indent}NAME: ${config.name}\n`
|
11
14
|
help += `${indent}DESCRIPTION: ${config.description}\n\n`
|
12
15
|
help += `${indent}SAMPLE SENTENCES\n\n`
|
@@ -72,8 +75,10 @@ const configStruct = {
|
|
72
75
|
debug: false,
|
73
76
|
version: '3',
|
74
77
|
words: {
|
75
|
-
|
76
|
-
|
78
|
+
"literals": {
|
79
|
+
// "km1": { "the": [{"id": "the", "initial": "{ modifiers: [] }" }],
|
80
|
+
'km1': [{id: "km", initial: "{ value: 'km1', word: 'km1' }", development: true }],
|
81
|
+
}
|
77
82
|
},
|
78
83
|
};
|
79
84
|
|
package/common/help.test.json
CHANGED
@@ -356,8 +356,9 @@
|
|
356
356
|
"word": "help"
|
357
357
|
}
|
358
358
|
],
|
359
|
+
"developerTest": false,
|
359
360
|
"generatedParenthesized": [
|
360
|
-
"( NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n\n
|
361
|
+
"( NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n\n\n\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n\n\n)"
|
361
362
|
],
|
362
363
|
"metadata": {
|
363
364
|
"opChoices": [
|
@@ -385,7 +386,8 @@
|
|
385
386
|
"pos": "pos2",
|
386
387
|
"punctuation": "punctuation2",
|
387
388
|
"sdefaults": "sdefaults2",
|
388
|
-
"stm": "stm2"
|
389
|
+
"stm": "stm2",
|
390
|
+
"tokenize": "tokenize2"
|
389
391
|
},
|
390
392
|
"namespaced": {
|
391
393
|
"dialogues2": {
|
@@ -411,6 +413,8 @@
|
|
411
413
|
],
|
412
414
|
"variables": {
|
413
415
|
}
|
416
|
+
},
|
417
|
+
"tokenize2": {
|
414
418
|
}
|
415
419
|
},
|
416
420
|
"processed": [
|
@@ -432,11 +436,11 @@
|
|
432
436
|
"value": "help",
|
433
437
|
"word": "help"
|
434
438
|
},
|
435
|
-
"generatedParenthesized": "( NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n\n
|
439
|
+
"generatedParenthesized": "( NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n\n\n\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n\n\n)",
|
436
440
|
"paraphrases": "help",
|
437
441
|
"paraphrasesParenthesized": "(help)",
|
438
442
|
"responses": [
|
439
|
-
" NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n\n
|
443
|
+
" NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n\n\n\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n\n\n"
|
440
444
|
]
|
441
445
|
}
|
442
446
|
]
|
@@ -449,7 +453,7 @@
|
|
449
453
|
],
|
450
454
|
"query": "help",
|
451
455
|
"responses": [
|
452
|
-
" NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n\n
|
456
|
+
" NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n\n\n\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n\n\n"
|
453
457
|
]
|
454
458
|
}
|
455
459
|
]
|
package/common/helpers.js
CHANGED
@@ -33,6 +33,10 @@ const getCount = (context) => {
|
|
33
33
|
}
|
34
34
|
}
|
35
35
|
|
36
|
+
const words = (base, additional = {}) => {
|
37
|
+
return [{ word: pluralize.singular(base), number: 'one', ...additional }, { word: pluralize.plural(base), number: 'many', ...additional }]
|
38
|
+
}
|
39
|
+
|
36
40
|
const isMany = (context) => {
|
37
41
|
if (((context || {}).value || {}).marker == 'list' && (((context || {}).value || {}).value || []).length > 1) {
|
38
42
|
return true
|
@@ -160,6 +164,7 @@ module.exports = {
|
|
160
164
|
chooseNumber,
|
161
165
|
zip,
|
162
166
|
focus,
|
167
|
+
words,
|
163
168
|
propertyToArray,
|
164
169
|
wordNumber,
|
165
170
|
}
|
package/common/javascript.js
CHANGED
@@ -18,12 +18,14 @@ let configStruct = {
|
|
18
18
|
debug: false,
|
19
19
|
version: '3',
|
20
20
|
words: {
|
21
|
-
"
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
"literals": {
|
22
|
+
"=": [{"id": "assignment", "initial": "{ value: 1 }" }],
|
23
|
+
/*
|
24
|
+
" ([0-9]+)": [{"id": "number", "initial": "{ value: int(group[0]) }" }],
|
25
|
+
"one": [{"id": "number", "initial": "{ value: 1 }" }],
|
26
|
+
"ten": [{"id": "number", "initial": "{ value: 10 }" }],
|
27
|
+
*/
|
28
|
+
}
|
27
29
|
},
|
28
30
|
|
29
31
|
hierarchy: [
|