tpmkms_4wp 9.5.1-beta.2 → 9.5.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 +21 -61
- package/common/asking.js +102 -100
- package/common/can.instance.json +2180 -0
- package/common/can.js +254 -0
- package/common/can.test.json +50706 -0
- package/common/characters.js +3 -3
- package/common/colors.instance.json +38 -10
- package/common/comparable.instance.json +2 -2
- package/common/concept.test.json +54 -40
- package/common/conjunction.js +13 -5
- package/common/crew.instance.json +241 -123
- package/common/crew.js +1 -1
- package/common/currency.js +1 -1
- package/common/dates.instance.json +87 -3
- package/common/dialogues.js +41 -119
- package/common/dimension.instance.json +16 -12
- package/common/dimension.js +23 -4
- package/common/dimension.test.json +1758 -2351
- package/common/edible.instance.json +79 -95
- package/common/emotions.instance.json +53 -80
- package/common/emotions.js +1 -1
- package/common/english_helpers.js +277 -67
- package/common/fastfood.instance.json +35 -663
- package/common/fastfood.js +4 -4
- package/common/formulas.instance.json +1 -1
- package/common/gdefaults.js +85 -14
- package/common/help.js +2 -2
- package/common/help.test.json +65 -11
- package/common/helpers/concept.js +1 -1
- package/common/helpers/conjunction.js +54 -44
- package/common/helpers/dateTimeSelectors.js +2 -2
- package/common/helpers/dialogues.js +1 -1
- package/common/helpers/formulas.js +13 -11
- package/common/helpers/menus.js +12 -12
- package/common/helpers/meta.js +8 -8
- package/common/helpers/properties.js +102 -21
- package/common/helpers.js +82 -46
- package/common/hierarchy.js +4 -3
- package/common/kirk.instance.json +1 -1
- package/common/latin.instance.json +10 -10
- package/common/latin.js +5 -5
- package/common/length.instance.json +20 -2
- package/common/length.test.json +2241 -1801
- package/common/math.instance.json +20 -20
- package/common/math.js +45 -44
- package/common/menus.instance.json +3 -3
- package/common/menus.js +1 -1
- package/common/meta.js +49 -33
- package/common/ordering.instance.json +20 -30
- package/common/ordering.js +1 -1
- package/common/ordering.test.json +354 -296
- package/common/people.instance.json +56 -258
- package/common/people.js +1 -1
- package/common/people.test.json +952 -681
- package/common/pipboy.instance.json +72 -16
- package/common/pokemon.instance.json +8 -8
- package/common/pokemon.js +1 -1
- package/common/pressure.instance.json +6 -2
- package/common/properties.instance.json +4 -12
- package/common/properties.js +16 -3
- package/common/reminders.js +1 -1
- package/common/reports.instance.json +3 -3
- package/common/reports.js +18 -16
- package/common/scorekeeper.js +4 -4
- package/common/sdefaults.js +22 -2
- package/common/spock.instance.json +1 -1
- package/common/stgame.js +1 -1
- package/common/stm.js +2 -2
- package/common/tell.js +1 -1
- package/common/temperature.instance.json +6 -2
- package/common/tester.js +3 -3
- package/common/time.js +3 -3
- package/common/tokenize.js +1 -1
- package/common/weight.instance.json +19 -2
- package/common/words.instance.json +9 -0
- package/common/words.js +53 -0
- package/common/words.test.json +2 -0
- package/common/wp.instance.json +320 -8
- package/common/wp.js +8 -4
- package/common/wp.test.json +3469 -0
- package/main.js +0 -2
- package/package.json +9 -5
- package/common/listener.js +0 -50
- package/common/listener.test.json +0 -142
package/common/helpers.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
const pluralize = require('pluralize')
|
|
2
|
+
const { flatten } = require('./runtime').theprogrammablemind
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
function unshiftL(list, element, max) {
|
|
4
5
|
if (list.length >= max) {
|
|
5
6
|
list.pop()
|
|
6
7
|
}
|
|
7
8
|
list.unshift(element)
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
function pushL(list, element, max) {
|
|
11
12
|
if (list.length >= max) {
|
|
12
13
|
list.shift()
|
|
13
14
|
}
|
|
@@ -15,11 +16,11 @@ const pushL = (list, element, max) => {
|
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
// X pm today or tomorrow
|
|
18
|
-
|
|
19
|
+
function millisecondsUntilHourOfDay(newDate, hour) {
|
|
19
20
|
const now = newDate()
|
|
20
21
|
const target = newDate(now)
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
function addHours(date, h) {
|
|
23
24
|
date.setTime(date.getTime() + (h*60*60*1000));
|
|
24
25
|
}
|
|
25
26
|
const hours = target.getHours()
|
|
@@ -34,11 +35,11 @@ const millisecondsUntilHourOfDay = (newDate, hour) => {
|
|
|
34
35
|
return diff;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
function indent(string, indent) {
|
|
38
39
|
return string.replace(/^/gm, ' '.repeat(indent));
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
function getCount(context) {
|
|
42
43
|
if (context.quantity) {
|
|
43
44
|
return context.quantity.value
|
|
44
45
|
}
|
|
@@ -47,13 +48,23 @@ const getCount = (context) => {
|
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
function words(word, additional = {}) {
|
|
51
52
|
return [{ word: pluralize.singular(word), number: 'one', ...additional }, { word: pluralize.plural(word), number: 'many', ...additional }]
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
if (
|
|
56
|
-
return
|
|
55
|
+
function isMany(context) {
|
|
56
|
+
if (!context) {
|
|
57
|
+
return
|
|
58
|
+
}
|
|
59
|
+
// if (((context || {}).value || {}).marker == 'list' && (((context || {}).value || {}).value || []).length > 1) {
|
|
60
|
+
const isList = context.marker == 'list' || context.value?.marker == 'list'
|
|
61
|
+
if (isList) {
|
|
62
|
+
if (context.value?.length > 1) {
|
|
63
|
+
return true
|
|
64
|
+
}
|
|
65
|
+
if (context.value?.value?.length > 1) {
|
|
66
|
+
return true
|
|
67
|
+
}
|
|
57
68
|
}
|
|
58
69
|
|
|
59
70
|
let number = context.number
|
|
@@ -77,13 +88,13 @@ const isMany = (context) => {
|
|
|
77
88
|
return false
|
|
78
89
|
}
|
|
79
90
|
|
|
80
|
-
|
|
91
|
+
function requiredArgument(value, name) {
|
|
81
92
|
if (!value) {
|
|
82
93
|
throw new Error(`${name} is a required argument`)
|
|
83
94
|
}
|
|
84
95
|
}
|
|
85
96
|
|
|
86
|
-
|
|
97
|
+
function chooseNumber(context, one, many) {
|
|
87
98
|
if (isMany(context)) {
|
|
88
99
|
return many;
|
|
89
100
|
} else {
|
|
@@ -91,7 +102,7 @@ const chooseNumber = (context, one, many) => {
|
|
|
91
102
|
}
|
|
92
103
|
}
|
|
93
104
|
|
|
94
|
-
|
|
105
|
+
function zip(...arrays) {
|
|
95
106
|
if (arrays == []) {
|
|
96
107
|
return []
|
|
97
108
|
}
|
|
@@ -107,15 +118,21 @@ const zip = (...arrays) => {
|
|
|
107
118
|
}
|
|
108
119
|
|
|
109
120
|
|
|
110
|
-
|
|
111
|
-
|
|
121
|
+
function focus(context) {
|
|
122
|
+
function helper(context) {
|
|
112
123
|
if (!context || !context.focusable) {
|
|
113
124
|
return null
|
|
114
125
|
}
|
|
115
126
|
for (const property of context.focusable) {
|
|
116
127
|
let focus = helper(context[property])
|
|
117
|
-
if (!focus
|
|
118
|
-
|
|
128
|
+
if (!focus) {
|
|
129
|
+
const flat = flatten(['list'], context[property])[0]
|
|
130
|
+
for (const element of flat) {
|
|
131
|
+
if (element.focus) {
|
|
132
|
+
focus = context[property]
|
|
133
|
+
break
|
|
134
|
+
}
|
|
135
|
+
}
|
|
119
136
|
}
|
|
120
137
|
return focus
|
|
121
138
|
}
|
|
@@ -126,7 +143,7 @@ const focus = (context) => {
|
|
|
126
143
|
|
|
127
144
|
// if property is a list make array of elements of the list, if not return an array with the property value
|
|
128
145
|
// fromList
|
|
129
|
-
|
|
146
|
+
function propertyToArray(value) {
|
|
130
147
|
if (Array.isArray(value)) {
|
|
131
148
|
return value
|
|
132
149
|
} else if (value.marker == 'list') {
|
|
@@ -136,7 +153,23 @@ const propertyToArray = (value) => {
|
|
|
136
153
|
}
|
|
137
154
|
}
|
|
138
155
|
|
|
139
|
-
|
|
156
|
+
// values is marker: 'list' or some context
|
|
157
|
+
function concats(values) {
|
|
158
|
+
combined = []
|
|
159
|
+
for (const value of values) {
|
|
160
|
+
if (value.marker == 'list') {
|
|
161
|
+
combined = combined.concat(value.value)
|
|
162
|
+
} else {
|
|
163
|
+
combined.push(value)
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
marker: 'list',
|
|
168
|
+
value: combined
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function wordNumber(word, toPlural) {
|
|
140
173
|
if (toPlural) {
|
|
141
174
|
return pluralize.plural(word)
|
|
142
175
|
} else {
|
|
@@ -144,14 +177,14 @@ wordNumber = (word, toPlural) => {
|
|
|
144
177
|
}
|
|
145
178
|
}
|
|
146
179
|
|
|
147
|
-
|
|
180
|
+
function toEValue(context) {
|
|
148
181
|
while( context.evalue ) {
|
|
149
182
|
context = context.evalue
|
|
150
183
|
}
|
|
151
184
|
return context;
|
|
152
185
|
}
|
|
153
186
|
|
|
154
|
-
|
|
187
|
+
function defaultObjectCheck(extra = []) {
|
|
155
188
|
return {
|
|
156
189
|
objects: [
|
|
157
190
|
{
|
|
@@ -162,11 +195,11 @@ const defaultObjectCheck = (extra = []) => {
|
|
|
162
195
|
}
|
|
163
196
|
}
|
|
164
197
|
|
|
165
|
-
|
|
198
|
+
function defaultContextCheckProperties(extra) {
|
|
166
199
|
return ['marker', 'text', 'verbatim', 'value', 'evalue', 'isResponse', { properties: 'modifiers' }, { properties: 'postModifiers' }, ...extra]
|
|
167
200
|
}
|
|
168
201
|
|
|
169
|
-
|
|
202
|
+
function defaultContextCheck({marker, extra = [], exported = false} = {}) {
|
|
170
203
|
let match
|
|
171
204
|
if (marker) {
|
|
172
205
|
match = ({context}) => context.marker == marker
|
|
@@ -180,35 +213,37 @@ const defaultContextCheck = ({marker, extra = [], exported = false} = {}) => {
|
|
|
180
213
|
}
|
|
181
214
|
}
|
|
182
215
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
if (strict) {
|
|
189
|
-
if (child.marker) {
|
|
190
|
-
child = child.marker
|
|
191
|
-
}
|
|
192
|
-
if (parent.marker) {
|
|
193
|
-
parent = parent.marker
|
|
194
|
-
}
|
|
195
|
-
return hierarchy.isA(child, parent)
|
|
196
|
-
} else {
|
|
197
|
-
if (hierarchy.isA(child.marker || child, parent.marker || parent)) {
|
|
198
|
-
return true
|
|
216
|
+
function isA(hierarchy) {
|
|
217
|
+
return (child, parent, { strict=false } = {}) => {
|
|
218
|
+
if (!child || !parent) {
|
|
219
|
+
return false
|
|
199
220
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
221
|
+
|
|
222
|
+
if (strict) {
|
|
223
|
+
if (child.marker) {
|
|
224
|
+
child = child.marker
|
|
225
|
+
}
|
|
226
|
+
if (parent.marker) {
|
|
227
|
+
parent = parent.marker
|
|
228
|
+
}
|
|
229
|
+
return hierarchy.isA(child, parent)
|
|
230
|
+
} else {
|
|
231
|
+
if (hierarchy.isA(child.marker || child, parent.marker || parent)) {
|
|
232
|
+
return true
|
|
233
|
+
}
|
|
234
|
+
for (const childT of child.types || [child]) {
|
|
235
|
+
for (const parentT of parent.types || [parent]) {
|
|
236
|
+
if (hierarchy.isA(childT, parentT)) {
|
|
237
|
+
return true
|
|
238
|
+
}
|
|
204
239
|
}
|
|
205
240
|
}
|
|
241
|
+
return false
|
|
206
242
|
}
|
|
207
|
-
return false
|
|
208
243
|
}
|
|
209
244
|
}
|
|
210
245
|
|
|
211
|
-
|
|
246
|
+
function getValue(propertyPath, object) {
|
|
212
247
|
if (!propertyPath) {
|
|
213
248
|
return
|
|
214
249
|
}
|
|
@@ -223,7 +258,7 @@ const getValue = (propertyPath, object) => {
|
|
|
223
258
|
return value
|
|
224
259
|
}
|
|
225
260
|
|
|
226
|
-
|
|
261
|
+
async function processTemplateString(template, evaluate) {
|
|
227
262
|
async function resolveWithCallback(strings, ...keys) {
|
|
228
263
|
// const resolvedValues = await Promise.all(keys.map(key => lookupVariable(key)));
|
|
229
264
|
const resolvedValues = await Promise.all(keys.map(async (key) => {
|
|
@@ -337,4 +372,5 @@ module.exports = {
|
|
|
337
372
|
requiredArgument,
|
|
338
373
|
isA,
|
|
339
374
|
removeProp,
|
|
375
|
+
concats
|
|
340
376
|
}
|
package/common/hierarchy.js
CHANGED
|
@@ -6,11 +6,11 @@ const pluralize = require('pluralize')
|
|
|
6
6
|
const _ = require('lodash')
|
|
7
7
|
const { isMany } = require('./helpers')
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
function getTypes( km, concept, instance ) {
|
|
10
10
|
const propertiesAPI = km('properties').api;
|
|
11
11
|
const conceptAPI = km('concept').api;
|
|
12
12
|
const digraph = propertiesAPI.digraph;
|
|
13
|
-
|
|
13
|
+
function intersect(set1, set2) {
|
|
14
14
|
return new Set([...set1].filter(x => set2.has(x)))
|
|
15
15
|
}
|
|
16
16
|
const descendants = digraph.descendants(concept.value)
|
|
@@ -256,6 +256,7 @@ const config = {
|
|
|
256
256
|
oneConceptId = await api.makeObject({...args, context: oneConcept})
|
|
257
257
|
twoConceptId = await api.makeObject({...args, context: twoConcept})
|
|
258
258
|
api.rememberIsA(oneConceptId, twoConceptId)
|
|
259
|
+
api.seenHierarchyWatcher({ childId: oneConceptId, child: oneConcept, parentId: twoConceptId, parent: twoConcept })
|
|
259
260
|
context.sameWasProcessed = true
|
|
260
261
|
}
|
|
261
262
|
}
|
|
@@ -286,7 +287,7 @@ const config = {
|
|
|
286
287
|
]
|
|
287
288
|
};
|
|
288
289
|
|
|
289
|
-
|
|
290
|
+
function initializer({apis, hierarchy}) {
|
|
290
291
|
apis('stm').addIsA( (child, parent) => {
|
|
291
292
|
return hierarchy.isA(child, parent)
|
|
292
293
|
})
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"person": "third"
|
|
71
71
|
}
|
|
72
72
|
],
|
|
73
|
-
"bridge": "{ ...next(operator), thrower: nominative?, receiver: dative?, object: object?, location: location?, interpolate: [{ property: 'thrower' }, { property: 'receiver' }, { property: 'location' }, { property: 'object' }, operator] }",
|
|
73
|
+
"bridge": "{ ...next(operator), thrower: nominative?, receiver: dative?, object: object?, location: location?, interpolate: [{ property: 'thrower' }, { property: 'receiver' }, { property: 'location' }, { property: 'object' }, { context: operator }] }",
|
|
74
74
|
"selector": {
|
|
75
75
|
"arguments": {
|
|
76
76
|
"nominative": "(context.declension == 'nominative' && context.number == operator.number)",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
{
|
|
84
84
|
"id": "dare",
|
|
85
85
|
"level": 0,
|
|
86
|
-
"bridge": "{ ...next(operator), giver: nominative?, receiver: dative?, object: accusative?, interpolate: [{ property: 'giver' }, { property: 'receiver' }, { property: 'object' }, operator] }",
|
|
86
|
+
"bridge": "{ ...next(operator), giver: nominative?, receiver: dative?, object: accusative?, interpolate: [{ property: 'giver' }, { property: 'receiver' }, { property: 'object' }, { context: operator }] }",
|
|
87
87
|
"selector": {
|
|
88
88
|
"arguments": {
|
|
89
89
|
"nominative": "(context.declension == 'nominative' && context.number == operator.number)",
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
},
|
|
160
160
|
{
|
|
161
161
|
"id": "queryMarker",
|
|
162
|
-
"bridge": "{ ...before[0], verb: before[0], interpolate: [before[0], '', operator], question: true }",
|
|
162
|
+
"bridge": "{ ...before[0], verb: before[0], interpolate: [{ context: before[0] }, '', { context: operator }], question: true }",
|
|
163
163
|
"separators": "|",
|
|
164
164
|
"before": [
|
|
165
165
|
"hierarchy"
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
"listable"
|
|
174
174
|
]
|
|
175
175
|
],
|
|
176
|
-
"bridge": "{ ...before[0], verb: before[0], interpolate: [before[0], '', operator], isList: true }",
|
|
176
|
+
"bridge": "{ ...before[0], verb: before[0], interpolate: [{ context: before[0] }, '', { context: operator }], isList: true }",
|
|
177
177
|
"separators": "|"
|
|
178
178
|
},
|
|
179
179
|
{
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
"hierarchiable"
|
|
188
188
|
]
|
|
189
189
|
],
|
|
190
|
-
"bridge": "{ ...next(operator), child: arguments[0], parent: arguments[1], question: less_than(indexes.operator, indexes.arguments[0]), interpolate: all }",
|
|
190
|
+
"bridge": "{ ...next(operator), child: arguments[0], parent: arguments[1], question: less_than(indexes.operator, indexes.arguments[0]), interpolate: map(all, { context: element }) }",
|
|
191
191
|
"words": [
|
|
192
192
|
{
|
|
193
193
|
"word": "sum",
|
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
"person": "third"
|
|
306
306
|
}
|
|
307
307
|
],
|
|
308
|
-
"bridge": "{ ...next(operator), thrower: nominative?, receiver: dative?, object: object?, location: location?, interpolate: [{ property: 'thrower' }, { property: 'receiver' }, { property: 'location' }, { property: 'object' }, operator] }",
|
|
308
|
+
"bridge": "{ ...next(operator), thrower: nominative?, receiver: dative?, object: object?, location: location?, interpolate: [{ property: 'thrower' }, { property: 'receiver' }, { property: 'location' }, { property: 'object' }, { context: operator }] }",
|
|
309
309
|
"selector": {
|
|
310
310
|
"arguments": {
|
|
311
311
|
"nominative": "(context.declension == 'nominative' && context.number == operator.number)",
|
|
@@ -318,7 +318,7 @@
|
|
|
318
318
|
{
|
|
319
319
|
"id": "dare",
|
|
320
320
|
"level": 0,
|
|
321
|
-
"bridge": "{ ...next(operator), giver: nominative?, receiver: dative?, object: accusative?, interpolate: [{ property: 'giver' }, { property: 'receiver' }, { property: 'object' }, operator] }",
|
|
321
|
+
"bridge": "{ ...next(operator), giver: nominative?, receiver: dative?, object: accusative?, interpolate: [{ property: 'giver' }, { property: 'receiver' }, { property: 'object' }, { context: operator }] }",
|
|
322
322
|
"selector": {
|
|
323
323
|
"arguments": {
|
|
324
324
|
"nominative": "(context.declension == 'nominative' && context.number == operator.number)",
|
|
@@ -394,7 +394,7 @@
|
|
|
394
394
|
},
|
|
395
395
|
{
|
|
396
396
|
"id": "queryMarker",
|
|
397
|
-
"bridge": "{ ...before[0], verb: before[0], interpolate: [before[0], '', operator], question: true }",
|
|
397
|
+
"bridge": "{ ...before[0], verb: before[0], interpolate: [{ context: before[0] }, '', { context: operator }], question: true }",
|
|
398
398
|
"separators": "|",
|
|
399
399
|
"before": [
|
|
400
400
|
"hierarchy"
|
|
@@ -408,7 +408,7 @@
|
|
|
408
408
|
"listable"
|
|
409
409
|
]
|
|
410
410
|
],
|
|
411
|
-
"bridge": "{ ...before[0], verb: before[0], interpolate: [before[0], '', operator], isList: true }",
|
|
411
|
+
"bridge": "{ ...before[0], verb: before[0], interpolate: [{ context: before[0] }, '', { context: operator }], isList: true }",
|
|
412
412
|
"separators": "|"
|
|
413
413
|
},
|
|
414
414
|
{
|
|
@@ -422,7 +422,7 @@
|
|
|
422
422
|
"hierarchiable"
|
|
423
423
|
]
|
|
424
424
|
],
|
|
425
|
-
"bridge": "{ ...next(operator), child: arguments[0], parent: arguments[1], question: less_than(indexes.operator, indexes.arguments[0]), interpolate: all }",
|
|
425
|
+
"bridge": "{ ...next(operator), child: arguments[0], parent: arguments[1], question: less_than(indexes.operator, indexes.arguments[0]), interpolate: map(all, { context: element }) }",
|
|
426
426
|
"words": [
|
|
427
427
|
{
|
|
428
428
|
"word": "sum",
|
package/common/latin.js
CHANGED
|
@@ -56,7 +56,7 @@ const config = {
|
|
|
56
56
|
words: [
|
|
57
57
|
...conjugateVerb('iacere'),
|
|
58
58
|
],
|
|
59
|
-
bridge: "{ ...next(operator), thrower: nominative?, receiver: dative?, object: object?, location: location?, interpolate: [{ property: 'thrower' }, { property: 'receiver' }, { property: 'location' }, { property: 'object' }, operator] }",
|
|
59
|
+
bridge: "{ ...next(operator), thrower: nominative?, receiver: dative?, object: object?, location: location?, interpolate: [{ property: 'thrower' }, { property: 'receiver' }, { property: 'location' }, { property: 'object' }, { context: operator }] }",
|
|
60
60
|
selector: {
|
|
61
61
|
arguments: {
|
|
62
62
|
nominative: "(context.declension == 'nominative' && context.number == operator.number)",
|
|
@@ -69,7 +69,7 @@ const config = {
|
|
|
69
69
|
{
|
|
70
70
|
id: "dare",
|
|
71
71
|
level: 0,
|
|
72
|
-
bridge: "{ ...next(operator), giver: nominative?, receiver: dative?, object: accusative?, interpolate: [{ property: 'giver' }, { property: 'receiver' }, { property: 'object' }, operator] }",
|
|
72
|
+
bridge: "{ ...next(operator), giver: nominative?, receiver: dative?, object: accusative?, interpolate: [{ property: 'giver' }, { property: 'receiver' }, { property: 'object' }, { context: operator }] }",
|
|
73
73
|
selector: {
|
|
74
74
|
arguments: {
|
|
75
75
|
nominative: "(context.declension == 'nominative' && context.number == operator.number)",
|
|
@@ -105,21 +105,21 @@ const config = {
|
|
|
105
105
|
|
|
106
106
|
{
|
|
107
107
|
id: "queryMarker",
|
|
108
|
-
bridge: "{ ...before[0], verb: before[0], interpolate: [before[0], '', operator], question: true }",
|
|
108
|
+
bridge: "{ ...before[0], verb: before[0], interpolate: [{ context: before[0] }, '', { context: operator }], question: true }",
|
|
109
109
|
separators: '|',
|
|
110
110
|
before: ['hierarchy'],
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
113
|
id: "listMarker",
|
|
114
114
|
localHierarchy: [['unknown', 'listable']],
|
|
115
|
-
bridge: "{ ...before[0], verb: before[0], interpolate: [before[0], '', operator], isList: true }",
|
|
115
|
+
bridge: "{ ...before[0], verb: before[0], interpolate: [{ context: before[0] }, '', { context: operator }], isList: true }",
|
|
116
116
|
separators: '|',
|
|
117
117
|
},
|
|
118
118
|
{ id: "hierarchiable" },
|
|
119
119
|
{
|
|
120
120
|
id: "hierarchy",
|
|
121
121
|
localHierarchy: [['unknown', 'hierarchiable']],
|
|
122
|
-
bridge: "{ ...next(operator), child: arguments[0], parent: arguments[1], question: less_than(indexes.operator, indexes.arguments[0]), interpolate: all }",
|
|
122
|
+
bridge: "{ ...next(operator), child: arguments[0], parent: arguments[1], question: less_than(indexes.operator, indexes.arguments[0]), interpolate: map(all, { context: element }) }",
|
|
123
123
|
words: [
|
|
124
124
|
{ word: 'sum', number: 'singular', person: 'first' },
|
|
125
125
|
{ word: 'es', number: 'singular', person: 'second' },
|
|
@@ -1123,7 +1123,7 @@
|
|
|
1123
1123
|
"word": "length",
|
|
1124
1124
|
"range": {
|
|
1125
1125
|
"start": 0,
|
|
1126
|
-
"end":
|
|
1126
|
+
"end": 5
|
|
1127
1127
|
},
|
|
1128
1128
|
"dead": true,
|
|
1129
1129
|
"types": [
|
|
@@ -2756,7 +2756,7 @@
|
|
|
2756
2756
|
"text": "meter centimeter foot and inch",
|
|
2757
2757
|
"range": {
|
|
2758
2758
|
"start": 0,
|
|
2759
|
-
"end":
|
|
2759
|
+
"end": 29
|
|
2760
2760
|
},
|
|
2761
2761
|
"types": [
|
|
2762
2762
|
"list",
|
|
@@ -5173,6 +5173,7 @@
|
|
|
5173
5173
|
"value": "meter",
|
|
5174
5174
|
"number": "many",
|
|
5175
5175
|
"text": "meters",
|
|
5176
|
+
"dimension": "length",
|
|
5176
5177
|
"marker": "meter",
|
|
5177
5178
|
"word": "meters",
|
|
5178
5179
|
"range": {
|
|
@@ -5203,6 +5204,7 @@
|
|
|
5203
5204
|
"value": "centimeter",
|
|
5204
5205
|
"number": "many",
|
|
5205
5206
|
"text": "centimeters",
|
|
5207
|
+
"dimension": "length",
|
|
5206
5208
|
"marker": "centimeter",
|
|
5207
5209
|
"word": "centimeters",
|
|
5208
5210
|
"range": {
|
|
@@ -6870,6 +6872,7 @@
|
|
|
6870
6872
|
"value": "centimeter",
|
|
6871
6873
|
"number": "many",
|
|
6872
6874
|
"text": "centimeters",
|
|
6875
|
+
"dimension": "length",
|
|
6873
6876
|
"marker": "centimeter",
|
|
6874
6877
|
"word": "centimeters",
|
|
6875
6878
|
"range": {
|
|
@@ -6900,6 +6903,7 @@
|
|
|
6900
6903
|
"value": "meter",
|
|
6901
6904
|
"number": "many",
|
|
6902
6905
|
"text": "meters",
|
|
6906
|
+
"dimension": "length",
|
|
6903
6907
|
"marker": "meter",
|
|
6904
6908
|
"word": "meters",
|
|
6905
6909
|
"range": {
|
|
@@ -8567,6 +8571,7 @@
|
|
|
8567
8571
|
"value": "centimeter",
|
|
8568
8572
|
"number": "many",
|
|
8569
8573
|
"text": "centimeters",
|
|
8574
|
+
"dimension": "length",
|
|
8570
8575
|
"marker": "centimeter",
|
|
8571
8576
|
"word": "centimeters",
|
|
8572
8577
|
"range": {
|
|
@@ -10296,6 +10301,7 @@
|
|
|
10296
10301
|
"value": "centimeter",
|
|
10297
10302
|
"number": "many",
|
|
10298
10303
|
"text": "centimeters",
|
|
10304
|
+
"dimension": "length",
|
|
10299
10305
|
"marker": "centimeter",
|
|
10300
10306
|
"word": "centimeters",
|
|
10301
10307
|
"range": {
|
|
@@ -11994,6 +12000,7 @@
|
|
|
11994
12000
|
"value": "meter",
|
|
11995
12001
|
"number": "many",
|
|
11996
12002
|
"text": "meters",
|
|
12003
|
+
"dimension": "length",
|
|
11997
12004
|
"marker": "meter",
|
|
11998
12005
|
"word": "meters",
|
|
11999
12006
|
"range": {
|
|
@@ -13661,6 +13668,7 @@
|
|
|
13661
13668
|
"value": "meter",
|
|
13662
13669
|
"number": "many",
|
|
13663
13670
|
"text": "meters",
|
|
13671
|
+
"dimension": "length",
|
|
13664
13672
|
"marker": "meter",
|
|
13665
13673
|
"word": "meters",
|
|
13666
13674
|
"range": {
|
|
@@ -15359,6 +15367,7 @@
|
|
|
15359
15367
|
"value": "foot",
|
|
15360
15368
|
"number": "many",
|
|
15361
15369
|
"text": "feet",
|
|
15370
|
+
"dimension": "length",
|
|
15362
15371
|
"marker": "foot",
|
|
15363
15372
|
"word": "feet",
|
|
15364
15373
|
"range": {
|
|
@@ -15389,6 +15398,7 @@
|
|
|
15389
15398
|
"value": "inch",
|
|
15390
15399
|
"number": "many",
|
|
15391
15400
|
"text": "inches",
|
|
15401
|
+
"dimension": "length",
|
|
15392
15402
|
"marker": "inch",
|
|
15393
15403
|
"word": "inches",
|
|
15394
15404
|
"range": {
|
|
@@ -17056,6 +17066,7 @@
|
|
|
17056
17066
|
"value": "inch",
|
|
17057
17067
|
"number": "many",
|
|
17058
17068
|
"text": "inches",
|
|
17069
|
+
"dimension": "length",
|
|
17059
17070
|
"marker": "inch",
|
|
17060
17071
|
"word": "inches",
|
|
17061
17072
|
"range": {
|
|
@@ -17086,6 +17097,7 @@
|
|
|
17086
17097
|
"value": "foot",
|
|
17087
17098
|
"number": "many",
|
|
17088
17099
|
"text": "feet",
|
|
17100
|
+
"dimension": "length",
|
|
17089
17101
|
"marker": "foot",
|
|
17090
17102
|
"word": "feet",
|
|
17091
17103
|
"range": {
|
|
@@ -18753,6 +18765,7 @@
|
|
|
18753
18765
|
"value": "meter",
|
|
18754
18766
|
"number": "many",
|
|
18755
18767
|
"text": "meters",
|
|
18768
|
+
"dimension": "length",
|
|
18756
18769
|
"marker": "meter",
|
|
18757
18770
|
"word": "meters",
|
|
18758
18771
|
"range": {
|
|
@@ -18783,6 +18796,7 @@
|
|
|
18783
18796
|
"value": "foot",
|
|
18784
18797
|
"number": "many",
|
|
18785
18798
|
"text": "feet",
|
|
18799
|
+
"dimension": "length",
|
|
18786
18800
|
"marker": "foot",
|
|
18787
18801
|
"word": "feet",
|
|
18788
18802
|
"range": {
|
|
@@ -20480,6 +20494,7 @@
|
|
|
20480
20494
|
"value": "foot",
|
|
20481
20495
|
"number": "many",
|
|
20482
20496
|
"text": "feet",
|
|
20497
|
+
"dimension": "length",
|
|
20483
20498
|
"marker": "foot",
|
|
20484
20499
|
"word": "feet",
|
|
20485
20500
|
"range": {
|
|
@@ -22075,6 +22090,7 @@
|
|
|
22075
22090
|
"value": "foot",
|
|
22076
22091
|
"number": "many",
|
|
22077
22092
|
"text": "feet",
|
|
22093
|
+
"dimension": "length",
|
|
22078
22094
|
"marker": "foot",
|
|
22079
22095
|
"word": "feet",
|
|
22080
22096
|
"range": {
|
|
@@ -23804,6 +23820,7 @@
|
|
|
23804
23820
|
"value": "meter",
|
|
23805
23821
|
"number": "many",
|
|
23806
23822
|
"text": "meters",
|
|
23823
|
+
"dimension": "length",
|
|
23807
23824
|
"marker": "meter",
|
|
23808
23825
|
"word": "meters",
|
|
23809
23826
|
"range": {
|
|
@@ -25471,6 +25488,7 @@
|
|
|
25471
25488
|
"value": "meter",
|
|
25472
25489
|
"number": "many",
|
|
25473
25490
|
"text": "meters",
|
|
25491
|
+
"dimension": "length",
|
|
25474
25492
|
"marker": "meter",
|
|
25475
25493
|
"word": "meters",
|
|
25476
25494
|
"range": {
|