tpmkms_4wp 8.0.0-beta.2 → 8.0.0-beta.20

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.
Files changed (42) hide show
  1. package/common/animals.instance.json +2630 -1375
  2. package/common/colors.instance.json +6976 -3515
  3. package/common/colors.test.json +345 -780
  4. package/common/concept.js +5 -2
  5. package/common/crew.instance.json +12836 -6483
  6. package/common/crew.test.json +714 -452
  7. package/common/dialogues.js +2 -18
  8. package/common/dimension.instance.json +242 -261
  9. package/common/dimension.test.json +314 -502
  10. package/common/edible.instance.json +19375 -9971
  11. package/common/emotions.instance.json +122 -69
  12. package/common/fastfood.instance.json +219480 -110844
  13. package/common/formulas.instance.json +216 -250
  14. package/common/formulas.js +2 -2
  15. package/common/help.test.json +10 -22
  16. package/common/helpers/concept.js +10 -6
  17. package/common/kirk.instance.json +564 -290
  18. package/common/length.instance.json +5329 -4793
  19. package/common/math.instance.json +140 -1157
  20. package/common/math.js +4 -4
  21. package/common/negation.instance.json +2 -0
  22. package/common/negation.js +38 -0
  23. package/common/negation.test.json +308 -0
  24. package/common/numbers.js +2 -2
  25. package/common/ordering.instance.json +292 -230
  26. package/common/people.instance.json +1902 -1015
  27. package/common/percentages.instance.json +2 -0
  28. package/common/percentages.js +57 -0
  29. package/common/percentages.test.json +751 -0
  30. package/common/pipboy.instance.json +7756 -6298
  31. package/common/pokemon.instance.json +4006 -2089
  32. package/common/pressure.instance.json +1265 -1193
  33. package/common/properties.instance.json +106 -61
  34. package/common/properties.js +2 -0
  35. package/common/reports.instance.json +557 -559
  36. package/common/sdefaults.js +10 -0
  37. package/common/spock.instance.json +564 -290
  38. package/common/temperature.instance.json +1398 -1250
  39. package/common/ui.instance.json +238 -259
  40. package/common/weight.instance.json +4905 -4166
  41. package/main.js +51 -46
  42. package/package.json +13 -6
@@ -102,7 +102,7 @@ let configStruct = {
102
102
  "(([expression]) [equals] ([expression]))",
103
103
  ],
104
104
  priorities: [
105
- { "context": [['mathematicalOperator', 0], ['number', 0], ], "choose": [0] },
105
+ { "context": [['mathematical_operator', 0], ['number', 0], ], "choose": [0] },
106
106
  ],
107
107
  semantics: [
108
108
  {
@@ -172,7 +172,7 @@ let configStruct = {
172
172
  id: 'equals',
173
173
  bridge: "{ ...next(operator), left: before[0], right: after[0] }",
174
174
  words: ['='],
175
- after: ['mathematicalOperator'],
175
+ after: ['mathematical_operator'],
176
176
  // TODO have this be per argument then 'is' can map to equals where this only applied to before[0] and not after[0]
177
177
  localHierarchy: [ ['unknown', 'expression'] ],
178
178
  generatorp: ({context, gp}) => `${gp(context.left)} ${context.word} ${gp(context.right)}`,
@@ -19,24 +19,6 @@
19
19
  0
20
20
  ]
21
21
  ],
22
- [
23
- [
24
- "help",
25
- 0
26
- ],
27
- [
28
- "km",
29
- 0
30
- ],
31
- [
32
- "list",
33
- 0
34
- ],
35
- [
36
- "withKM",
37
- 0
38
- ]
39
- ],
40
22
  [
41
23
  [
42
24
  "help",
@@ -216,6 +198,7 @@
216
198
  "gdefaults": "gdefaults2",
217
199
  "help": "help1",
218
200
  "meta": "meta2",
201
+ "negation": "negation2",
219
202
  "pos": "pos2",
220
203
  "punctuation": "punctuation2",
221
204
  "sdefaults": "sdefaults2",
@@ -236,6 +219,8 @@
236
219
  },
237
220
  "meta2": {
238
221
  },
222
+ "negation2": {
223
+ },
239
224
  "pos2": {
240
225
  },
241
226
  "punctuation2": {
@@ -361,7 +346,7 @@
361
346
  }
362
347
  ],
363
348
  "generatedParenthesized": [
364
- "( 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 setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\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 \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n)"
349
+ "( 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 setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\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 \"hi man\"\n\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n)"
365
350
  ],
366
351
  "metadata": {
367
352
  "opChoices": [
@@ -386,6 +371,7 @@
386
371
  "gdefaults": "gdefaults2",
387
372
  "help": "help1",
388
373
  "meta": "meta2",
374
+ "negation": "negation2",
389
375
  "pos": "pos2",
390
376
  "punctuation": "punctuation2",
391
377
  "sdefaults": "sdefaults2",
@@ -406,6 +392,8 @@
406
392
  },
407
393
  "meta2": {
408
394
  },
395
+ "negation2": {
396
+ },
409
397
  "pos2": {
410
398
  },
411
399
  "punctuation2": {
@@ -440,11 +428,11 @@
440
428
  "value": "help",
441
429
  "word": "help"
442
430
  },
443
- "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 setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\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 \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n)",
431
+ "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 setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\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 \"hi man\"\n\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n)",
444
432
  "paraphrases": "help",
445
433
  "paraphrasesParenthesized": "(help)",
446
434
  "responses": [
447
- " 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 setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\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 \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n"
435
+ " 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 setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\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 \"hi man\"\n\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n"
448
436
  ]
449
437
  }
450
438
  ]
@@ -457,7 +445,7 @@
457
445
  ],
458
446
  "query": "help",
459
447
  "responses": [
460
- " 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 setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\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 \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n"
448
+ " 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 setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\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 \"hi man\"\n\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n"
461
449
  ]
462
450
  }
463
451
  ]
@@ -34,10 +34,9 @@ class API {
34
34
  // TODO make the modifiers objects then below for add words for modifiers only do if !unknown
35
35
  // const objectId = pluralize.singular(object)
36
36
  const objectId = this.args.kms.dialogues.api.toScopedId(object)
37
-
38
37
  // const modifierIds = modifiers.map( (modifier) => pluralize.singular(modifier) )
39
38
  const modifierIds = modifiers.map( (modifier) => this.args.kms.dialogues.api.toScopedId(modifier) )
40
- const modifiersObjectId = `${modifiers.join("_")}_${objectId}`
39
+ const modifiersObjectId = `${modifierIds.join("_")}_${objectId}`
41
40
 
42
41
  const toWord = (object) => {
43
42
  if (typeof object == 'string') {
@@ -76,14 +75,18 @@ class API {
76
75
  config.addWord(objectPlural, { id: objectId, initial: `{ value: '${objectId}', number: 'many' }`})
77
76
  }
78
77
 
79
- zip(modifiers, modifierIds).forEach(([modifierWord, modifierId]) => {
78
+ zip(modifiers, modifierIds).forEach(([modifier, modifierId]) => {
80
79
  // config.addWord(modifier, { id: modifierId, initial: `{ value: '${modifierId}' }`})
81
80
  // TODO call evaluator to pick up overrides
82
- config.addWord(pluralize.singular(modifierWord), { id: modifierId, initial: `{ value: '${modifierId}', number: 'one' }`})
83
- config.addWord(pluralize.plural(modifierWord), { id: modifierId, initial: `{ value: '${modifierId}', number: 'many' }`})
81
+ if (modifier.unknown) {
82
+ const modifierWord = modifier.text
83
+ config.addWord(pluralize.singular(modifierWord), { id: modifierId, initial: `{ value: '${modifierId}', number: 'one' }`})
84
+ config.addWord(pluralize.plural(modifierWord), { id: modifierId, initial: `{ value: '${modifierId}', number: 'many' }`})
85
+ }
84
86
  })
85
87
  // modifierds.forEach((modifierId) => config.addWord(modifierId, { id: modifierId, initial: `{ value: '${modifierId}' }`}))
86
88
 
89
+ debugger
87
90
  modifierIds.forEach((modifierId) => config.addBridge({ id: modifierId, level: 0, bridge: `{ ...next(operator), value: '${modifierId}' }`, allowDups: true }))
88
91
  config.addBridge({ id: objectId, level: 0, bridge: `{ ...next(operator), value: '${objectId}' }`, allowDups: true })
89
92
  // config.addBridge({ id: modifierObjectId, level: 0, bridge: `{ ...next(operator), value: '${modifierObjectId}' }`, allowDups: true })
@@ -94,7 +97,8 @@ class API {
94
97
  id: modifiersObjectId,
95
98
  level: 0,
96
99
  convolution: true,
97
- isA: ['adjective'],
100
+ isA: [{ parent: 'adjective', instance: true }],
101
+ // isA: ['adjective'],
98
102
  before: ['verby'],
99
103
  bridge: `{ ...after[0], ${modifierProperties}, atomic: true, dead: true, marker: next(operator('${modifiersObjectId}')), value: '${modifiersObjectId}', modifiers: append([${modifierList}], after[0].modifiers)}`,
100
104
  allowDups: true })