tpmkms_4wp 9.2.0 → 9.3.0-beta.1
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 +21 -8
- package/common/avatar.js +2 -10
- package/common/colors.instance.json +32 -46
- package/common/comparable.instance.json +3 -0
- package/common/comparable.js +2 -2
- package/common/crew.instance.json +4736 -964
- package/common/crew.test.json +1904 -0
- package/common/dates.instance.json +28643 -0
- package/common/dates.js +167 -0
- package/common/dates.test.json +16226 -0
- package/common/dialogues.js +28 -9
- package/common/dimension.instance.json +3 -2
- package/common/edible.instance.json +1474 -759
- package/common/emotions.instance.json +7 -14
- package/common/emotions.js +4 -5
- package/common/fastfood.instance.json +3914 -722
- package/common/fastfood.js +7 -0
- package/common/formulas.instance.json +1 -0
- package/common/gdefaults.js +18 -0
- package/common/helpers/concept.js +1 -0
- package/common/helpers/dialogues.js +3 -0
- package/common/helpers/properties.js +2 -27
- package/common/helpers.js +70 -1
- package/common/hierarchy.js +4 -3
- package/common/kirk.instance.json +186 -124
- package/common/length.instance.json +17 -2
- package/common/math.instance.json +1 -0
- package/common/menus.instance.json +7 -0
- package/common/menus.js +1 -0
- package/common/menus.test.json +2418 -1355
- package/common/meta.js +3 -3
- package/common/ordering.instance.json +4 -2
- package/common/people.instance.json +8 -0
- package/common/pipboy.instance.json +29 -68
- package/common/pokemon.instance.json +24 -3
- package/common/pressure.instance.json +6 -2
- package/common/properties.instance.json +1 -0
- package/common/properties.js +19 -5
- package/common/punctuation.js +3 -0
- package/common/reports.instance.json +24 -14
- package/common/reports.js +2 -2
- package/common/self.instance.json +2 -0
- package/common/self.js +49 -0
- package/common/self.test.json +2 -0
- package/common/spock.instance.json +186 -124
- package/common/temperature.instance.json +6 -2
- package/common/ui.instance.json +1 -0
- package/common/weight.instance.json +12 -0
- package/common/wp.instance.json +777 -151
- package/common/wp.js +15 -2
- package/main.js +4 -0
- package/package.json +10 -2
package/common/dates.js
ADDED
@@ -0,0 +1,167 @@
|
|
1
|
+
const { knowledgeModule, where } = require('./runtime').theprogrammablemind
|
2
|
+
const { defaultContextCheck } = require('./helpers')
|
3
|
+
const dates_tests = require('./dates.test.json')
|
4
|
+
const dates_instance = require('./dates.instance.json')
|
5
|
+
const hierarchy = require('./hierarchy')
|
6
|
+
const ordinals = require('./ordinals')
|
7
|
+
const helpers = require('./helpers')
|
8
|
+
|
9
|
+
/*
|
10
|
+
january 10 1990
|
11
|
+
january 1990
|
12
|
+
january 20th
|
13
|
+
*/
|
14
|
+
const template = {
|
15
|
+
configs: [
|
16
|
+
"setidsuffix _dates",
|
17
|
+
"january, february, march, april, may, june, july, august, september, october, november and december are months",
|
18
|
+
"monday, tuesday, wednesday, thursday, friday, saturday and sunday are days",
|
19
|
+
"ac, bc, bce and ad are eras",
|
20
|
+
// "ac, bc,, bce,, and ad are eras",
|
21
|
+
/*
|
22
|
+
"bc and bce mean the same thing",
|
23
|
+
"ad is a synonym for ce",
|
24
|
+
"bc stands for before christ",
|
25
|
+
"ad synonym for anno domino",
|
26
|
+
"bce stands for before common era",
|
27
|
+
"ce is an abbreviation of common era",
|
28
|
+
"use ce and bce",
|
29
|
+
"use bc and ad",
|
30
|
+
*/
|
31
|
+
{
|
32
|
+
operators: [
|
33
|
+
"([dayNumber_dates|])",
|
34
|
+
"([yearNumber_dates|])",
|
35
|
+
"([monthNumber_dates|])",
|
36
|
+
"([dateSeparator_dates|])",
|
37
|
+
"([era_dates|])",
|
38
|
+
"([date_dates|])",
|
39
|
+
"([dateEra_dates] (date_dates/*) (era_dates/*))",
|
40
|
+
"([monthYear_dates] (month_dates/*) (yearNumber_dates/*))",
|
41
|
+
"([monthDayYear_dates] (month_dates/*) (dayNumber_dates/*) (yearNumber_dates/*))",
|
42
|
+
"([monthDayYearWithSlashes_dates] (monthNumber_dates/*) (dateSeparator_dates/*) (dayNumber_dates/*) (dateSeparator_dates/*) (yearNumber_dates/*))",
|
43
|
+
],
|
44
|
+
associations: {
|
45
|
+
positive: [
|
46
|
+
{ context: [['every', 0], ['monday_dates', 0]], choose: 1 },
|
47
|
+
]
|
48
|
+
},
|
49
|
+
hierarchy: [
|
50
|
+
['monday_dates', 'distributable'],
|
51
|
+
],
|
52
|
+
bridges: [
|
53
|
+
{
|
54
|
+
id: 'era_dates',
|
55
|
+
words: ['era'],
|
56
|
+
bridge: "{ ...next(operator) }"
|
57
|
+
},
|
58
|
+
{
|
59
|
+
id: 'date_dates',
|
60
|
+
words: ['date', 'distributable'],
|
61
|
+
bridge: "{ ...next(operator) }"
|
62
|
+
},
|
63
|
+
{
|
64
|
+
id: 'dateEra_dates',
|
65
|
+
isA: ['date_dates'],
|
66
|
+
convolution: true,
|
67
|
+
bridge: "{ ...next(after[0]), era: after[1], interpolate: concat(after[0].interpolate, ' ${era}') }"
|
68
|
+
},
|
69
|
+
{
|
70
|
+
id: 'dateSeparator_dates',
|
71
|
+
words: ['/'],
|
72
|
+
bridge: "{ ...next(operator) }"
|
73
|
+
},
|
74
|
+
{
|
75
|
+
id: 'monthDayYearWithSlashes_dates',
|
76
|
+
isA: ['date_dates'],
|
77
|
+
convolution: true,
|
78
|
+
bridge: "{ ...next(operator), day: after[2], month: after[0], year: after[4], interpolate: '${month}/${day}/${year}' }",
|
79
|
+
},
|
80
|
+
{
|
81
|
+
id: 'dayNumber_dates',
|
82
|
+
isA: ['integer'],
|
83
|
+
//associations: ['dates'],
|
84
|
+
bridge: "{ ...next(operator) }"
|
85
|
+
},
|
86
|
+
{
|
87
|
+
id: 'monthNumber_dates',
|
88
|
+
isA: ['integer'],
|
89
|
+
bridge: "{ ...next(operator) }"
|
90
|
+
},
|
91
|
+
{
|
92
|
+
id: 'yearNumber_dates',
|
93
|
+
isA: ['integer'],
|
94
|
+
bridge: "{ ...next(operator) }"
|
95
|
+
},
|
96
|
+
{
|
97
|
+
id: 'monthYear_dates',
|
98
|
+
convolution: true,
|
99
|
+
isA: ['date_dates'],
|
100
|
+
bridge: "{ ...next(operator), month: after[0], year: after[1], interpolate: '${month} ${year}' }"
|
101
|
+
},
|
102
|
+
{
|
103
|
+
id: 'monthDayYear_dates',
|
104
|
+
convolution: true,
|
105
|
+
isA: ['date_dates'],
|
106
|
+
localHierarchy: [
|
107
|
+
['ordinal', 'dayNumber_dates'],
|
108
|
+
],
|
109
|
+
bridge: "{ ...next(operator), month: after[0], day: after[1], year: after[2], interpolate: '${month} ${day} ${year}' }"
|
110
|
+
},
|
111
|
+
],
|
112
|
+
words: {
|
113
|
+
patterns: [
|
114
|
+
{
|
115
|
+
pattern: [{ type: 'digit' }, { repeat: true }],
|
116
|
+
allow_partial_matches: false,
|
117
|
+
defs: [{id: "dayNumber_dates", uuid: '1', initial: "{ value: int(text), instance: true }" }]
|
118
|
+
},
|
119
|
+
{
|
120
|
+
pattern: [{ type: 'digit' }, { repeat: true }],
|
121
|
+
allow_partial_matches: false,
|
122
|
+
defs: [{id: "monthNumber_dates", uuid: '1', initial: "{ value: int(text), instance: true }" }]
|
123
|
+
},
|
124
|
+
{
|
125
|
+
pattern: [{ type: 'digit' }, { repeat: true }],
|
126
|
+
allow_partial_matches: false,
|
127
|
+
defs: [{id: "yearNumber_dates", uuid: '1', initial: "{ value: int(text), instance: true }" }]
|
128
|
+
},
|
129
|
+
],
|
130
|
+
}
|
131
|
+
},
|
132
|
+
(args) => {
|
133
|
+
const as = ['jan', 'feb', 'mar', 'apr', 'jun', 'jul', 'aug', 'sept', 'oct', 'nov', 'dec']
|
134
|
+
const ms = ['january', 'february', 'march', 'april', 'june', 'july', 'august', 'september', 'october', 'november', 'december']
|
135
|
+
for (let i = 0; i < as.length; ++i) {
|
136
|
+
args.makeObject({...args, context: { word: as[i], value: `${as[i]}_dates`}, types: [`${ms[i]}_dates`]})
|
137
|
+
}
|
138
|
+
|
139
|
+
/*
|
140
|
+
const word = 'bc'
|
141
|
+
const synonym = 'bce'
|
142
|
+
args.makeObject({...args, context: { word: synonym, value: `${synonym}_dates`}, types: [`${word}_dates`]})
|
143
|
+
*/
|
144
|
+
},
|
145
|
+
"resetIdSuffix",
|
146
|
+
],
|
147
|
+
}
|
148
|
+
|
149
|
+
knowledgeModule( {
|
150
|
+
config: { name: 'dates' },
|
151
|
+
includes: [ordinals, hierarchy],
|
152
|
+
|
153
|
+
module,
|
154
|
+
description: 'talking about dates',
|
155
|
+
test: {
|
156
|
+
name: './dates.test.json',
|
157
|
+
contents: dates_tests,
|
158
|
+
checks: {
|
159
|
+
context: defaultContextCheck(['day', 'month', 'year', 'era']),
|
160
|
+
},
|
161
|
+
},
|
162
|
+
template: {
|
163
|
+
template,
|
164
|
+
instance: dates_instance,
|
165
|
+
},
|
166
|
+
|
167
|
+
})
|