tpmkms_4wp 7.12.8-beta.4 → 7.12.8-beta.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. package/common/animals.instance.json +67 -227
  2. package/common/animals.js +1 -1
  3. package/common/avatar.js +7 -5
  4. package/common/characters.js +7 -5
  5. package/common/crew.instance.json +257 -417
  6. package/common/crew.js +1 -1
  7. package/common/currency.js +0 -2
  8. package/common/dialogues.js +13 -11
  9. package/common/dimension.instance.json +10 -10
  10. package/common/dimension.js +1 -1
  11. package/common/edible.instance.json +139 -255
  12. package/common/edible.js +1 -1
  13. package/common/emotions.instance.json +56 -32
  14. package/common/emotions.js +1 -1
  15. package/common/fastfood.instance.json +915 -1919
  16. package/common/fastfood.js +1 -1
  17. package/common/formulas.instance.json +7 -7
  18. package/common/formulas.js +2 -2
  19. package/common/help.js +4 -2
  20. package/common/helpers.js +5 -0
  21. package/common/javascript.js +8 -6
  22. package/common/kirk.instance.json +1 -1
  23. package/common/kirk.js +1 -1
  24. package/common/length.instance.json +37 -217
  25. package/common/length.js +1 -1
  26. package/common/math.instance.json +19 -39
  27. package/common/math.js +1 -1
  28. package/common/meta.instance.json +1 -1
  29. package/common/meta.js +29 -10
  30. package/common/numbers.js +31 -24
  31. package/common/ordering.instance.json +86 -82
  32. package/common/ordering.js +1 -1
  33. package/common/people.instance.json +42 -70
  34. package/common/people.js +1 -1
  35. package/common/pipboy.instance.json +109 -169
  36. package/common/pipboy.js +1 -1
  37. package/common/pokemon.instance.json +31 -87
  38. package/common/pokemon.js +1 -1
  39. package/common/pressure.instance.json +10 -30
  40. package/common/pressure.js +1 -1
  41. package/common/properties.instance.json +16 -44
  42. package/common/properties.js +13 -8
  43. package/common/reports.instance.json +6 -62
  44. package/common/reports.js +9 -7
  45. package/common/scorekeeper.instance.json +1 -1
  46. package/common/scorekeeper.js +9 -7
  47. package/common/spock.instance.json +1 -1
  48. package/common/spock.js +1 -1
  49. package/common/tell.js +4 -2
  50. package/common/temperature.instance.json +13 -129
  51. package/common/temperature.js +1 -1
  52. package/common/time.js +36 -20
  53. package/common/time.test.json +66 -44
  54. package/common/ui.instance.json +1 -1
  55. package/common/weight.instance.json +25 -193
  56. package/common/weight.js +1 -1
  57. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  {
2
- "queries": [
2
+ "configs": [
3
3
  "temperature is a dimension",
4
4
  "celcius fahrenheit and kelvin are units of temperature",
5
5
  "fahrenheit = celcius*9/5 + 32",
@@ -828,13 +828,13 @@
828
828
  "one": {
829
829
  "number": "one",
830
830
  "marker": "unknown",
831
+ "value": "temperature",
832
+ "word": "temperature",
833
+ "text": "temperature",
831
834
  "range": {
832
835
  "start": 0,
833
836
  "end": 25
834
837
  },
835
- "word": "temperature",
836
- "text": "temperature",
837
- "value": "temperature",
838
838
  "unknown": true,
839
839
  "dead": true,
840
840
  "types": [
@@ -2039,39 +2039,39 @@
2039
2039
  "value": [
2040
2040
  {
2041
2041
  "marker": "unknown",
2042
+ "value": "celcius",
2043
+ "word": "celcius",
2044
+ "text": "celcius",
2042
2045
  "range": {
2043
2046
  "start": 0,
2044
2047
  "end": 6
2045
2048
  },
2046
- "word": "celcius",
2047
- "text": "celcius",
2048
- "value": "celcius",
2049
2049
  "unknown": true,
2050
2050
  "dead": true,
2051
2051
  "level": 1
2052
2052
  },
2053
2053
  {
2054
2054
  "marker": "unknown",
2055
+ "value": "fahrenheit",
2056
+ "word": "fahrenheit",
2057
+ "text": "fahrenheit",
2055
2058
  "range": {
2056
2059
  "start": 8,
2057
2060
  "end": 17
2058
2061
  },
2059
- "word": "fahrenheit",
2060
- "text": "fahrenheit",
2061
- "value": "fahrenheit",
2062
2062
  "unknown": true,
2063
2063
  "dead": true,
2064
2064
  "level": 2
2065
2065
  },
2066
2066
  {
2067
2067
  "marker": "unknown",
2068
+ "value": "kelvin",
2069
+ "word": "kelvin",
2070
+ "text": "kelvin",
2068
2071
  "range": {
2069
2072
  "start": 23,
2070
2073
  "end": 28
2071
2074
  },
2072
- "word": "kelvin",
2073
- "text": "kelvin",
2074
- "value": "kelvin",
2075
2075
  "unknown": true,
2076
2076
  "dead": true,
2077
2077
  "level": 2
@@ -2360,16 +2360,6 @@
2360
2360
  "propertyOf",
2361
2361
  1
2362
2362
  ]
2363
- ],
2364
- [
2365
- [
2366
- "temperature",
2367
- 0
2368
- ],
2369
- [
2370
- "unknown",
2371
- 0
2372
- ]
2373
2363
  ]
2374
2364
  ],
2375
2365
  "learned_contextual_priorities": [],
@@ -3656,28 +3646,6 @@
3656
3646
  ""
3657
3647
  ],
3658
3648
  "associations": [
3659
- [
3660
- [
3661
- "*",
3662
- 0
3663
- ],
3664
- [
3665
- "+",
3666
- 0
3667
- ],
3668
- [
3669
- "/",
3670
- 0
3671
- ],
3672
- [
3673
- "celcius",
3674
- 0
3675
- ],
3676
- [
3677
- "fahrenheit",
3678
- 0
3679
- ]
3680
- ],
3681
3649
  [
3682
3650
  [
3683
3651
  "celcius",
@@ -5155,32 +5123,6 @@
5155
5123
  ""
5156
5124
  ],
5157
5125
  "associations": [
5158
- [
5159
- [
5160
- "*",
5161
- 0
5162
- ],
5163
- [
5164
- "+",
5165
- 0
5166
- ],
5167
- [
5168
- "-",
5169
- 0
5170
- ],
5171
- [
5172
- "/",
5173
- 0
5174
- ],
5175
- [
5176
- "celcius",
5177
- 0
5178
- ],
5179
- [
5180
- "fahrenheit",
5181
- 0
5182
- ]
5183
- ],
5184
5126
  [
5185
5127
  [
5186
5128
  "celcius",
@@ -5426,54 +5368,6 @@
5426
5368
  "fragments": [],
5427
5369
  "semantics": [],
5428
5370
  "associations": [
5429
- [
5430
- [
5431
- "*",
5432
- 0
5433
- ],
5434
- [
5435
- "+",
5436
- 0
5437
- ],
5438
- [
5439
- "-",
5440
- 0
5441
- ],
5442
- [
5443
- "/",
5444
- 0
5445
- ],
5446
- [
5447
- "celcius",
5448
- 0
5449
- ],
5450
- [
5451
- "fahrenheit",
5452
- 0
5453
- ]
5454
- ],
5455
- [
5456
- [
5457
- "*",
5458
- 0
5459
- ],
5460
- [
5461
- "+",
5462
- 0
5463
- ],
5464
- [
5465
- "/",
5466
- 0
5467
- ],
5468
- [
5469
- "celcius",
5470
- 0
5471
- ],
5472
- [
5473
- "fahrenheit",
5474
- 0
5475
- ]
5476
- ],
5477
5371
  [
5478
5372
  [
5479
5373
  "a",
@@ -6073,16 +5967,6 @@
6073
5967
  "unknown",
6074
5968
  1
6075
5969
  ]
6076
- ],
6077
- [
6078
- [
6079
- "temperature",
6080
- 0
6081
- ],
6082
- [
6083
- "unknown",
6084
- 0
6085
- ]
6086
5970
  ]
6087
5971
  ],
6088
5972
  "learned_contextual_priorities": []
@@ -5,7 +5,7 @@ const temperature_tests = require('./temperature.test.json')
5
5
  const temperature_instance = require('./temperature.instance.json')
6
6
 
7
7
  const template = {
8
- "queries": [
8
+ configs: [
9
9
  "temperature is a dimension",
10
10
  "celcius fahrenheit and kelvin are units of temperature",
11
11
 
package/common/time.js CHANGED
@@ -1,6 +1,8 @@
1
1
  const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const tell = require('./tell')
4
+ const countable = require('./countable')
5
+ const numbers = require('./numbers')
4
6
  const helpers = require('./helpers')
5
7
  const time_tests = require('./time.test.json')
6
8
 
@@ -40,8 +42,8 @@ const configStruct = {
40
42
  name: 'time',
41
43
  operators: [
42
44
  "([time])",
43
- "([use] ((<count> ([timeUnit])) [timeFormat|format]))",
44
- "(([hourUnits|]) [ampm|])"
45
+ "([use] (([timeUnit]) [timeFormat|format]))",
46
+ "(([number|]) [ampm|])"
45
47
  //"(([anyConcept]) [equals|is] ([anyConcept]))",
46
48
  //"(([what0|what]) [equals] (<the> ([timeConcept])))",
47
49
  //"(<whatP|what> ([anyConcept]))",
@@ -54,40 +56,54 @@ const configStruct = {
54
56
  bridges: [
55
57
  { "id": "time", "level": 0, "bridge": "{ ...next(operator) }" },
56
58
 
57
- { "id": "hourUnits", "level": 0, "bridge": "{ ...next(operator) }" },
59
+ // { "id": "hourUnits", "level": 0, "bridge": "{ ...next(operator) }" },
58
60
  { "id": "ampm", "level": 0, "bridge": "{ ...next(operator), hour: before[0] }" },
59
61
 
60
62
  { "id": "timeFormat", "level": 0, "bridge": "{ ...before[0], ...next(operator) }" },
61
- { "id": "count", "level": 0, "bridge": "{ ...after, count: operator.value }" },
62
- { "id": "timeUnit", "level": 0, "bridge": "{ ...next(operator) }" },
63
+ // { "id": "count", "level": 0, "bridge": "{ ...after, count: operator.value }" },
64
+ {
65
+ "id": "timeUnit",
66
+ "level": 0,
67
+ words: [
68
+ ...helpers.words('hour', { initial: "{ units: 'hour' }" }),
69
+ ...helpers.words('minute', { initial: "{ units: 'minute' }" }),
70
+ ...helpers.words('second', { initial: "{ units: 'second' }" }),
71
+ ],
72
+ "bridge": "{ ...next(operator) }"
73
+ },
63
74
  { "id": "use", "level": 0,
64
75
  bridge: "{ ...next(operator), format: after[0] }",
65
- generatorp: ({g, context}) => `use ${context.format.count} hour time`
76
+ generatorp: ({g, context}) => `use ${context.format.quantity.value} hour time`
66
77
  },
67
78
  ],
68
79
  hierarchy: [
69
80
  ['time', 'queryable'],
70
81
  ['ampm', 'queryable'],
71
82
  ['time', 'theAble'],
83
+ ['timeUnit', 'countable'],
72
84
  ],
73
85
 
74
86
  "words": {
75
- " ([0-9]+)": [{"id": "count", "initial": "{ value: int(group[0]) }" }],
76
- " (1[0-2]|[1-9])": [{"id": "hourUnits", "initial": "{ hour: int(group[0]) }" }],
77
- "am": [{"id": "ampm", "initial": "{ ampm: 'am', determined: true }" }],
78
- "pm": [{"id": "ampm", "initial": "{ ampm: 'pm', determined: true }" }],
79
- //" (1[0-2]|[1-9]) ?pm": [{"id": "count", "initial": "{ hour: int(group[0]), part: 'pm' }" }],
80
- //" (1[0-2]|[1-9]) ?am": [{"id": "count", "initial": "{ hour: int(group[0]), part: 'am' }" }],
81
- " hours?": [{"id": "timeUnit", "initial": "{ units: 'hour' }" }],
82
- " minutes?": [{"id": "timeUnit", "initial": "{ units: 'hour' }" }],
83
- " seconds?": [{"id": "timeUnit", "initial": "{ units: 'seconds' }" }],
87
+ "literals": {
88
+ // " ([0-9]+)": [{"id": "count", "initial": "{ value: int(group[0]) }" }],
89
+ // " (1[0-2]|[1-9])": [{"id": "hourUnits", "initial": "{ hour: int(group[0]) }" }],
90
+ "am": [{"id": "ampm", "initial": "{ ampm: 'am', determined: true }" }],
91
+ "pm": [{"id": "ampm", "initial": "{ ampm: 'pm', determined: true }" }],
92
+ //" (1[0-2]|[1-9]) ?pm": [{"id": "count", "initial": "{ hour: int(group[0]), part: 'pm' }" }],
93
+ //" (1[0-2]|[1-9]) ?am": [{"id": "count", "initial": "{ hour: int(group[0]), part: 'am' }" }],
94
+ /*
95
+ " hours?": [{"id": "timeUnit", "initial": "{ units: 'hour' }" }],
96
+ " minutes?": [{"id": "timeUnit", "initial": "{ units: 'hour' }" }],
97
+ " seconds?": [{"id": "timeUnit", "initial": "{ units: 'seconds' }" }],
98
+ */
99
+ }
84
100
  },
85
101
 
86
102
  generators: [
87
103
  {
88
104
  where: where(),
89
105
  match: ({context}) => context.marker == 'ampm' && context.paraphrase,
90
- apply: ({g, context}) => `${context.hour.hour} ${context.ampm}`
106
+ apply: ({g, context, gp}) => `${gp(context.hour)} ${context.ampm}`
91
107
  },
92
108
  {
93
109
  where: where(),
@@ -137,15 +153,15 @@ const configStruct = {
137
153
  {
138
154
  notes: 'use time format working case',
139
155
  where: where(),
140
- match: ({objects, context}) => context.marker == 'use' && context.format && (context.format.count == 12 || context.format.count == 24),
156
+ match: ({objects, context}) => context.marker == 'use' && context.format && (context.format.quantity.value == 12 || context.format.quantity.value == 24),
141
157
  apply: ({objects, context}) => {
142
- objects.format = context.format.count
158
+ objects.format = context.format.quantity.value
143
159
  }
144
160
  },
145
161
  {
146
162
  notes: 'use time format error case',
147
163
  where: where(),
148
- match: ({objects, context}) => context.marker == 'use' && context.format && (context.format.count != 12 && context.format.count != 24),
164
+ match: ({objects, context}) => context.marker == 'use' && context.format && (context.format.quantity.value != 12 && context.format.quantity.value != 24),
149
165
  apply: ({objects, context}) => {
150
166
  context.marker = 'response'
151
167
  context.text = 'The hour format is 12 hour or 24 hour'
@@ -157,7 +173,7 @@ const configStruct = {
157
173
  const createConfig = () => {
158
174
  const config = new Config(configStruct, module)
159
175
  config.stop_auto_rebuild()
160
- config.add(tell())
176
+ config.add(tell()).add(numbers()).add(countable())
161
177
  config.api = api
162
178
  config.initializer( ({config, objects, kms, isModule}) => {
163
179
  if (!isModule) {