tpmkms_4wp 9.3.0-beta.5 → 9.3.0-beta.51
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 +0 -65
- package/common/asking.js +16 -2
- package/common/colors.instance.json +28 -70
- package/common/comparable.instance.json +0 -15
- package/common/concept.test.json +279 -193
- package/common/crew.instance.json +0 -166
- package/common/dateTimeSelectors.instance.json +151 -0
- package/common/dateTimeSelectors.js +171 -0
- package/common/dateTimeSelectors.test.json +85622 -0
- package/common/dates.instance.json +285 -479
- package/common/dates.js +111 -10
- package/common/dates.test.json +11021 -514
- package/common/dialogues.js +8 -46
- package/common/dimension.instance.json +0 -5
- package/common/edible.instance.json +56 -160
- package/common/emotions.instance.json +0 -5
- package/common/evaluate.js +1 -1
- package/common/events.js +1 -1
- package/common/fastfood.instance.json +149 -880
- package/common/fastfood.test.json +16291 -6597
- package/common/formulas.instance.json +0 -5
- package/common/helpers/dateTimeSelectors.js +198 -0
- package/common/helpers/dialogues.js +11 -8
- package/common/helpers/properties.js +2 -2
- package/common/helpers.js +57 -32
- package/common/hierarchy.js +9 -9
- package/common/kirk.instance.json +0 -5
- package/common/length.instance.json +0 -75
- package/common/math.instance.json +0 -5
- package/common/menus.instance.json +0 -35
- package/common/meta.js +2 -2
- package/common/numbers.js +1 -1
- package/common/numbers.test.json +89 -23
- package/common/ordering.instance.json +0 -10
- package/common/people.instance.json +36 -40
- package/common/percentages.js +1 -1
- package/common/pipboy.instance.json +56 -85
- package/common/pipboy.test.json +4377 -3386
- package/common/pokemon.instance.json +0 -65
- package/common/pressure.instance.json +0 -20
- package/common/properties.instance.json +0 -5
- package/common/properties.js +4 -4
- package/common/reminders.instance.json +196 -10
- package/common/reminders.js +273 -79
- package/common/reminders.test.json +71435 -23
- package/common/reports.instance.json +2 -12
- package/common/scorekeeper.test.json +3565 -7550
- package/common/spock.instance.json +0 -5
- package/common/temperature.instance.json +112 -20
- package/common/time.js +63 -30
- package/common/time.test.json +4124 -124
- package/common/ui.instance.json +0 -5
- package/common/ui.js +3 -1
- package/common/weight.instance.json +0 -60
- package/common/wp.instance.json +56 -70
- package/common/wp.test.json +8057 -3867
- package/main.js +2 -0
- package/package.json +8 -4
package/common/dates.js
CHANGED
@@ -14,7 +14,35 @@ const helpers = require('./helpers')
|
|
14
14
|
const template = {
|
15
15
|
configs: [
|
16
16
|
"setidsuffix _dates",
|
17
|
+
({config}) => {
|
18
|
+
const months = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"]
|
19
|
+
config.addSemantic({
|
20
|
+
match: ({context}) => {
|
21
|
+
if (!context.makeObject) {
|
22
|
+
return
|
23
|
+
}
|
24
|
+
return months.includes(context.value)
|
25
|
+
},
|
26
|
+
apply: ({context}) => {
|
27
|
+
context.initial.month_ordinal = months.findIndex((month) => month == context.value) + 1
|
28
|
+
},
|
29
|
+
})
|
30
|
+
},
|
17
31
|
"january, february, march, april, may, june, july, august, september, october, november and december are months",
|
32
|
+
({config}) => {
|
33
|
+
const days = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]
|
34
|
+
config.addSemantic({
|
35
|
+
match: ({context}) => {
|
36
|
+
if (!context.makeObject) {
|
37
|
+
return
|
38
|
+
}
|
39
|
+
return days.includes(context.value)
|
40
|
+
},
|
41
|
+
apply: ({context}) => {
|
42
|
+
context.initial.day_ordinal = days.findIndex((day) => day == context.value) + 1
|
43
|
+
},
|
44
|
+
})
|
45
|
+
},
|
18
46
|
"monday, tuesday, wednesday, thursday, friday, saturday and sunday are days",
|
19
47
|
"ac, bc, bce and ad are eras",
|
20
48
|
// "ac, bc,, bce,, and ad are eras",
|
@@ -37,9 +65,12 @@ const template = {
|
|
37
65
|
"([era_dates|])",
|
38
66
|
"([date_dates|])",
|
39
67
|
"([dateEra_dates] (date_dates/*) (era_dates/*))",
|
68
|
+
"([monthDay_dates] (month_dates/*) (dayNumber_dates/*))",
|
40
69
|
"([monthYear_dates] (month_dates/*) (yearNumber_dates/*))",
|
41
70
|
"([monthDayYear_dates] (month_dates/*) (dayNumber_dates/*) (yearNumber_dates/*))",
|
42
71
|
"([monthDayYearWithSlashes_dates] (monthNumber_dates/*) (dateSeparator_dates/*) (dayNumber_dates/*) (dateSeparator_dates/*) (yearNumber_dates/*))",
|
72
|
+
"([onDate_dates|on] ([onDateValue_dates|]))",
|
73
|
+
"([afterDate_dates|after] ([afterDateValue_dates|]))",
|
43
74
|
],
|
44
75
|
associations: {
|
45
76
|
positive: [
|
@@ -50,6 +81,30 @@ const template = {
|
|
50
81
|
['monday_dates', 'distributable'],
|
51
82
|
],
|
52
83
|
bridges: [
|
84
|
+
{
|
85
|
+
id: 'onDateValue_dates',
|
86
|
+
children: [
|
87
|
+
'day_dates',
|
88
|
+
'month_dates',
|
89
|
+
],
|
90
|
+
},
|
91
|
+
{
|
92
|
+
id: 'onDate_dates',
|
93
|
+
isA: ['preposition'],
|
94
|
+
bridge: "{ ...next(operator), date: after[0], onDate: operator, interpolate: '${onDate} ${date}' }",
|
95
|
+
},
|
96
|
+
{
|
97
|
+
id: 'afterDateValue_dates',
|
98
|
+
children: [
|
99
|
+
'day_dates',
|
100
|
+
'month_dates',
|
101
|
+
],
|
102
|
+
},
|
103
|
+
{
|
104
|
+
id: 'afterDate_dates',
|
105
|
+
isA: ['preposition'],
|
106
|
+
bridge: "{ ...next(operator), date: after[0], afterDate: operator, interpolate: '${afterDate} ${date}' }",
|
107
|
+
},
|
53
108
|
{
|
54
109
|
id: 'era_dates',
|
55
110
|
words: ['era'],
|
@@ -58,6 +113,7 @@ const template = {
|
|
58
113
|
{
|
59
114
|
id: 'date_dates',
|
60
115
|
words: ['date', 'distributable'],
|
116
|
+
isA: ['onDateValue_dates', 'afterDateValue_dates'],
|
61
117
|
bridge: "{ ...next(operator) }"
|
62
118
|
},
|
63
119
|
{
|
@@ -74,6 +130,7 @@ const template = {
|
|
74
130
|
{
|
75
131
|
id: 'monthDayYearWithSlashes_dates',
|
76
132
|
isA: ['date_dates'],
|
133
|
+
before: ['preposition'],
|
77
134
|
convolution: true,
|
78
135
|
bridge: "{ ...next(operator), day: after[2], month: after[0], year: after[4], interpolate: '${month}/${day}/${year}' }",
|
79
136
|
},
|
@@ -93,16 +150,32 @@ const template = {
|
|
93
150
|
isA: ['integer'],
|
94
151
|
bridge: "{ ...next(operator) }"
|
95
152
|
},
|
153
|
+
{
|
154
|
+
id: 'monthDay_dates',
|
155
|
+
convolution: true,
|
156
|
+
localHierarchy: [['ordinal', 'dayNumber_dates']],
|
157
|
+
before: ['preposition'],
|
158
|
+
isA: ['date_dates'],
|
159
|
+
bridge: "{ ...next(operator), month: after[0], day: after[1], interpolate: '${month} ${day}' }"
|
160
|
+
},
|
96
161
|
{
|
97
162
|
id: 'monthYear_dates',
|
98
163
|
convolution: true,
|
164
|
+
before: ['preposition'],
|
99
165
|
isA: ['date_dates'],
|
100
166
|
bridge: "{ ...next(operator), month: after[0], year: after[1], interpolate: '${month} ${year}' }"
|
101
167
|
},
|
102
168
|
{
|
103
169
|
id: 'monthDayYear_dates',
|
104
170
|
convolution: true,
|
171
|
+
before: ['preposition', 'monthDay_dates'],
|
105
172
|
isA: ['date_dates'],
|
173
|
+
evaluator: ({context}) => {
|
174
|
+
const year = context.year.value
|
175
|
+
const day = context.day.value
|
176
|
+
const month_ordinal = context.month.month_ordinal
|
177
|
+
context.evalue = new Date(year, month_ordinal-1, day).toISOString()
|
178
|
+
},
|
106
179
|
localHierarchy: [
|
107
180
|
['ordinal', 'dayNumber_dates'],
|
108
181
|
],
|
@@ -130,17 +203,31 @@ const template = {
|
|
130
203
|
}
|
131
204
|
},
|
132
205
|
(args) => {
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
args.makeObject({...args, context: { word: as[i], value: `${
|
206
|
+
{
|
207
|
+
const as = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sept', 'oct', 'nov', 'dec']
|
208
|
+
const ms = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december']
|
209
|
+
// args.makeObject({...args, context: { word: as[i], value: `${ms[i]}_dates`}, types: [`${ms[i]}_dates`]})
|
210
|
+
for (let i = 0; i < as.length; ++i) {
|
211
|
+
const word = as[i]
|
212
|
+
if (word == 'may') {
|
213
|
+
continue
|
214
|
+
}
|
215
|
+
const id = `${ms[i]}_dates`
|
216
|
+
args.addWords(id, word, { value: id, abbreviation: word, month_ordinal: i+1 })
|
217
|
+
}
|
218
|
+
}
|
219
|
+
|
220
|
+
{
|
221
|
+
const as = ['sun', 'mon', 'tues', 'weds', 'thurs', 'fri', 'sat']
|
222
|
+
const ms = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday']
|
223
|
+
// args.makeObject({...args, context: { word: as[i], value: `${ms[i]}_dates`}, types: [`${ms[i]}_dates`]})
|
224
|
+
for (let i = 0; i < as.length; ++i) {
|
225
|
+
const word = as[i]
|
226
|
+
const id = `${ms[i]}_dates`
|
227
|
+
args.addWords(id, word, { value: id, abbreviation: word, day_ordinal: i+1 })
|
228
|
+
}
|
137
229
|
}
|
138
230
|
|
139
|
-
/*
|
140
|
-
const word = 'bc'
|
141
|
-
const synonym = 'bce'
|
142
|
-
args.makeObject({...args, context: { word: synonym, value: `${synonym}_dates`}, types: [`${word}_dates`]})
|
143
|
-
*/
|
144
231
|
},
|
145
232
|
"resetIdSuffix",
|
146
233
|
],
|
@@ -156,7 +243,21 @@ knowledgeModule( {
|
|
156
243
|
name: './dates.test.json',
|
157
244
|
contents: dates_tests,
|
158
245
|
checks: {
|
159
|
-
context: defaultContextCheck([
|
246
|
+
context: defaultContextCheck([
|
247
|
+
'month', 'day', 'year', 'era', 'month_ordinal', 'day_ordinal',
|
248
|
+
{
|
249
|
+
month: [
|
250
|
+
'month_ordinal',
|
251
|
+
],
|
252
|
+
day: [
|
253
|
+
'day_ordinal',
|
254
|
+
],
|
255
|
+
date: [
|
256
|
+
'month_ordinal',
|
257
|
+
'day_ordinal',
|
258
|
+
],
|
259
|
+
},
|
260
|
+
]),
|
160
261
|
},
|
161
262
|
},
|
162
263
|
template: {
|