tpmkms_4wp 9.3.0-beta.9 → 9.4.0
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/animals.js +2 -3
- package/common/animals.test.json +1607 -1
- package/common/articles.js +2 -4
- package/common/asking.js +21 -5
- package/common/avatar.js +2 -2
- package/common/characters.js +2 -2
- package/common/colors.instance.json +28 -70
- package/common/colors.js +2 -2
- package/common/comparable.instance.json +0 -15
- package/common/comparable.js +2 -2
- package/common/concept.js +1 -2
- package/common/conjunction.js +3 -5
- package/common/countable.js +2 -14
- package/common/crew.instance.json +0 -130
- package/common/crew.js +2 -2
- package/common/currency.js +2 -3
- package/common/dateTimeSelectors.instance.json +175 -0
- package/common/dateTimeSelectors.js +168 -0
- package/common/dateTimeSelectors.test.json +85622 -0
- package/common/dates.instance.json +538 -506
- package/common/dates.js +112 -15
- package/common/dates.test.json +11021 -514
- package/common/dialogues.js +8 -47
- package/common/dimension.instance.json +0 -5
- package/common/dimension.js +4 -4
- package/common/edible.instance.json +56 -160
- package/common/edible.js +2 -2
- package/common/emotions.instance.json +0 -5
- package/common/emotions.js +2 -2
- package/common/errors.js +3 -0
- package/common/evaluate.js +2 -2
- package/common/events.js +1 -2
- package/common/fastfood.instance.json +262 -713
- package/common/fastfood.js +2 -4
- package/common/formulas.instance.json +0 -5
- package/common/formulas.js +3 -1
- package/common/gdefaults.js +2 -3
- package/common/help.js +2 -2
- 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 +22 -63
- package/common/hierarchy.js +12 -13
- package/common/javascript.js +2 -3
- package/common/kirk.instance.json +0 -5
- package/common/kirk.js +2 -3
- package/common/length.instance.json +0 -75
- package/common/length.js +2 -3
- package/common/listener.js +3 -1
- package/common/math.instance.json +0 -5
- package/common/math.js +2 -3
- package/common/menus.instance.json +0 -35
- package/common/menus.js +3 -1
- package/common/meta.js +4 -5
- package/common/nameable.js +3 -1
- package/common/negation.js +2 -2
- package/common/numbers.js +6 -3
- package/common/ordering.instance.json +0 -10
- package/common/ordering.js +2 -3
- package/common/ordinals.js +2 -3
- package/common/people.instance.json +0 -40
- package/common/people.js +2 -3
- package/common/percentages.js +2 -3
- package/common/percentages.test.json +57 -11
- package/common/pipboy.instance.json +84 -85
- package/common/pipboy.js +1 -1
- package/common/pokemon.instance.json +0 -65
- package/common/pokemon.js +1 -2
- package/common/pos.js +2 -2
- package/common/pressure.instance.json +0 -20
- package/common/pressure.js +2 -2
- package/common/properties.instance.json +0 -5
- package/common/properties.js +11 -13
- package/common/punctuation.js +2 -2
- package/common/reminders.instance.json +145 -35
- package/common/reminders.js +264 -82
- package/common/reminders.test.json +69523 -970
- package/common/reports.instance.json +2 -12
- package/common/reports.js +1 -1
- package/common/scorekeeper.js +2 -2
- package/common/sdefaults.js +1 -1
- package/common/self.js +1 -1
- package/common/sizeable.js +2 -2
- package/common/spock.instance.json +0 -5
- package/common/spock.js +1 -1
- package/common/stgame.js +1 -1
- package/common/stm.js +1 -1
- package/common/tell.js +2 -2
- package/common/temperature.instance.json +84 -20
- package/common/temperature.js +2 -2
- package/common/tester.js +0 -1
- package/common/testing.js +0 -1
- package/common/time.js +10 -8
- package/common/time.test.json +73 -119
- package/common/tokenize.js +1 -1
- package/common/ui.instance.json +0 -5
- package/common/ui.js +1 -1
- package/common/weight.instance.json +0 -60
- package/common/weight.js +2 -2
- package/common/wp.instance.json +56 -70
- package/common/wp.js +1 -3
- package/common/yesno.js +2 -2
- package/main.js +2 -0
- package/package.json +8 -4
- package/common/helpers/reminders.js +0 -48
package/common/dates.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
const { knowledgeModule, where } = require('./runtime').theprogrammablemind
|
2
|
-
const { defaultContextCheck } = require('./helpers')
|
2
|
+
const { defaultContextCheck, defaultContextCheckProperties } = require('./helpers')
|
3
3
|
const dates_tests = require('./dates.test.json')
|
4
4
|
const dates_instance = require('./dates.instance.json')
|
5
5
|
const hierarchy = require('./hierarchy')
|
@@ -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,32 @@ 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
|
+
check: defaultContextCheckProperties(['onDate', 'date']),
|
96
|
+
},
|
97
|
+
{
|
98
|
+
id: 'afterDateValue_dates',
|
99
|
+
children: [
|
100
|
+
'day_dates',
|
101
|
+
'month_dates',
|
102
|
+
],
|
103
|
+
},
|
104
|
+
{
|
105
|
+
id: 'afterDate_dates',
|
106
|
+
isA: ['preposition'],
|
107
|
+
bridge: "{ ...next(operator), date: after[0], afterDate: operator, interpolate: '${afterDate} ${date}' }",
|
108
|
+
check: defaultContextCheckProperties(['afterDate', 'date']),
|
109
|
+
},
|
53
110
|
{
|
54
111
|
id: 'era_dates',
|
55
112
|
words: ['era'],
|
@@ -58,13 +115,15 @@ const template = {
|
|
58
115
|
{
|
59
116
|
id: 'date_dates',
|
60
117
|
words: ['date', 'distributable'],
|
118
|
+
isA: ['onDateValue_dates', 'afterDateValue_dates'],
|
61
119
|
bridge: "{ ...next(operator) }"
|
62
120
|
},
|
63
121
|
{
|
64
122
|
id: 'dateEra_dates',
|
65
123
|
isA: ['date_dates'],
|
66
124
|
convolution: true,
|
67
|
-
bridge: "{ ...next(after[0]), era: after[1], interpolate: concat(after[0].interpolate, ' ${era}') }"
|
125
|
+
bridge: "{ ...next(after[0]), era: after[1], interpolate: concat(after[0].interpolate, ' ${era}') }",
|
126
|
+
check: defaultContextCheckProperties(['era']),
|
68
127
|
},
|
69
128
|
{
|
70
129
|
id: 'dateSeparator_dates',
|
@@ -74,8 +133,10 @@ const template = {
|
|
74
133
|
{
|
75
134
|
id: 'monthDayYearWithSlashes_dates',
|
76
135
|
isA: ['date_dates'],
|
136
|
+
before: ['preposition'],
|
77
137
|
convolution: true,
|
78
138
|
bridge: "{ ...next(operator), day: after[2], month: after[0], year: after[4], interpolate: '${month}/${day}/${year}' }",
|
139
|
+
check: defaultContextCheckProperties(['day', 'month', 'year']),
|
79
140
|
},
|
80
141
|
{
|
81
142
|
id: 'dayNumber_dates',
|
@@ -93,20 +154,39 @@ const template = {
|
|
93
154
|
isA: ['integer'],
|
94
155
|
bridge: "{ ...next(operator) }"
|
95
156
|
},
|
157
|
+
{
|
158
|
+
id: 'monthDay_dates',
|
159
|
+
convolution: true,
|
160
|
+
localHierarchy: [['ordinal', 'dayNumber_dates']],
|
161
|
+
before: ['preposition'],
|
162
|
+
isA: ['date_dates'],
|
163
|
+
bridge: "{ ...next(operator), month: after[0], day: after[1], interpolate: '${month} ${day}' }",
|
164
|
+
check: defaultContextCheckProperties(['day', 'month']),
|
165
|
+
},
|
96
166
|
{
|
97
167
|
id: 'monthYear_dates',
|
98
168
|
convolution: true,
|
169
|
+
before: ['preposition'],
|
99
170
|
isA: ['date_dates'],
|
100
|
-
bridge: "{ ...next(operator), month: after[0], year: after[1], interpolate: '${month} ${year}' }"
|
171
|
+
bridge: "{ ...next(operator), month: after[0], year: after[1], interpolate: '${month} ${year}' }",
|
172
|
+
check: defaultContextCheckProperties(['month', 'year']),
|
101
173
|
},
|
102
174
|
{
|
103
175
|
id: 'monthDayYear_dates',
|
104
176
|
convolution: true,
|
177
|
+
before: ['preposition', 'monthDay_dates'],
|
105
178
|
isA: ['date_dates'],
|
179
|
+
evaluator: ({context}) => {
|
180
|
+
const year = context.year.value
|
181
|
+
const day = context.day.value
|
182
|
+
const month_ordinal = context.month.month_ordinal
|
183
|
+
context.evalue = new Date(year, month_ordinal-1, day).toISOString()
|
184
|
+
},
|
106
185
|
localHierarchy: [
|
107
186
|
['ordinal', 'dayNumber_dates'],
|
108
187
|
],
|
109
|
-
bridge: "{ ...next(operator), month: after[0], day: after[1], year: after[2], interpolate: '${month} ${day} ${year}' }"
|
188
|
+
bridge: "{ ...next(operator), month: after[0], day: after[1], year: after[2], interpolate: '${month} ${day} ${year}' }",
|
189
|
+
check: defaultContextCheckProperties(['month', 'day', 'year']),
|
110
190
|
},
|
111
191
|
],
|
112
192
|
words: {
|
@@ -130,17 +210,31 @@ const template = {
|
|
130
210
|
}
|
131
211
|
},
|
132
212
|
(args) => {
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
args.makeObject({...args, context: { word: as[i], value: `${
|
213
|
+
{
|
214
|
+
const as = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sept', 'oct', 'nov', 'dec']
|
215
|
+
const ms = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december']
|
216
|
+
// args.makeObject({...args, context: { word: as[i], value: `${ms[i]}_dates`}, types: [`${ms[i]}_dates`]})
|
217
|
+
for (let i = 0; i < as.length; ++i) {
|
218
|
+
const word = as[i]
|
219
|
+
if (word == 'may') {
|
220
|
+
continue
|
221
|
+
}
|
222
|
+
const id = `${ms[i]}_dates`
|
223
|
+
args.addWords(id, word, { value: id, abbreviation: word, month_ordinal: i+1 })
|
224
|
+
}
|
225
|
+
}
|
226
|
+
|
227
|
+
{
|
228
|
+
const as = ['sun', 'mon', 'tues', 'weds', 'thurs', 'fri', 'sat']
|
229
|
+
const ms = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday']
|
230
|
+
// args.makeObject({...args, context: { word: as[i], value: `${ms[i]}_dates`}, types: [`${ms[i]}_dates`]})
|
231
|
+
for (let i = 0; i < as.length; ++i) {
|
232
|
+
const word = as[i]
|
233
|
+
const id = `${ms[i]}_dates`
|
234
|
+
args.addWords(id, word, { value: id, abbreviation: word, day_ordinal: i+1 })
|
235
|
+
}
|
137
236
|
}
|
138
237
|
|
139
|
-
/*
|
140
|
-
const word = 'bc'
|
141
|
-
const synonym = 'bce'
|
142
|
-
args.makeObject({...args, context: { word: synonym, value: `${synonym}_dates`}, types: [`${word}_dates`]})
|
143
|
-
*/
|
144
238
|
},
|
145
239
|
"resetIdSuffix",
|
146
240
|
],
|
@@ -156,8 +250,11 @@ knowledgeModule( {
|
|
156
250
|
name: './dates.test.json',
|
157
251
|
contents: dates_tests,
|
158
252
|
checks: {
|
159
|
-
context:
|
160
|
-
|
253
|
+
context: [
|
254
|
+
// defaultContextCheck({ marker: 'monthDayYear_dates', exported: true, extra: ['month', 'day', 'year'] }),
|
255
|
+
defaultContextCheck({ extra: ['month', 'day', 'year', 'era', 'month_ordinal', 'day_ordinal', 'month', 'date'] }),
|
256
|
+
],
|
257
|
+
}
|
161
258
|
},
|
162
259
|
template: {
|
163
260
|
template,
|