tpmkms 7.12.8 → 8.0.0
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 +89 -293
- 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 +122 -17
- package/common/dimension.instance.json +747 -73
- package/common/dimension.js +15 -7
- package/common/edible.instance.json +243 -435
- package/common/edible.js +1 -1
- package/common/emotions.instance.json +29 -65
- package/common/emotions.js +1 -1
- package/common/fastfood.instance.json +1080 -2072
- package/common/fastfood.js +1 -1
- package/common/formulas.instance.json +992 -0
- package/common/formulas.js +19 -6
- package/common/formulas.test.json +1187 -3651
- 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 +316 -740
- package/common/length.js +1 -1
- package/common/math.instance.json +1959 -1
- package/common/math.js +17 -5
- 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 -153
- package/common/ordering.js +1 -1
- package/common/people.instance.json +50 -78
- package/common/people.js +1 -1
- package/common/pipboy.instance.json +23431 -1082
- package/common/pipboy.js +31 -4
- package/common/pipboy.test.json +13 -9
- package/common/pokemon.instance.json +41 -141
- package/common/pokemon.js +1 -1
- package/common/pressure.instance.json +93 -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 +23 -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 +97 -193
- 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/ui.instance.json +9 -1
- package/common/weight.instance.json +273 -217
- package/common/weight.js +1 -1
- package/main.js +2 -8
- package/package.json +6 -18
- package/common/dimensionTemplate.instance.json +0 -582
- package/common/dimensionTemplate.js +0 -35
- package/common/formulasTemplate.instance.json +0 -483
- package/common/formulasTemplate.js +0 -30
- package/common/formulasTemplate.test.json +0 -2
- package/common/mathTemplate.instance.json +0 -1635
- package/common/mathTemplate.js +0 -32
- package/common/mathTemplate.test.json +0 -1422
- package/common/pipboyTemplate.instance.json +0 -17420
- package/common/pipboyTemplate.js +0 -48
- package/common/pipboyTemplate.test.json +0 -2
- /package/common/{dimensionTemplate.test.json → tokenize.test.json} +0 -0
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: [
|