tpmkms_4wp 8.9.1-beta.2 → 8.9.1-beta.21
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 +348 -68
- package/common/articles.js +20 -4
- package/common/articles.test.json +338 -0
- package/common/asking.js +3 -3
- package/common/asking.test.json +41 -0
- package/common/avatar.js +1 -1
- package/common/characters.js +1 -1
- package/common/colors.instance.json +608 -113
- package/common/comparable.instance.json +60 -12
- package/common/comparable.js +2 -2
- package/common/concept.js +2 -2
- package/common/conjunction.js +1 -1
- package/common/countable.js +3 -9
- package/common/countable.test.json +0 -586
- package/common/crew.instance.json +520 -392
- package/common/currency.js +2 -2
- package/common/dialogues.js +28 -11
- package/common/dimension.instance.json +16 -8
- package/common/dimension.js +2 -2
- package/common/edible.instance.json +595 -229
- package/common/emotions.instance.json +20 -4
- package/common/errors.js +3 -1
- package/common/events.js +1 -1
- package/common/fastfood.instance.json +2095 -1498
- package/common/fastfood.js +16 -10
- package/common/formulas.instance.json +16 -5
- package/common/formulas.js +1 -1
- package/common/formulas.test.json +461 -10
- package/common/gdefaults.js +27 -14
- package/common/help.js +4 -4
- package/common/help.test.json +4 -4
- package/common/helpers/concept.js +5 -5
- package/common/helpers/conjunction.js +1 -1
- package/common/helpers/formulas.js +4 -4
- package/common/helpers/frankenhash.js +4 -4
- package/common/helpers/meta.js +4 -4
- package/common/helpers/ordering.js +2 -2
- package/common/helpers/properties.js +17 -17
- package/common/helpers.js +17 -1
- package/common/hierarchy.js +3 -3
- package/common/javascript.js +1 -1
- package/common/kirk.instance.json +20 -4
- package/common/length.instance.json +300 -80
- package/common/math.instance.json +16 -5
- package/common/math.js +1 -1
- package/common/meta.js +5 -5
- package/common/nameable.js +1 -1
- package/common/negation.js +1 -1
- package/common/numbers.js +1 -1
- package/common/ordering.instance.json +41 -11
- package/common/ordinals.js +9 -3
- package/common/ordinals.test.json +327 -0
- package/common/people.instance.json +228 -80
- package/common/people.js +1 -1
- package/common/percentages.js +1 -1
- package/common/pipboy.instance.json +334 -180
- package/common/pipboy.js +6 -6
- package/common/pokemon.instance.json +304 -57
- package/common/pos.js +16 -6
- package/common/pressure.instance.json +64 -23
- package/common/properties.instance.json +20 -4
- package/common/properties.js +6 -6
- package/common/punctuation.js +1 -1
- package/common/reports.instance.json +34 -12
- package/common/reports.js +9 -9
- package/common/scorekeeper.js +5 -5
- package/common/sdefaults.js +2 -2
- package/common/sizeable.js +2 -2
- package/common/spock.instance.json +20 -4
- package/common/stm.js +6 -6
- package/common/tell.js +1 -1
- package/common/temperature.instance.json +64 -24
- package/common/tester.js +1 -1
- package/common/ui.instance.json +21 -5
- package/common/weight.instance.json +261 -109
- package/common/wp.instance.json +6621 -404
- package/common/wp.js +199 -41
- package/common/wp.test.json +109575 -3828
- package/common/yesno.js +1 -1
- package/package.json +11 -6
package/common/wp.js
CHANGED
@@ -9,15 +9,66 @@ const wp_tests = require('./wp.test.json')
|
|
9
9
|
const instance = require('./wp.instance.json')
|
10
10
|
|
11
11
|
/*
|
12
|
+
done
|
13
|
+
|
14
|
+
bold the first word
|
15
|
+
bold the first paragraph
|
16
|
+
bold the first letter
|
17
|
+
bold the first word of every paragraph
|
18
|
+
bold the first word of the second and third paragraph
|
19
|
+
bold the paragraph that contains words that start with t
|
20
|
+
underline the paragraph that contains bolded words
|
21
|
+
underline the paragraphs that contain bolded words
|
22
|
+
bold the first letter of every word
|
23
|
+
bold the third letter of the second paragraph
|
24
|
+
bold the first letter of every word that starts with t
|
25
|
+
underline the bolded words in the second paragraph
|
26
|
+
bold the words that start with t in the second paragraph
|
27
|
+
bold the first letter of the words that start with t in the second paragraph
|
28
|
+
in the second paragraph bold the first word
|
29
|
+
in the second paragraph bold the first letter of the words that start with t
|
30
|
+
underline the first bolded word
|
31
|
+
underline the first three words
|
32
|
+
in the first and second paragraph bold the second word
|
33
|
+
underline the first three bolded words
|
34
|
+
capitalize the first letter of the words that start with t
|
35
|
+
|
36
|
+
current
|
37
|
+
|
38
|
+
change is editable to is really editable
|
39
|
+
|
40
|
+
todo
|
41
|
+
|
42
|
+
the first to fifth word
|
43
|
+
underline the last three words
|
44
|
+
for paragraph 1 and 2 bold the first word
|
45
|
+
in the second paragraph for the words that start with t bold the first letter
|
46
|
+
underline the bolded paragraphs
|
47
|
+
bold the first three words after the second bolded letter
|
48
|
+
underline the words that start with t in the paragraph with 3 bolded words
|
49
|
+
underline the paragraph that contains three bolded words
|
50
|
+
underline the first bolded word that start with t
|
51
|
+
bold the first word of the second paragraph and third paragraph
|
52
|
+
the paragraph that contains the word boobies
|
53
|
+
|
54
|
+
after
|
55
|
+
make the words that start with t blue
|
56
|
+
|
12
57
|
the bolded words that start with t
|
13
58
|
|
59
|
+
replace better with worse
|
60
|
+
|
61
|
+
change underlines to bolds
|
62
|
+
|
14
63
|
start inserting text until I say banana
|
15
64
|
...
|
16
65
|
or
|
17
66
|
stop inserting text
|
18
67
|
|
19
68
|
make the text of the 1st to 3rd paragraphs blue
|
20
|
-
|
69
|
+
|
70
|
+
capitalize the words banana and word
|
71
|
+
capitalize banana and tree
|
21
72
|
|
22
73
|
make the words that start with a bold
|
23
74
|
|
@@ -40,6 +91,8 @@ const instance = require('./wp.instance.json')
|
|
40
91
|
words containing a
|
41
92
|
every 5th word
|
42
93
|
|
94
|
+
the words that are capitalized
|
95
|
+
|
43
96
|
in the first paragraph make the words that start with abc bold
|
44
97
|
bold the first three words that start with t
|
45
98
|
bold much and many
|
@@ -74,7 +127,7 @@ const setUpdate = (isA, update, states) => {
|
|
74
127
|
if (!update.styles) {
|
75
128
|
update.styles = []
|
76
129
|
}
|
77
|
-
|
130
|
+
const style = root(state.value)
|
78
131
|
/*
|
79
132
|
if (style == 'underlined') {
|
80
133
|
style = 'underline'
|
@@ -91,31 +144,68 @@ const setUpdate = (isA, update, states) => {
|
|
91
144
|
|
92
145
|
const api = new API()
|
93
146
|
|
94
|
-
|
147
|
+
const config = {
|
95
148
|
name: 'wp',
|
96
149
|
};
|
97
150
|
|
98
151
|
const changeState = ({api, isA, context, toArray, element, state}) => {
|
99
|
-
let unit = root(context.element.marker)
|
100
152
|
let scope
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
conditions.push(
|
153
|
+
|
154
|
+
const getElement = (selector, update) => {
|
155
|
+
const unit = root(selector.marker)
|
156
|
+
const conditions = []
|
157
|
+
let scope;
|
158
|
+
const condition = []
|
159
|
+
if (selector.ordinal) {
|
160
|
+
// TODO think this out better but its just POC so good enough for now
|
161
|
+
const condition = { ordinals: toArray(selector.ordinal).map((context) => context.value) }
|
162
|
+
if (selector.quantity) {
|
163
|
+
condition.count = selector.quantity.value
|
164
|
+
}
|
165
|
+
conditions.push(condition)
|
166
|
+
} else if (isA(selector, 'everything')) {
|
167
|
+
scope = 'all'
|
168
|
+
} else if (selector.quantity) {
|
169
|
+
scope = selector.quantity.quantity
|
170
|
+
} if (selector.distributer) {
|
171
|
+
scope = selector.distributer.value
|
172
|
+
}
|
173
|
+
|
174
|
+
if (selector.conditions) {
|
175
|
+
for (const condition of selector.conditions) {
|
176
|
+
if (condition.marker == 'wordComparisonWithVerb_wp') {
|
177
|
+
// with or not with that is the question
|
178
|
+
const letters = condition.letters.letters.text
|
179
|
+
conditions.push({ comparison: condition.comparison, letters })
|
180
|
+
} else if (condition.marker == 'wordComparison_wp') {
|
181
|
+
// with or not with that is the question
|
182
|
+
const letters = condition.letters.text
|
183
|
+
conditions.push({ comparison: condition.comparison, letters })
|
184
|
+
} else if (condition.marker == 'paragraphComparisonVerb_wp') {
|
185
|
+
// with or not with that is the question
|
186
|
+
const update = { selectors: [] }
|
187
|
+
const words = getElement(condition.words, update)
|
188
|
+
conditions.push({ comparison: condition.comparison, words: update})
|
189
|
+
} else if (isA(condition, 'styleModifier_wp')) {
|
190
|
+
for (const style of toArray(condition)) {
|
191
|
+
conditions.push({ hasStyle: style.marker })
|
192
|
+
}
|
193
|
+
}
|
194
|
+
}
|
195
|
+
}
|
196
|
+
|
197
|
+
if (selector.context) {
|
198
|
+
for (const context of toArray(selector.context)) {
|
199
|
+
getElement(context, update)
|
200
|
+
}
|
114
201
|
}
|
115
|
-
|
116
|
-
scope
|
202
|
+
|
203
|
+
update.selectors.push({ unit, scope, conditions })
|
117
204
|
}
|
118
|
-
|
205
|
+
|
206
|
+
const update = { selectors: [] }
|
207
|
+
getElement(context.element, update)
|
208
|
+
|
119
209
|
setUpdate(isA, update, toArray(context.state))
|
120
210
|
api.changeState(update)
|
121
211
|
}
|
@@ -123,10 +213,11 @@ const changeState = ({api, isA, context, toArray, element, state}) => {
|
|
123
213
|
template = {
|
124
214
|
configs: [
|
125
215
|
'setidsuffix _wp',
|
126
|
-
'words are countable and statefulElements',
|
127
|
-
'characters are countable',
|
128
|
-
'paragraphs are countable and statefulElement',
|
216
|
+
'words are countable distributable orderable textContainers and statefulElements',
|
217
|
+
'characters are countable distributable orderable and statefulElements',
|
218
|
+
'paragraphs are countable distributable orderable textContainers and statefulElement',
|
129
219
|
'text is a statefulElement',
|
220
|
+
'letters means characters',
|
130
221
|
'bold, italic, code, capitalize, lowercase and underline are styles',
|
131
222
|
'underlined means underline',
|
132
223
|
'capitalized means capitalize',
|
@@ -134,27 +225,98 @@ template = {
|
|
134
225
|
'italicize means italic',
|
135
226
|
'italicized means italic',
|
136
227
|
// TODO have a mode where I can stay this is a definition sentence then just say style modifies and it will do it right
|
137
|
-
'capitalized, bolded, italicized and underlined are styleModifiers',
|
228
|
+
'uppercased, lowercased, capitalized, bolded, italicized and underlined are styleModifiers',
|
138
229
|
// 'start end and contain are wordComparisonWiths',
|
139
230
|
// 'styles are negatable',
|
140
231
|
"resetIdSuffix",
|
141
232
|
{
|
142
233
|
operators: [
|
234
|
+
"([change_wp|change] (context.text !== 'to')* (context.text == 'to'))",
|
143
235
|
"([changeState_wp|make] ([statefulElement_wp]) ([stateValue_wp|]))",
|
144
236
|
"((style_wp/*) [applyStyle_wp] ([statefulElement_wp|]))",
|
145
|
-
"((word_wp/*) [
|
237
|
+
"((word_wp/*) [wordComparisonWithVerb_wp] ([comparisonWith_wp|with] (a/0)? (letters)))",
|
146
238
|
"((word_wp/*) [wordComparison_wp] (a/0)? (letters))",
|
147
|
-
"
|
239
|
+
// this one is "the bolded/underlined/italized/... word"
|
240
|
+
"((styleModifier_wp/*) [modifiedByStyle_wp] (statefulElement_wp/* && context.determiner == undefined))",
|
241
|
+
// the first letter of each paragraph
|
242
|
+
"((statefulElement_wp/*)? <statefulElementInContext_wp|of,in> (statefulElement_wp/*))",
|
243
|
+
// the paragraph that contains words that start with t
|
244
|
+
"((paragraph_wp/*) [paragraphComparisonVerb_wp] (word_wp/*))",
|
148
245
|
],
|
246
|
+
associations: {
|
247
|
+
negative: [
|
248
|
+
],
|
249
|
+
positive: [
|
250
|
+
// TODO remove these after crucible work done and fix the associator rules
|
251
|
+
// [['style_wp', 0], ['statefulElement_wp', 0], ['statefulElementInContext_wp', 0], ['every', 0], ['statefulElement_wp', 0]],
|
252
|
+
[['style_wp', 0], ['word_wp', 0], ['statefulElementInContext_wp', 0], ['paragraph_wp', 0]],
|
253
|
+
[['style_wp', 0], ['letter_wp', 0], ['statefulElementInContext_wp', 0], ['word_wp', 0]],
|
254
|
+
// [['statefulElement_wp', 1], ['statefulElementInContext_wp', 0], ['every', 0], ['statefulElement_wp', 1]],
|
255
|
+
[['paragraph_wp', 0], ['thatVerb', 0], ['paragraphComparisonVerb_wp', 0], ['word_wp', 0]],
|
256
|
+
[['paragraph_wp', 0], ['thatVerb', 0], ['paragraphComparisonVerb_wp', 0], ['styleModifier_wp', 0], ['word_wp', 0]],
|
257
|
+
[['word_wp', 0], ['thatVerb', 0], ['wordComparison_wp', 0]],
|
258
|
+
]
|
259
|
+
},
|
260
|
+
|
149
261
|
bridges: [
|
262
|
+
{
|
263
|
+
id: 'change_wp',
|
264
|
+
bridge: "{ ...next(operator), from: after[0][0], generate: [operator, 'from', after[1]] }",
|
265
|
+
},
|
266
|
+
{
|
267
|
+
id: 'paragraphComparisonVerb_wp',
|
268
|
+
parents: ['verb'],
|
269
|
+
words: [
|
270
|
+
{ word: 'contain', comparison: 'include' },
|
271
|
+
{ word: 'contains', comparison: 'include' },
|
272
|
+
{ word: 'include', comparison: 'include' },
|
273
|
+
{ word: 'includes', comparison: 'include' },
|
274
|
+
],
|
275
|
+
bridge: "{ ...next(operator), element: before[0], subject: before[0], words: after[0], verb: operator, generate: ['element', 'verb', 'words'] }",
|
276
|
+
},
|
277
|
+
{
|
278
|
+
id: 'statefulElementInContext_wp',
|
279
|
+
parents: ['preposition'],
|
280
|
+
optional: {
|
281
|
+
'-1': "{ ...operator, invisible: true }",
|
282
|
+
},
|
283
|
+
bridge: "{ ...next(before[0]), context: append(before[0].context, [after[0]]), generate: [before[0], operator, after[0]], modifiers: [] }",
|
284
|
+
semantic: (args) => {
|
285
|
+
const { context, contexts } = args
|
286
|
+
for (let i = context.context_index + 1; i < contexts.length; ++i) {
|
287
|
+
if (contexts[i].marker == 'applyStyle_wp') {
|
288
|
+
const element = contexts[i].element
|
289
|
+
if (!element.context) {
|
290
|
+
element.context = []
|
291
|
+
}
|
292
|
+
element.context = element.context.concat(context.context)
|
293
|
+
}
|
294
|
+
}
|
295
|
+
console.log(JSON.stringify(Object.keys(args)))
|
296
|
+
},
|
297
|
+
},
|
298
|
+
{
|
299
|
+
id: 'applyStyle_wp',
|
300
|
+
parents: ['verb'],
|
301
|
+
convolution: true,
|
302
|
+
bridge: "{ ...next(operator), element: after[0], state: before[0], operator: operator, generate: ['state', 'element'] }",
|
303
|
+
localHierarchy: [
|
304
|
+
['thisitthat', 'statefulElement_wp'],
|
305
|
+
['everything', 'statefulElement_wp'],
|
306
|
+
],
|
307
|
+
semantic: (args) => {
|
308
|
+
changeState({...args, element: args.context.element, state: args.context.state})
|
309
|
+
}
|
310
|
+
},
|
150
311
|
{
|
151
312
|
id: 'modifiedByStyle_wp',
|
313
|
+
// parents: ['verb'],
|
152
314
|
parents: ['adjective'],
|
153
315
|
convolution: true,
|
154
316
|
bridge: "{ ...after[0], style: before[0], target: after[0], generate: ['style', 'target'], conditions: append(after[0].conditions, [before[0]]) }",
|
155
317
|
},
|
156
318
|
{
|
157
|
-
id: '
|
319
|
+
id: 'wordComparisonWithVerb_wp',
|
158
320
|
parents: ['verb'],
|
159
321
|
words: [
|
160
322
|
{ word: 'start', comparison: 'prefix' },
|
@@ -186,19 +348,6 @@ template = {
|
|
186
348
|
},
|
187
349
|
bridge: "{ ...next(operator), operator: operator, letters: after[1], generate: ['operator', 'letters'] }",
|
188
350
|
},
|
189
|
-
{
|
190
|
-
id: 'applyStyle_wp',
|
191
|
-
parents: ['verb'],
|
192
|
-
convolution: true,
|
193
|
-
bridge: "{ ...next(operator), element: after[0], state: before[0], operator: operator, generate: ['state', 'element'] }",
|
194
|
-
localHierarchy: [
|
195
|
-
['thisitthat', 'statefulElement_wp'],
|
196
|
-
['everything', 'statefulElement_wp'],
|
197
|
-
],
|
198
|
-
semantic: (args) => {
|
199
|
-
changeState({...args, element: args.context.element, state: args.context.state})
|
200
|
-
}
|
201
|
-
},
|
202
351
|
{
|
203
352
|
id: 'changeState_wp',
|
204
353
|
parents: ['verb'],
|
@@ -240,6 +389,15 @@ template = {
|
|
240
389
|
},
|
241
390
|
],
|
242
391
|
priorities: [
|
392
|
+
{ "context": [['ordinal', 1], ['list', 0], ['ordinal', 1], ['statefulElement_wp', 0]], ordered: true, choose: [1] },
|
393
|
+
{ "context": [['word_wp', 1], ['wordComparisonWithVerb_wp', 0], ['comparisonWith_wp', 1], ['statefulElementInContext_wp', 0]], ordered: true, choose: [1] },
|
394
|
+
{ "context": [['paragraphComparisonVerb_wp', 0], ['word_wp', 0], ['wordComparisonWithVerb_wp', 0]], ordered: true, choose: [2] },
|
395
|
+
{ "context": [['statefulElementInContext_wp', 0], ['word_wp', 0], ['wordComparisonWithVerb_wp', 0]], ordered: true, choose: [2] },
|
396
|
+
{ "context": [['statefulElementInContext_wp', 0], ['word_wp', 1], ['wordComparisonWithVerb_wp', 0], ['comparisonWith_wp', 1]], ordered: true, choose: [2,3] },
|
397
|
+
{ "context": [['statefulElementInContext_wp', 0], ['comparisonWith_wp', 0]], choose: [1] },
|
398
|
+
{ "context": [['paragraphComparisonVerb_wp', 0], ['wordComparisonWithVerb_wp', 0]], choose: [1] },
|
399
|
+
{ "context": [['ordinal',1], ['list', 0], ['ordinal', 1], ['word_wp', 1]], ordered: true, choose: [1] },
|
400
|
+
{ "context": [['changeState_wp',0], ['every', 0], ['word_wp', 1], ['list', 1]], ordered: true, choose: [1] },
|
243
401
|
{ "context": [['changeState_wp',0], ['statefulElement_wp', 0], ['list', 0]], ordered: true, choose: [0] },
|
244
402
|
{ "context": [['comparisonWith_wp',0], ['unknown', 0], ['list', 1]], ordered: true, choose: [0] },
|
245
403
|
],
|
@@ -262,7 +420,7 @@ knowledgeModule({
|
|
262
420
|
contents: wp_tests,
|
263
421
|
checks: {
|
264
422
|
context: [
|
265
|
-
...defaultContextCheck(),
|
423
|
+
...defaultContextCheck(['distributer', 'subject', 'element', 'letters', 'target', 'conditions' ]),
|
266
424
|
],
|
267
425
|
objects: [
|
268
426
|
'changeState',
|