tpmkms_4wp 9.3.0-beta.5 → 9.3.0-beta.7
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/concept.test.json +279 -193
- package/common/dialogues.js +5 -2
- package/common/events.js +1 -1
- package/common/fastfood.instance.json +69 -365
- package/common/fastfood.test.json +16291 -6597
- package/common/helpers.js +24 -7
- package/common/numbers.js +1 -1
- package/common/numbers.test.json +89 -23
- package/common/percentages.js +1 -1
- package/common/pipboy.test.json +4377 -3386
- package/common/reminders.instance.json +86 -6
- package/common/reminders.js +18 -24
- package/common/reminders.test.json +8779 -1
- package/common/reports.instance.json +2 -2
- package/common/scorekeeper.test.json +3565 -7550
- package/common/time.js +68 -30
- package/common/time.test.json +4124 -124
- package/common/ui.js +3 -1
- package/common/wp.test.json +8057 -3867
- package/package.json +2 -2
package/common/time.js
CHANGED
@@ -41,8 +41,11 @@ const config = {
|
|
41
41
|
name: 'time',
|
42
42
|
operators: [
|
43
43
|
"([time])",
|
44
|
+
"([atTime|at] (time))",
|
44
45
|
"([use] (([timeUnit]) [timeFormat|format]))",
|
45
|
-
"(([number|]) [ampm|])"
|
46
|
+
// "(([number|]) [ampm|])",
|
47
|
+
"((time) [ampm|])",
|
48
|
+
"([hourMinutes|] (integer) (colon) (integer))",
|
46
49
|
//"(([anyConcept]) [equals|is] ([anyConcept]))",
|
47
50
|
//"(([what0|what]) [equals] (<the> ([timeConcept])))",
|
48
51
|
//"(<whatP|what> ([anyConcept]))",
|
@@ -53,26 +56,47 @@ const config = {
|
|
53
56
|
// how many hours are in a day
|
54
57
|
],
|
55
58
|
bridges: [
|
56
|
-
{
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
59
|
+
{
|
60
|
+
id: 'hourMinutes',
|
61
|
+
isA: ['time'],
|
62
|
+
convolution: true,
|
63
|
+
bridge: "{ ...next(operator), hour: after[0], colon: after[1], minute: after[2], interpolate: '${hour}${colon}${minute}' }",
|
64
|
+
},
|
65
|
+
{
|
66
|
+
id: "atTime",
|
67
|
+
words: ['@'],
|
68
|
+
isA: ['preposition'],
|
69
|
+
bridge: "{ ...next(operator), time: after[0], operator: operator, interpolate: '${operator} ${time}' }"
|
70
|
+
},
|
71
|
+
{
|
72
|
+
id: "time",
|
73
|
+
bridge: "{ ...next(operator) }"
|
74
|
+
},
|
75
|
+
{
|
76
|
+
id: "ampm",
|
77
|
+
isA: ['adjective'],
|
78
|
+
localHierarchy: [
|
79
|
+
['integer', 'time'],
|
80
|
+
],
|
81
|
+
bridge: "{ ...next(before[0]), marker: if(isA(before[0].marker, 'integer'), operator('time'), before[0].marker), ampm: operator, time: before[0], interpolate: concat(default(before[0].interpolate, '${time}'), ' ${ampm}') }",
|
82
|
+
},
|
63
83
|
{
|
64
|
-
|
65
|
-
|
84
|
+
id: "timeFormat",
|
85
|
+
bridge: "{ ...before[0], ...next(operator) }"
|
86
|
+
},
|
87
|
+
{
|
88
|
+
id: "timeUnit",
|
66
89
|
words: [
|
67
90
|
...helpers.words('hour', { initial: "{ units: 'hour' }" }),
|
68
91
|
...helpers.words('minute', { initial: "{ units: 'minute' }" }),
|
69
92
|
...helpers.words('second', { initial: "{ units: 'second' }" }),
|
70
93
|
],
|
71
|
-
|
94
|
+
bridge: "{ ...next(operator) }"
|
72
95
|
},
|
73
|
-
{
|
74
|
-
|
75
|
-
|
96
|
+
{
|
97
|
+
id: "use",
|
98
|
+
bridge: "{ ...next(operator), format: after[0] }",
|
99
|
+
generatorp: ({g, context}) => `use ${context.format.quantity.value} hour time`
|
76
100
|
},
|
77
101
|
],
|
78
102
|
hierarchy: [
|
@@ -84,26 +108,21 @@ const config = {
|
|
84
108
|
|
85
109
|
"words": {
|
86
110
|
"literals": {
|
87
|
-
// " ([0-9]+)": [{
|
88
|
-
// " (1[0-2]|[1-9])": [{
|
89
|
-
"am": [{
|
90
|
-
"pm": [{
|
91
|
-
//" (1[0-2]|[1-9]) ?pm": [{
|
92
|
-
//" (1[0-2]|[1-9]) ?am": [{
|
111
|
+
// " ([0-9]+)": [{id: "count", "initial": "{ value: int(group[0]) }" }],
|
112
|
+
// " (1[0-2]|[1-9])": [{id: "hourUnits", "initial": "{ hour: int(group[0]) }" }],
|
113
|
+
"am": [{id: "ampm", "initial": "{ ampm: 'am', determined: true }" }],
|
114
|
+
"pm": [{id: "ampm", "initial": "{ ampm: 'pm', determined: true }" }],
|
115
|
+
//" (1[0-2]|[1-9]) ?pm": [{id: "count", "initial": "{ hour: int(group[0]), part: 'pm' }" }],
|
116
|
+
//" (1[0-2]|[1-9]) ?am": [{id: "count", "initial": "{ hour: int(group[0]), part: 'am' }" }],
|
93
117
|
/*
|
94
|
-
" hours?": [{
|
95
|
-
" minutes?": [{
|
96
|
-
" seconds?": [{
|
118
|
+
" hours?": [{id: "timeUnit", "initial": "{ units: 'hour' }" }],
|
119
|
+
" minutes?": [{id: "timeUnit", "initial": "{ units: 'hour' }" }],
|
120
|
+
" seconds?": [{id: "timeUnit", "initial": "{ units: 'seconds' }" }],
|
97
121
|
*/
|
98
122
|
}
|
99
123
|
},
|
100
124
|
|
101
125
|
generators: [
|
102
|
-
{
|
103
|
-
where: where(),
|
104
|
-
match: ({context}) => context.marker == 'ampm' && context.paraphrase,
|
105
|
-
apply: async ({g, context, gp}) => `${await gp(context.hour)} ${context.ampm}`
|
106
|
-
},
|
107
126
|
{
|
108
127
|
where: where(),
|
109
128
|
match: ({context}) => context.marker == 'time' && context.evalue && context.format == 12,
|
@@ -182,6 +201,19 @@ const initializer = ({api, config, objects, kms, isModule}) => {
|
|
182
201
|
})
|
183
202
|
}
|
184
203
|
|
204
|
+
console.log('greg23 ssssssssssssss')
|
205
|
+
console.log(JSON.stringify(defaultContextCheck([
|
206
|
+
//{ 'event': { , 'target', 'one', 'two']
|
207
|
+
{
|
208
|
+
event: {
|
209
|
+
one: 'defaults',
|
210
|
+
two: 'defaults',
|
211
|
+
info: 'defaults',
|
212
|
+
target: 'defaults'
|
213
|
+
}
|
214
|
+
},
|
215
|
+
]), null, 2))
|
216
|
+
|
185
217
|
knowledgeModule({
|
186
218
|
config,
|
187
219
|
includes: [tell, numbers, countable],
|
@@ -194,7 +226,13 @@ knowledgeModule({
|
|
194
226
|
name: './time.test.json',
|
195
227
|
contents: time_tests,
|
196
228
|
checks: {
|
197
|
-
|
198
|
-
|
229
|
+
context: defaultContextCheck([{
|
230
|
+
event: {
|
231
|
+
defaults: true,
|
232
|
+
one: 'defaults',
|
233
|
+
two: 'defaults',
|
234
|
+
}
|
235
|
+
}]),
|
236
|
+
},
|
199
237
|
},
|
200
238
|
})
|