tpmkms_4wp 9.4.5-beta.3 → 9.4.5-beta.5

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.
@@ -248,12 +248,44 @@ const initializer = ({config}) => {
248
248
  return args.gp(context[key])
249
249
  }
250
250
  }
251
+ const getValue = (keyOrValue) => {
252
+ if (typeof keyOrValue == 'string' && context[keyOrValue]) {
253
+ return context[keyOrValue]
254
+ }
255
+ return keyOrValue // it's a value
256
+ }
257
+
251
258
  if (Array.isArray(interpolate)) {
252
259
  const strings = []
260
+ let separator = ''
253
261
  for (const element of interpolate) {
254
- strings.push(await args.g(element))
262
+ if (typeof element == 'string') {
263
+ separator = element
264
+ } else if (element.separator && element.values) {
265
+ let ctr = 0
266
+ const values = getValue(element.values)
267
+ const vstrings = []
268
+ for (const value of values) {
269
+ if (ctr == values.length-1) {
270
+ vstrings.push(getValue(element.separator))
271
+ }
272
+ ctr += 1
273
+ vstrings.push(getValue(value))
274
+ }
275
+ strings.push(await args.gsp(vstrings))
276
+ } else {
277
+ let value = element
278
+ if (element.property) {
279
+ value = context[element.property]
280
+ }
281
+ if (value) {
282
+ strings.push(separator)
283
+ strings.push(await args.gp(value))
284
+ separator = ' '
285
+ }
286
+ }
255
287
  }
256
- return strings.join(" ")
288
+ return strings.join('')
257
289
  } else {
258
290
  return await helpers.processTemplateString(interpolate, evaluator)
259
291
  }
@@ -1,2 +1,473 @@
1
1
  {
2
- }
2
+ "configs": [
3
+ {
4
+ "apply": "({config}) => {\n config.addArgs(({config, api, isA}) => ({\n addLatinNoun: ({ id, nominative, genetive, development }) => {\n config.addOperator({ pattern: `([${id}|])`, development: development })\n config.addBridge({ id, isA: ['hierarchiable'] })\n const declensions = getDeclensions(nominative, genetive)\n for (const declension of declensions) {\n config.addWord(declension.word, { id, initial: { ...declension, development } })\n }\n }\n }))\n }"
5
+ },
6
+ {
7
+ "apply": "({addLatinNoun}) => {\n addLatinNoun({ id: 'davus_person', nominative: 'davus', development: true })\n addLatinNoun({ id: 'titus_person', nominative: 'titus', development: true })\n addLatinNoun({ id: 'pear_food', nominative: 'pirum', development: true })\n addLatinNoun({ id: 'table_latin', nominative: 'mensa', development: true })\n }"
8
+ },
9
+ {
10
+ "operators": [
11
+ "((hierarchy/*) [queryMarker|ne])",
12
+ "([hierarchiable])",
13
+ "((hierarchiable) [hierarchy|] (hierarchiable))",
14
+ "((hierarchiable) (hierarchiable) [hierarchy|])",
15
+ "([hierarchy|] (hierarchiable) (hierarchiable))",
16
+ "(x [list|et] y)",
17
+ "((listable/*) [listMarker|que])"
18
+ ],
19
+ "bridges": [
20
+ {
21
+ "id": "inLatin",
22
+ "words": [
23
+ "in"
24
+ ],
25
+ "before": [
26
+ "iacere"
27
+ ],
28
+ "bridge": "{ ...next(operator), declension: 'inLatin', object: object, operator: operator, interpolate: [{ property: 'operator' }, { property: 'object' }] }",
29
+ "selector": {
30
+ "ordinals": [
31
+ 1
32
+ ],
33
+ "arguments": {
34
+ "object": "(context.declension == 'accusative' || context.declension == 'ablative')"
35
+ }
36
+ }
37
+ },
38
+ {
39
+ "id": "iacere",
40
+ "level": 0,
41
+ "words": [
42
+ {
43
+ "word": "iacio",
44
+ "number": "singular",
45
+ "person": "first"
46
+ },
47
+ {
48
+ "word": "iacis",
49
+ "number": "singular",
50
+ "person": "second"
51
+ },
52
+ {
53
+ "word": "iacit",
54
+ "number": "singular",
55
+ "person": "third"
56
+ },
57
+ {
58
+ "word": "iacimus",
59
+ "number": "plural",
60
+ "person": "first"
61
+ },
62
+ {
63
+ "word": "iacitis",
64
+ "number": "plural",
65
+ "person": "second"
66
+ },
67
+ {
68
+ "word": "iaciunt",
69
+ "number": "plural",
70
+ "person": "third"
71
+ }
72
+ ],
73
+ "bridge": "{ ...next(operator), thrower: nominative?, receiver: dative?, object: object?, location: location?, interpolate: [{ property: 'thrower' }, { property: 'receiver' }, { property: 'location' }, { property: 'object' }, operator] }",
74
+ "selector": {
75
+ "arguments": {
76
+ "nominative": "(context.declension == 'nominative' && context.number == operator.number)",
77
+ "dative": "(context.declension == 'dative')",
78
+ "object": "(context.declension == 'accusative')",
79
+ "location": "(context.declension == 'inLatin')"
80
+ }
81
+ }
82
+ },
83
+ {
84
+ "id": "dare",
85
+ "level": 0,
86
+ "bridge": "{ ...next(operator), giver: nominative?, receiver: dative?, object: accusative?, interpolate: [{ property: 'giver' }, { property: 'receiver' }, { property: 'object' }, operator] }",
87
+ "selector": {
88
+ "arguments": {
89
+ "nominative": "(context.declension == 'nominative' && context.number == operator.number)",
90
+ "dative": "(context.declension == 'dative')",
91
+ "accusative": "(context.declension == 'accusative')"
92
+ }
93
+ },
94
+ "words": [
95
+ {
96
+ "word": "do",
97
+ "number": "singular",
98
+ "person": "first"
99
+ },
100
+ {
101
+ "word": "das",
102
+ "number": "singular",
103
+ "person": "second"
104
+ },
105
+ {
106
+ "word": "dat",
107
+ "number": "singular",
108
+ "person": "third"
109
+ },
110
+ {
111
+ "word": "damus",
112
+ "number": "plural",
113
+ "person": "first"
114
+ },
115
+ {
116
+ "word": "datis",
117
+ "number": "plural",
118
+ "person": "second"
119
+ },
120
+ {
121
+ "word": "dant",
122
+ "number": "plural",
123
+ "person": "third"
124
+ }
125
+ ]
126
+ },
127
+ {
128
+ "id": "list",
129
+ "level": 0,
130
+ "selector": {
131
+ "match": "same",
132
+ "left": [
133
+ {
134
+ "pattern": "($type && context.instance == variables.instance)"
135
+ }
136
+ ],
137
+ "right": [
138
+ {
139
+ "pattern": "($type && context.instance == variables.instance)"
140
+ }
141
+ ],
142
+ "passthrough": true
143
+ },
144
+ "bridge": "{ ...next(operator), listable: true, isList: true, value: append(before, after), operator: operator, interpolate: [ { separator: 'operator', values: 'value' } ] }"
145
+ },
146
+ {
147
+ "id": "list",
148
+ "level": 1,
149
+ "selector": {
150
+ "match": "same",
151
+ "left": [
152
+ {
153
+ "pattern": "($type && context.instance == variables.instance)"
154
+ }
155
+ ],
156
+ "passthrough": true
157
+ },
158
+ "bridge": "{ ...operator, value: append(before, operator.value) }"
159
+ },
160
+ {
161
+ "id": "queryMarker",
162
+ "bridge": "{ ...before[0], verb: before[0], interpolate: [before[0], '', operator], question: true }",
163
+ "separators": "|",
164
+ "before": [
165
+ "hierarchy"
166
+ ]
167
+ },
168
+ {
169
+ "id": "listMarker",
170
+ "localHierarchy": [
171
+ [
172
+ "unknown",
173
+ "listable"
174
+ ]
175
+ ],
176
+ "bridge": "{ ...before[0], verb: before[0], interpolate: [before[0], '', operator], isList: true }",
177
+ "separators": "|"
178
+ },
179
+ {
180
+ "id": "hierarchiable"
181
+ },
182
+ {
183
+ "id": "hierarchy",
184
+ "localHierarchy": [
185
+ [
186
+ "unknown",
187
+ "hierarchiable"
188
+ ]
189
+ ],
190
+ "bridge": "{ ...next(operator), child: arguments[0], parent: arguments[1], question: less_than(indexes.operator, indexes.arguments[0]), interpolate: all }",
191
+ "words": [
192
+ {
193
+ "word": "sum",
194
+ "number": "singular",
195
+ "person": "first"
196
+ },
197
+ {
198
+ "word": "es",
199
+ "number": "singular",
200
+ "person": "second"
201
+ },
202
+ {
203
+ "word": "est",
204
+ "number": "singular",
205
+ "person": "third"
206
+ },
207
+ {
208
+ "word": "sumus",
209
+ "number": "plural",
210
+ "person": "first"
211
+ },
212
+ {
213
+ "word": "estis",
214
+ "number": "plural",
215
+ "person": "second"
216
+ },
217
+ {
218
+ "word": "sunt",
219
+ "number": "plural",
220
+ "person": "third"
221
+ }
222
+ ]
223
+ }
224
+ ],
225
+ "semantics": [
226
+ {
227
+ "match": "({context}) => context.marker == 'unknown'",
228
+ "apply": "({context, config, addWord}) => {\n const id = context.word\n const word = context.word\n config.addWord(word, { id, value: id })\n config.addOperator(`([${id}|])`)\n config.addBridge({ id, isA: ['hierarchiable'] })\n }"
229
+ }
230
+ ]
231
+ },
232
+ {
233
+ "apply": "({addSuffix}) => addSuffix('que')"
234
+ }
235
+ ],
236
+ "resultss": [
237
+ {
238
+ "apply": "({config}) => {\n config.addArgs(({config, api, isA}) => ({\n addLatinNoun: ({ id, nominative, genetive, development }) => {\n config.addOperator({ pattern: `([${id}|])`, development: development })\n config.addBridge({ id, isA: ['hierarchiable'] })\n const declensions = getDeclensions(nominative, genetive)\n for (const declension of declensions) {\n config.addWord(declension.word, { id, initial: { ...declension, development } })\n }\n }\n }))\n }"
239
+ },
240
+ {
241
+ "apply": "({addLatinNoun}) => {\n addLatinNoun({ id: 'davus_person', nominative: 'davus', development: true })\n addLatinNoun({ id: 'titus_person', nominative: 'titus', development: true })\n addLatinNoun({ id: 'pear_food', nominative: 'pirum', development: true })\n addLatinNoun({ id: 'table_latin', nominative: 'mensa', development: true })\n }"
242
+ },
243
+ {
244
+ "extraConfig": true,
245
+ "operators": [
246
+ "((hierarchy/*) [queryMarker|ne])",
247
+ "([hierarchiable])",
248
+ "((hierarchiable) [hierarchy|] (hierarchiable))",
249
+ "((hierarchiable) (hierarchiable) [hierarchy|])",
250
+ "([hierarchy|] (hierarchiable) (hierarchiable))",
251
+ "(x [list|et] y)",
252
+ "((listable/*) [listMarker|que])"
253
+ ],
254
+ "bridges": [
255
+ {
256
+ "id": "inLatin",
257
+ "words": [
258
+ "in"
259
+ ],
260
+ "before": [
261
+ "iacere"
262
+ ],
263
+ "bridge": "{ ...next(operator), declension: 'inLatin', object: object, operator: operator, interpolate: [{ property: 'operator' }, { property: 'object' }] }",
264
+ "selector": {
265
+ "ordinals": [
266
+ 1
267
+ ],
268
+ "arguments": {
269
+ "object": "(context.declension == 'accusative' || context.declension == 'ablative')"
270
+ }
271
+ }
272
+ },
273
+ {
274
+ "id": "iacere",
275
+ "level": 0,
276
+ "words": [
277
+ {
278
+ "word": "iacio",
279
+ "number": "singular",
280
+ "person": "first"
281
+ },
282
+ {
283
+ "word": "iacis",
284
+ "number": "singular",
285
+ "person": "second"
286
+ },
287
+ {
288
+ "word": "iacit",
289
+ "number": "singular",
290
+ "person": "third"
291
+ },
292
+ {
293
+ "word": "iacimus",
294
+ "number": "plural",
295
+ "person": "first"
296
+ },
297
+ {
298
+ "word": "iacitis",
299
+ "number": "plural",
300
+ "person": "second"
301
+ },
302
+ {
303
+ "word": "iaciunt",
304
+ "number": "plural",
305
+ "person": "third"
306
+ }
307
+ ],
308
+ "bridge": "{ ...next(operator), thrower: nominative?, receiver: dative?, object: object?, location: location?, interpolate: [{ property: 'thrower' }, { property: 'receiver' }, { property: 'location' }, { property: 'object' }, operator] }",
309
+ "selector": {
310
+ "arguments": {
311
+ "nominative": "(context.declension == 'nominative' && context.number == operator.number)",
312
+ "dative": "(context.declension == 'dative')",
313
+ "object": "(context.declension == 'accusative')",
314
+ "location": "(context.declension == 'inLatin')"
315
+ }
316
+ }
317
+ },
318
+ {
319
+ "id": "dare",
320
+ "level": 0,
321
+ "bridge": "{ ...next(operator), giver: nominative?, receiver: dative?, object: accusative?, interpolate: [{ property: 'giver' }, { property: 'receiver' }, { property: 'object' }, operator] }",
322
+ "selector": {
323
+ "arguments": {
324
+ "nominative": "(context.declension == 'nominative' && context.number == operator.number)",
325
+ "dative": "(context.declension == 'dative')",
326
+ "accusative": "(context.declension == 'accusative')"
327
+ }
328
+ },
329
+ "words": [
330
+ {
331
+ "word": "do",
332
+ "number": "singular",
333
+ "person": "first"
334
+ },
335
+ {
336
+ "word": "das",
337
+ "number": "singular",
338
+ "person": "second"
339
+ },
340
+ {
341
+ "word": "dat",
342
+ "number": "singular",
343
+ "person": "third"
344
+ },
345
+ {
346
+ "word": "damus",
347
+ "number": "plural",
348
+ "person": "first"
349
+ },
350
+ {
351
+ "word": "datis",
352
+ "number": "plural",
353
+ "person": "second"
354
+ },
355
+ {
356
+ "word": "dant",
357
+ "number": "plural",
358
+ "person": "third"
359
+ }
360
+ ]
361
+ },
362
+ {
363
+ "id": "list",
364
+ "level": 0,
365
+ "selector": {
366
+ "match": "same",
367
+ "left": [
368
+ {
369
+ "pattern": "($type && context.instance == variables.instance)"
370
+ }
371
+ ],
372
+ "right": [
373
+ {
374
+ "pattern": "($type && context.instance == variables.instance)"
375
+ }
376
+ ],
377
+ "passthrough": true
378
+ },
379
+ "bridge": "{ ...next(operator), listable: true, isList: true, value: append(before, after), operator: operator, interpolate: [ { separator: 'operator', values: 'value' } ] }"
380
+ },
381
+ {
382
+ "id": "list",
383
+ "level": 1,
384
+ "selector": {
385
+ "match": "same",
386
+ "left": [
387
+ {
388
+ "pattern": "($type && context.instance == variables.instance)"
389
+ }
390
+ ],
391
+ "passthrough": true
392
+ },
393
+ "bridge": "{ ...operator, value: append(before, operator.value) }"
394
+ },
395
+ {
396
+ "id": "queryMarker",
397
+ "bridge": "{ ...before[0], verb: before[0], interpolate: [before[0], '', operator], question: true }",
398
+ "separators": "|",
399
+ "before": [
400
+ "hierarchy"
401
+ ]
402
+ },
403
+ {
404
+ "id": "listMarker",
405
+ "localHierarchy": [
406
+ [
407
+ "unknown",
408
+ "listable"
409
+ ]
410
+ ],
411
+ "bridge": "{ ...before[0], verb: before[0], interpolate: [before[0], '', operator], isList: true }",
412
+ "separators": "|"
413
+ },
414
+ {
415
+ "id": "hierarchiable"
416
+ },
417
+ {
418
+ "id": "hierarchy",
419
+ "localHierarchy": [
420
+ [
421
+ "unknown",
422
+ "hierarchiable"
423
+ ]
424
+ ],
425
+ "bridge": "{ ...next(operator), child: arguments[0], parent: arguments[1], question: less_than(indexes.operator, indexes.arguments[0]), interpolate: all }",
426
+ "words": [
427
+ {
428
+ "word": "sum",
429
+ "number": "singular",
430
+ "person": "first"
431
+ },
432
+ {
433
+ "word": "es",
434
+ "number": "singular",
435
+ "person": "second"
436
+ },
437
+ {
438
+ "word": "est",
439
+ "number": "singular",
440
+ "person": "third"
441
+ },
442
+ {
443
+ "word": "sumus",
444
+ "number": "plural",
445
+ "person": "first"
446
+ },
447
+ {
448
+ "word": "estis",
449
+ "number": "plural",
450
+ "person": "second"
451
+ },
452
+ {
453
+ "word": "sunt",
454
+ "number": "plural",
455
+ "person": "third"
456
+ }
457
+ ]
458
+ }
459
+ ],
460
+ "semantics": [
461
+ {}
462
+ ]
463
+ },
464
+ {
465
+ "apply": "({addSuffix}) => addSuffix('que')"
466
+ }
467
+ ],
468
+ "fragments": [],
469
+ "semantics": [],
470
+ "associations": [],
471
+ "summaries": [],
472
+ "learned_contextual_priorities": []
473
+ }