tpmkms_4wp 8.9.1-beta.14 → 8.9.1-beta.16

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.
@@ -4574,6 +4574,40 @@
4574
4574
  0
4575
4575
  ]
4576
4576
  ],
4577
+ [
4578
+ [
4579
+ "is",
4580
+ 0
4581
+ ],
4582
+ [
4583
+ "list",
4584
+ 0
4585
+ ],
4586
+ [
4587
+ "ounce",
4588
+ 0
4589
+ ],
4590
+ [
4591
+ "propertyOf",
4592
+ 0
4593
+ ],
4594
+ [
4595
+ "unit",
4596
+ 0
4597
+ ],
4598
+ [
4599
+ "unknown",
4600
+ 0
4601
+ ],
4602
+ [
4603
+ "unknown",
4604
+ 1
4605
+ ],
4606
+ [
4607
+ "weight",
4608
+ 0
4609
+ ]
4610
+ ],
4577
4611
  [
4578
4612
  [
4579
4613
  "is",
@@ -20159,6 +20193,40 @@
20159
20193
  0
20160
20194
  ]
20161
20195
  ],
20196
+ [
20197
+ [
20198
+ "is",
20199
+ 0
20200
+ ],
20201
+ [
20202
+ "list",
20203
+ 0
20204
+ ],
20205
+ [
20206
+ "ounce",
20207
+ 0
20208
+ ],
20209
+ [
20210
+ "propertyOf",
20211
+ 0
20212
+ ],
20213
+ [
20214
+ "unit",
20215
+ 0
20216
+ ],
20217
+ [
20218
+ "unknown",
20219
+ 0
20220
+ ],
20221
+ [
20222
+ "unknown",
20223
+ 1
20224
+ ],
20225
+ [
20226
+ "weight",
20227
+ 0
20228
+ ]
20229
+ ],
20162
20230
  [
20163
20231
  [
20164
20232
  "is",
@@ -21,7 +21,7 @@
21
21
  "((word_wp/*) [wordComparisonWithVerb_wp] ([comparisonWith_wp|with] (a/0)? (letters)))",
22
22
  "((word_wp/*) [wordComparison_wp] (a/0)? (letters))",
23
23
  "((styleModifier_wp/*) [modifiedByStyle_wp] (statefulElement_wp/* && context.determiner == undefined))",
24
- "((statefulElement_wp/*) <statefulElementInContext_wp|of> (statefulElement_wp/*))",
24
+ "((statefulElement_wp/*)? <statefulElementInContext_wp|of,in> (statefulElement_wp/*))",
25
25
  "((paragraph_wp/*) [paragraphComparisonVerb_wp] (word_wp/*))"
26
26
  ],
27
27
  "associations": {
@@ -114,6 +114,9 @@
114
114
  "parents": [
115
115
  "preposition"
116
116
  ],
117
+ "optional": {
118
+ "-1": "{ ...operator, invisible: true }"
119
+ },
117
120
  "bridge": "{ ...before[0], context: append(before[0].context, [after[0]]), generate: [before[0], operator, after[0]] }"
118
121
  },
119
122
  {
@@ -243,6 +246,30 @@
243
246
  }
244
247
  ],
245
248
  "priorities": [
249
+ {
250
+ "context": [
251
+ [
252
+ "word_wp",
253
+ 1
254
+ ],
255
+ [
256
+ "wordComparisonWithVerb_wp",
257
+ 0
258
+ ],
259
+ [
260
+ "comparisonWith_wp",
261
+ 1
262
+ ],
263
+ [
264
+ "statefulElementInContext_wp",
265
+ 0
266
+ ]
267
+ ],
268
+ "ordered": true,
269
+ "choose": [
270
+ 1
271
+ ]
272
+ },
246
273
  {
247
274
  "context": [
248
275
  [
@@ -263,6 +290,66 @@
263
290
  2
264
291
  ]
265
292
  },
293
+ {
294
+ "context": [
295
+ [
296
+ "statefulElementInContext_wp",
297
+ 0
298
+ ],
299
+ [
300
+ "word_wp",
301
+ 0
302
+ ],
303
+ [
304
+ "wordComparisonWithVerb_wp",
305
+ 0
306
+ ]
307
+ ],
308
+ "ordered": true,
309
+ "choose": [
310
+ 2
311
+ ]
312
+ },
313
+ {
314
+ "context": [
315
+ [
316
+ "statefulElementInContext_wp",
317
+ 0
318
+ ],
319
+ [
320
+ "word_wp",
321
+ 1
322
+ ],
323
+ [
324
+ "wordComparisonWithVerb_wp",
325
+ 0
326
+ ],
327
+ [
328
+ "comparisonWith_wp",
329
+ 1
330
+ ]
331
+ ],
332
+ "ordered": true,
333
+ "choose": [
334
+ 2,
335
+ 3
336
+ ]
337
+ },
338
+ {
339
+ "context": [
340
+ [
341
+ "statefulElementInContext_wp",
342
+ 0
343
+ ],
344
+ [
345
+ "comparisonWith_wp",
346
+ 0
347
+ ]
348
+ ],
349
+ "choose": [
350
+ 1
351
+ ]
352
+ },
266
353
  {
267
354
  "context": [
268
355
  [
@@ -19545,6 +19632,28 @@
19545
19632
  1
19546
19633
  ]
19547
19634
  ],
19635
+ [
19636
+ [
19637
+ "comma",
19638
+ 0
19639
+ ],
19640
+ [
19641
+ "is",
19642
+ 0
19643
+ ],
19644
+ [
19645
+ "list",
19646
+ 0
19647
+ ],
19648
+ [
19649
+ "unknown",
19650
+ 0
19651
+ ],
19652
+ [
19653
+ "unknown",
19654
+ 1
19655
+ ]
19656
+ ],
19548
19657
  [
19549
19658
  [
19550
19659
  "comma",
@@ -41167,7 +41276,7 @@
41167
41276
  "((word_wp/*) [wordComparisonWithVerb_wp] ([comparisonWith_wp|with] (a/0)? (letters)))",
41168
41277
  "((word_wp/*) [wordComparison_wp] (a/0)? (letters))",
41169
41278
  "((styleModifier_wp/*) [modifiedByStyle_wp] (statefulElement_wp/* && context.determiner == undefined))",
41170
- "((statefulElement_wp/*) <statefulElementInContext_wp|of> (statefulElement_wp/*))",
41279
+ "((statefulElement_wp/*)? <statefulElementInContext_wp|of,in> (statefulElement_wp/*))",
41171
41280
  "((paragraph_wp/*) [paragraphComparisonVerb_wp] (word_wp/*))"
41172
41281
  ],
41173
41282
  "associations": {
@@ -41260,6 +41369,9 @@
41260
41369
  "parents": [
41261
41370
  "preposition"
41262
41371
  ],
41372
+ "optional": {
41373
+ "-1": "{ ...operator, invisible: true }"
41374
+ },
41263
41375
  "bridge": "{ ...before[0], context: append(before[0].context, [after[0]]), generate: [before[0], operator, after[0]] }"
41264
41376
  },
41265
41377
  {
@@ -41378,13 +41490,37 @@
41378
41490
  ],
41379
41491
  "semantics": [
41380
41492
  {
41381
- "where": "/home/dev/code/theprogrammablemind/kms/common/wp.js:322"
41493
+ "where": "/home/dev/code/theprogrammablemind/kms/common/wp.js:332"
41382
41494
  },
41383
41495
  {
41384
- "where": "/home/dev/code/theprogrammablemind/kms/common/wp.js:331"
41496
+ "where": "/home/dev/code/theprogrammablemind/kms/common/wp.js:341"
41385
41497
  }
41386
41498
  ],
41387
41499
  "priorities": [
41500
+ {
41501
+ "context": [
41502
+ [
41503
+ "word_wp",
41504
+ 1
41505
+ ],
41506
+ [
41507
+ "wordComparisonWithVerb_wp",
41508
+ 0
41509
+ ],
41510
+ [
41511
+ "comparisonWith_wp",
41512
+ 1
41513
+ ],
41514
+ [
41515
+ "statefulElementInContext_wp",
41516
+ 0
41517
+ ]
41518
+ ],
41519
+ "ordered": true,
41520
+ "choose": [
41521
+ 1
41522
+ ]
41523
+ },
41388
41524
  {
41389
41525
  "context": [
41390
41526
  [
@@ -41405,6 +41541,66 @@
41405
41541
  2
41406
41542
  ]
41407
41543
  },
41544
+ {
41545
+ "context": [
41546
+ [
41547
+ "statefulElementInContext_wp",
41548
+ 0
41549
+ ],
41550
+ [
41551
+ "word_wp",
41552
+ 0
41553
+ ],
41554
+ [
41555
+ "wordComparisonWithVerb_wp",
41556
+ 0
41557
+ ]
41558
+ ],
41559
+ "ordered": true,
41560
+ "choose": [
41561
+ 2
41562
+ ]
41563
+ },
41564
+ {
41565
+ "context": [
41566
+ [
41567
+ "statefulElementInContext_wp",
41568
+ 0
41569
+ ],
41570
+ [
41571
+ "word_wp",
41572
+ 1
41573
+ ],
41574
+ [
41575
+ "wordComparisonWithVerb_wp",
41576
+ 0
41577
+ ],
41578
+ [
41579
+ "comparisonWith_wp",
41580
+ 1
41581
+ ]
41582
+ ],
41583
+ "ordered": true,
41584
+ "choose": [
41585
+ 2,
41586
+ 3
41587
+ ]
41588
+ },
41589
+ {
41590
+ "context": [
41591
+ [
41592
+ "statefulElementInContext_wp",
41593
+ 0
41594
+ ],
41595
+ [
41596
+ "comparisonWith_wp",
41597
+ 0
41598
+ ]
41599
+ ],
41600
+ "choose": [
41601
+ 1
41602
+ ]
41603
+ },
41408
41604
  {
41409
41605
  "context": [
41410
41606
  [
@@ -41808,6 +42004,28 @@
41808
42004
  1
41809
42005
  ]
41810
42006
  ],
42007
+ [
42008
+ [
42009
+ "comma",
42010
+ 0
42011
+ ],
42012
+ [
42013
+ "is",
42014
+ 0
42015
+ ],
42016
+ [
42017
+ "list",
42018
+ 0
42019
+ ],
42020
+ [
42021
+ "unknown",
42022
+ 0
42023
+ ],
42024
+ [
42025
+ "unknown",
42026
+ 1
42027
+ ]
42028
+ ],
41811
42029
  [
41812
42030
  [
41813
42031
  "comma",
package/common/wp.js CHANGED
@@ -23,14 +23,17 @@ const instance = require('./wp.instance.json')
23
23
  bold the third letter of the second paragraph
24
24
  bold the first letter of every word that starts with t
25
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
26
28
 
27
29
  current
28
30
 
29
- bold the words that start with t in the second paragraph
31
+ in the second paragraph bold the first word
30
32
 
31
33
  todo
32
34
 
33
- bold the first letter of the words that start with t in the third paragraph
35
+ in the second paragraph bold the first letter of the words that start with t
36
+ in the second paragraph for the words that start with t bold the first letter
34
37
  underline the bolded paragraphs
35
38
  bold the paragraph that contains three bolded words
36
39
  capitalize the first letter of the words that start with t
@@ -221,7 +224,7 @@ template = {
221
224
  // this one is "the bolded/underlined/italized/... word"
222
225
  "((styleModifier_wp/*) [modifiedByStyle_wp] (statefulElement_wp/* && context.determiner == undefined))",
223
226
  // the first letter of each paragraph
224
- "((statefulElement_wp/*) <statefulElementInContext_wp|of,in> (statefulElement_wp/*))",
227
+ "((statefulElement_wp/*)? <statefulElementInContext_wp|of,in> (statefulElement_wp/*))",
225
228
  // the paragraph that contains words that start with t
226
229
  "((paragraph_wp/*) [paragraphComparisonVerb_wp] (word_wp/*))",
227
230
  ],
@@ -251,7 +254,38 @@ template = {
251
254
  {
252
255
  id: 'statefulElementInContext_wp',
253
256
  parents: ['preposition'],
254
- bridge: "{ ...before[0], context: append(before[0].context, [after[0]]), generate: [before[0], operator, after[0]] }",
257
+ optional: {
258
+ '-1': "{ ...operator, invisible: true }",
259
+ },
260
+ bridge: "{ ...next(before[0]), context: append(before[0].context, [after[0]]), generate: [before[0], operator, after[0]] }",
261
+ semantic: (args) => {
262
+ const { context, contexts } = args
263
+ for (let i = context.index + 1; i < contexts.length; ++i) {
264
+ if (contexts[i].marker == 'applyStyle_wp') {
265
+ debugger
266
+ debugger
267
+ const element = contexts[i].element
268
+ if (!element.context) {
269
+ element.context = []
270
+ }
271
+ element.context = element.context.concat(context.context)
272
+ }
273
+ }
274
+ console.log(JSON.stringify(Object.keys(args)))
275
+ },
276
+ },
277
+ {
278
+ id: 'applyStyle_wp',
279
+ parents: ['verb'],
280
+ convolution: true,
281
+ bridge: "{ ...next(operator), element: after[0], state: before[0], operator: operator, generate: ['state', 'element'] }",
282
+ localHierarchy: [
283
+ ['thisitthat', 'statefulElement_wp'],
284
+ ['everything', 'statefulElement_wp'],
285
+ ],
286
+ semantic: (args) => {
287
+ changeState({...args, element: args.context.element, state: args.context.state})
288
+ }
255
289
  },
256
290
  {
257
291
  id: 'modifiedByStyle_wp',
@@ -293,19 +327,6 @@ template = {
293
327
  },
294
328
  bridge: "{ ...next(operator), operator: operator, letters: after[1], generate: ['operator', 'letters'] }",
295
329
  },
296
- {
297
- id: 'applyStyle_wp',
298
- parents: ['verb'],
299
- convolution: true,
300
- bridge: "{ ...next(operator), element: after[0], state: before[0], operator: operator, generate: ['state', 'element'] }",
301
- localHierarchy: [
302
- ['thisitthat', 'statefulElement_wp'],
303
- ['everything', 'statefulElement_wp'],
304
- ],
305
- semantic: (args) => {
306
- changeState({...args, element: args.context.element, state: args.context.state})
307
- }
308
- },
309
330
  {
310
331
  id: 'changeState_wp',
311
332
  parents: ['verb'],
@@ -350,6 +371,7 @@ template = {
350
371
  { "context": [['word_wp', 1], ['wordComparisonWithVerb_wp', 0], ['comparisonWith_wp', 1], ['statefulElementInContext_wp', 0]], ordered: true, choose: [1] },
351
372
  { "context": [['paragraphComparisonVerb_wp', 0], ['word_wp', 0], ['wordComparisonWithVerb_wp', 0]], ordered: true, choose: [2] },
352
373
  { "context": [['statefulElementInContext_wp', 0], ['word_wp', 0], ['wordComparisonWithVerb_wp', 0]], ordered: true, choose: [2] },
374
+ { "context": [['statefulElementInContext_wp', 0], ['word_wp', 1], ['wordComparisonWithVerb_wp', 0], ['comparisonWith_wp', 1]], ordered: true, choose: [2,3] },
353
375
  { "context": [['statefulElementInContext_wp', 0], ['comparisonWith_wp', 0]], choose: [1] },
354
376
  { "context": [['paragraphComparisonVerb_wp', 0], ['wordComparisonWithVerb_wp', 0]], choose: [1] },
355
377
  { "context": [['ordinal',1], ['list', 0], ['ordinal', 1], ['word_wp', 1]], ordered: true, choose: [1] },