ekms 7.12.8 → 8.0.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. package/common/animals.instance.json +192 -406
  2. package/common/animals.js +1 -1
  3. package/common/avatar.js +7 -5
  4. package/common/characters.js +12 -6
  5. package/common/{pipboyTemplate.instance.json → colors.instance.json} +13784 -8900
  6. package/common/colors.js +71 -0
  7. package/common/colors.test.json +4860 -0
  8. package/common/concept.js +2 -2
  9. package/common/crew.instance.json +3945 -3636
  10. package/common/crew.js +5 -3
  11. package/common/currency.js +0 -2
  12. package/common/dialogues.js +152 -20
  13. package/common/dialogues.test.json +1053 -33
  14. package/common/dimension.instance.json +750 -86
  15. package/common/dimension.js +15 -7
  16. package/common/dimension.test.json +289 -312
  17. package/common/edible.instance.json +446 -578
  18. package/common/edible.js +1 -1
  19. package/common/emotions.instance.json +67 -39
  20. package/common/emotions.js +1 -1
  21. package/common/fastfood.instance.json +1769 -2136
  22. package/common/fastfood.js +2 -2
  23. package/common/fastfood.test.json +7941 -3647
  24. package/common/formulas.instance.json +996 -0
  25. package/common/formulas.js +19 -6
  26. package/common/formulas.test.json +504 -2896
  27. package/common/gdefaults.js +2 -0
  28. package/common/help.js +7 -2
  29. package/common/help.test.json +18 -10
  30. package/common/helpers/concept.js +29 -9
  31. package/common/helpers/dialogues.js +17 -1
  32. package/common/helpers/formulas.js +0 -14
  33. package/common/helpers/meta.js +0 -1
  34. package/common/helpers/properties.js +6 -13
  35. package/common/helpers.js +5 -0
  36. package/common/javascript.js +8 -6
  37. package/common/kirk.instance.json +5 -1
  38. package/common/kirk.js +1 -1
  39. package/common/length.instance.json +417 -811
  40. package/common/length.js +1 -1
  41. package/common/math.instance.json +1938 -1
  42. package/common/math.js +17 -5
  43. package/common/meta.instance.json +1 -1
  44. package/common/meta.js +33 -10
  45. package/common/numbers.js +28 -24
  46. package/common/ordering.instance.json +98 -138
  47. package/common/ordering.js +1 -1
  48. package/common/people.instance.json +68 -121
  49. package/common/people.js +1 -1
  50. package/common/pipboy.instance.json +23411 -1076
  51. package/common/pipboy.js +31 -4
  52. package/common/pipboy.test.json +13 -9
  53. package/common/pokemon.instance.json +172 -223
  54. package/common/pokemon.js +1 -1
  55. package/common/pressure.instance.json +131 -81
  56. package/common/pressure.js +1 -1
  57. package/common/properties.instance.json +25 -49
  58. package/common/properties.js +20 -15
  59. package/common/properties.test.json +17605 -4030
  60. package/common/punctuation.js +8 -0
  61. package/common/punctuation.test.json +233 -5
  62. package/common/reports.instance.json +33 -65
  63. package/common/reports.js +9 -9
  64. package/common/scorekeeper.instance.json +1 -1
  65. package/common/scorekeeper.js +9 -7
  66. package/common/sizeable.js +7 -2
  67. package/common/spock.instance.json +5 -1
  68. package/common/spock.js +1 -1
  69. package/common/stm.js +16 -5
  70. package/common/tell.js +4 -2
  71. package/common/temperature.instance.json +142 -252
  72. package/common/temperature.js +1 -1
  73. package/common/testing.js +0 -1
  74. package/common/time.js +36 -20
  75. package/common/time.test.json +66 -44
  76. package/common/tokenize.js +47 -0
  77. package/common/tokenize.test.json +87 -0
  78. package/common/ui.instance.json +13 -1
  79. package/common/ui.js +0 -1
  80. package/common/weight.instance.json +335 -228
  81. package/common/weight.js +1 -1
  82. package/common/weight.test.json +242 -238
  83. package/main.js +6 -8
  84. package/package.json +10 -18
  85. package/common/dimensionTemplate.instance.json +0 -582
  86. package/common/dimensionTemplate.js +0 -35
  87. package/common/dimensionTemplate.test.json +0 -2
  88. package/common/formulasTemplate.instance.json +0 -483
  89. package/common/formulasTemplate.js +0 -30
  90. package/common/formulasTemplate.test.json +0 -2
  91. package/common/mathTemplate.instance.json +0 -1635
  92. package/common/mathTemplate.js +0 -32
  93. package/common/mathTemplate.test.json +0 -1422
  94. package/common/pipboyTemplate.js +0 -48
  95. package/common/pipboyTemplate.test.json +0 -2
package/common/pipboy.js CHANGED
@@ -1,11 +1,12 @@
1
1
  const { Config, knowledgeModule, where, Digraph } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
- const base_km = require('./pipboyTemplate')
3
+ const hierarchy = require('./hierarchy')
4
4
  const countable = require('./countable')
5
5
  const math = require('./math')
6
6
  const comparable = require('./comparable')
7
7
  const help = require('./help')
8
8
  const pipboy_tests = require('./pipboy.test.json')
9
+ const instance = require('./pipboy.instance.json')
9
10
 
10
11
  // start/stop listening
11
12
  class API {
@@ -501,11 +502,36 @@ addWeapon('pistol')
501
502
  addWeapon('rifle')
502
503
  */
503
504
 
505
+ const template = {
506
+ configs: [
507
+ "pistols rifles grenades mines and shotguns are weapons",
508
+ "mines and grenades are explosives",
509
+ "explosives are weapons",
510
+ "pistols rifles and shotguns are firearms",
511
+ "firearms are weapons",
512
+ "hats armor and suits are clothes",
513
+ // "a rifle is a weapon",
514
+ //"a weapon is equipable and changeable"
515
+ "a weapon is equipable",
516
+ "clothes are wearable",
517
+ // "weapons are countable", TODO fix this
518
+ "edible is a concept",
519
+ "food is edible",
520
+ "drinks are drinkable",
521
+ "meat is food",
522
+ "vegetables and fruit are food",
523
+ "cola and pop are drinks",
524
+ "medicine and stimpaks are takeable",
525
+ "item modifies properties",
526
+ "damage luck hp rads value ap charisma range and accuracy are item properties",
527
+ configStruct,
528
+ ]
529
+ }
530
+
504
531
  const createConfig = () => {
505
- const config = new Config(configStruct, module)
532
+ const config = new Config({ name: 'pipboy' }, module)
506
533
  config.stop_auto_rebuild()
507
- //console.log('base_km.config.hierarchy', JSON.stringify(base_km.config.hierarchy, null, 2))
508
- config.add(base_km(), countable(), comparable(), help(), math())
534
+ config.add(hierarchy(), countable(), comparable(), help(), math())
509
535
  // console.log('config.config.hierarchy', JSON.stringify(config.config.hierarchy, null, 2))
510
536
  // console.log('config.hierarchy', config.hierarchy)
511
537
  config.api = api
@@ -517,6 +543,7 @@ knowledgeModule({
517
543
  module,
518
544
  description: 'Control a pipboy with speech',
519
545
  createConfig,
546
+ template: { template, instance },
520
547
  test: {
521
548
  name: './pipboy.test.json',
522
549
  contents: pipboy_tests,
@@ -24514,7 +24514,6 @@
24514
24514
  "help": "help2",
24515
24515
  "hierarchy": "hierarchy2",
24516
24516
  "math": "math2",
24517
- "mathTemplate": "mathTemplate2",
24518
24517
  "meta": "meta2",
24519
24518
  "numbers": "numbers2",
24520
24519
  "pipboy": "pipboy1",
@@ -24550,8 +24549,6 @@
24550
24549
  },
24551
24550
  "math2": {
24552
24551
  },
24553
- "mathTemplate2": {
24554
- },
24555
24552
  "meta2": {
24556
24553
  },
24557
24554
  "numbers2": {
@@ -24646,7 +24643,8 @@
24646
24643
  "whose"
24647
24644
  ],
24648
24645
  "preposition": [
24649
- "between"
24646
+ "between",
24647
+ "to"
24650
24648
  ],
24651
24649
  "pronoun": [
24652
24650
  "it",
@@ -24743,13 +24741,14 @@
24743
24741
  "whatAble",
24744
24742
  "is",
24745
24743
  "toAble",
24744
+ "to",
24746
24745
  "noun",
24747
24746
  "thisitthat",
24748
24747
  "reason",
24749
24748
  "that",
24749
+ "number",
24750
24750
  "orAble",
24751
24751
  "ifAble",
24752
- "number",
24753
24752
  "*",
24754
24753
  "mathematical_operator",
24755
24754
  "+",
@@ -24966,6 +24965,9 @@
24966
24965
  "thisitthat": [
24967
24966
  "queryable"
24968
24967
  ],
24968
+ "to": [
24969
+ "preposition"
24970
+ ],
24969
24971
  "unknown": [
24970
24972
  "hierarchyAble",
24971
24973
  "object",
@@ -25136,6 +25138,8 @@
25136
25138
  },
25137
25139
  "thisitthat": {
25138
25140
  },
25141
+ "to": {
25142
+ },
25139
25143
  "toAble": {
25140
25144
  },
25141
25145
  "unknown": {
@@ -25234,8 +25238,8 @@
25234
25238
  "word": "apply"
25235
25239
  },
25236
25240
  "generatedParenthesized": "",
25237
- "paraphrases": "apply four stimpacks",
25238
- "paraphrasesParenthesized": "(apply ((four) (stimpacks)))",
25241
+ "paraphrases": "apply 4 stimpacks",
25242
+ "paraphrasesParenthesized": "(apply ((4) (stimpacks)))",
25239
25243
  "responses": [
25240
25244
  ""
25241
25245
  ]
@@ -25758,10 +25762,10 @@
25758
25762
  ]
25759
25763
  },
25760
25764
  "paraphrases": [
25761
- "apply four stimpacks"
25765
+ "apply 4 stimpacks"
25762
25766
  ],
25763
25767
  "paraphrasesParenthesized": [
25764
- "(apply ((four) (stimpacks)))"
25768
+ "(apply ((4) (stimpacks)))"
25765
25769
  ],
25766
25770
  "query": "apply four stimpacks",
25767
25771
  "responses": [