ekms 8.9.0-beta.9 → 8.9.1-beta.0

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.
Files changed (37) hide show
  1. package/common/animals.instance.json +65 -0
  2. package/common/articles.js +4 -0
  3. package/common/colors.instance.json +71 -0
  4. package/common/comparable.instance.json +15 -0
  5. package/common/conjunction.js +27 -18
  6. package/common/crew.instance.json +130 -176
  7. package/common/dialogues.js +14 -11
  8. package/common/dimension.instance.json +10 -0
  9. package/common/edible.instance.json +320 -0
  10. package/common/emotions.instance.json +8 -0
  11. package/common/fastfood.instance.json +1200 -308
  12. package/common/formulas.instance.json +10 -0
  13. package/common/helpers/conjunction.js +75 -0
  14. package/common/helpers/dialogues.js +14 -8
  15. package/common/helpers/properties.js +2 -2
  16. package/common/helpers.js +29 -0
  17. package/common/kirk.instance.json +5 -0
  18. package/common/length.instance.json +150 -0
  19. package/common/math.instance.json +10 -0
  20. package/common/meta.js +5 -3
  21. package/common/ordering.instance.json +78 -0
  22. package/common/people.instance.json +169 -4
  23. package/common/pipboy.instance.json +170 -0
  24. package/common/pokemon.instance.json +65 -0
  25. package/common/pos.js +9 -6
  26. package/common/pressure.instance.json +40 -0
  27. package/common/properties.instance.json +5 -0
  28. package/common/reports.instance.json +21 -1
  29. package/common/spock.instance.json +5 -0
  30. package/common/temperature.instance.json +40 -0
  31. package/common/ui.instance.json +10 -0
  32. package/common/ui.js +0 -1
  33. package/common/weight.instance.json +120 -0
  34. package/common/wp.instance.json +23224 -536
  35. package/common/wp.js +175 -30
  36. package/common/wp.test.json +35630 -1554
  37. package/package.json +3 -2
@@ -268,6 +268,11 @@
268
268
  "verb",
269
269
  false
270
270
  ],
271
+ [
272
+ "every",
273
+ "quantifier",
274
+ false
275
+ ],
271
276
  [
272
277
  "hasCountOfPieces",
273
278
  "countable",
@@ -468,6 +473,11 @@
468
473
  "verb",
469
474
  false
470
475
  ],
476
+ [
477
+ "negatable",
478
+ "queryable",
479
+ false
480
+ ],
471
481
  [
472
482
  "noun",
473
483
  "theAble",
@@ -0,0 +1,75 @@
1
+ const { propertyToArray } = require('../helpers.js')
2
+
3
+ const asList = (context) => {
4
+ if (context.marker === 'list') {
5
+ return context
6
+ }
7
+ return {
8
+ marker: 'list',
9
+ types: [context.marker],
10
+ value: [context]
11
+ }
12
+ }
13
+
14
+ const listable = (hierarchy) => (c, type) => {
15
+ if (!c) {
16
+ return false
17
+ }
18
+ if (hierarchy.isA(c.marker, type)) {
19
+ return true
20
+ }
21
+ if (c.marker === 'list') {
22
+ for (const t of c.types) {
23
+ if (hierarchy.isA(t, type)) {
24
+ return true
25
+ }
26
+ }
27
+ }
28
+ return false
29
+ }
30
+
31
+ const isA = (hierarchy) => (child, parent, { strict=false } = {}) => {
32
+ if (!child || !parent) {
33
+ return false
34
+ }
35
+
36
+ if (strict) {
37
+ if (child.marker) {
38
+ child = child.marker
39
+ }
40
+ if (parent.marker) {
41
+ parent = parent.marker
42
+ }
43
+ return hierarchy.isA(child, parent)
44
+ } else {
45
+ const children = propertyToArray(child)
46
+ for (let child of children) {
47
+ let okay = false
48
+ if (hierarchy.isA(child.marker || child, parent.marker || parent)) {
49
+ okay = true
50
+ } else {
51
+ for (const childT of child.types || [child]) {
52
+ if (okay) {
53
+ break
54
+ }
55
+ for (const parentT of parent.types || [parent]) {
56
+ if (hierarchy.isA(childT, parentT)) {
57
+ okay = true
58
+ break
59
+ }
60
+ }
61
+ }
62
+ }
63
+ if (!okay) {
64
+ return false
65
+ }
66
+ }
67
+ return true
68
+ }
69
+ }
70
+
71
+ module.exports = {
72
+ asList,
73
+ isA,
74
+ listable,
75
+ }
@@ -15,9 +15,15 @@ class API {
15
15
  if (typeof context == 'string') {
16
16
  return pluralize.singular(context) + this._objects.idSuffix
17
17
  } else {
18
- const { unknown, value, word } = context;
18
+ const { unknown, value, word, raw_text } = context;
19
19
  // return unknown ? pluralize.singular(word) + this._objects.idSuffix : pluralize.singular(value || word)
20
- return unknown ? pluralize.singular(word) + this._objects.idSuffix : value || pluralize.singular(word)
20
+ return unknown ? pluralize.singular(raw_text || word) + this._objects.idSuffix : value || pluralize.singular(word)
21
+ /*
22
+ if (raw_text && raw_text !== word) {
23
+ debugger
24
+ }
25
+ */
26
+ //return unknown ? pluralize.singular(word) + this._objects.idSuffix : value || pluralize.singular(word)
21
27
  }
22
28
  }
23
29
 
@@ -71,7 +77,7 @@ class API {
71
77
  }
72
78
 
73
79
  // word is for one or many
74
- makeObject({config, context, types=[], doPluralize=true} = {}) {
80
+ makeObject({config, context, types=[], source_value=undefined, doPluralize=true} = {}) {
75
81
  /*
76
82
  if (!context.unknown) {
77
83
  return context.value
@@ -83,9 +89,9 @@ class API {
83
89
  }
84
90
  // const concept = pluralize.singular(value)
85
91
  const concept = this.toScopedId(context)
86
- if (config.exists(concept)) {
87
- return concept
88
- }
92
+ if (config.exists(concept)) {
93
+ return concept
94
+ }
89
95
 
90
96
  // TODO handle the general case
91
97
  const fixUps = (concept) => {
@@ -96,9 +102,9 @@ class API {
96
102
  }
97
103
  // config.addOperator({ pattern: `(["${fixUps(concept)}"])`, allowDups: true })
98
104
  config.addOperator({ pattern: `(["${concept}"])`, allowDups: true })
99
- config.addBridge({ id: concept, level: 0, bridge: `{ ...next(operator), value: '${concept}' }` , allowDups: true })
105
+ config.addBridge({ id: concept, level: 0, bridge: `{ ...next(operator), value: '${source_value || concept}' }` , allowDups: true })
100
106
  const addConcept = (word, number) => {
101
- config.addWord(word, { id: concept, initial: `{ value: "${concept}", number: "${number}" }` } )
107
+ config.addWord(word, { id: concept, initial: `{ value: "${source_value || concept}", number: "${number}" }` } )
102
108
  const baseTypes = [
103
109
  'theAble',
104
110
  'queryable',
@@ -230,8 +230,8 @@ class API {
230
230
  // config.addBridge({ id: "owner", level: 0, bridge: "{ ...next(operator) }"})
231
231
 
232
232
  {
233
- const whoIsWhatVerbedBy = `${before[0].tag}Var is ${after[0].tag}Var ${edAble.word} by`
234
- const thisIsVerbedByThat = `${after[0].tag}Var is ${edAble.word} by ${before[0].tag}Var`
233
+ const whoIsWhatVerbedBy = `${before[0].tag}var is ${after[0].tag}var ${edAble.word} by`
234
+ const thisIsVerbedByThat = `${after[0].tag}var is ${edAble.word} by ${before[0].tag}var`
235
235
 
236
236
  // greg32 check this out
237
237
  // config.addFragments([whoIsWhatVerbedBy])
package/common/helpers.js CHANGED
@@ -163,6 +163,34 @@ const defaultContextCheck = (properties = []) => {
163
163
  ]
164
164
  }
165
165
 
166
+ const isA = (hierarchy) => (child, parent, { strict=false } = {}) => {
167
+ if (!child || !parent) {
168
+ return false
169
+ }
170
+
171
+ if (strict) {
172
+ if (child.marker) {
173
+ child = child.marker
174
+ }
175
+ if (parent.marker) {
176
+ parent = parent.marker
177
+ }
178
+ return hierarchy.isA(child, parent)
179
+ } else {
180
+ if (hierarchy.isA(child.marker || child, parent.marker || parent)) {
181
+ return true
182
+ }
183
+ for (const childT of child.types || [child]) {
184
+ for (const parentT of parent.types || [parent]) {
185
+ if (hierarchy.isA(childT, parentT)) {
186
+ return true
187
+ }
188
+ }
189
+ }
190
+ return false
191
+ }
192
+ }
193
+
166
194
  module.exports = {
167
195
  defaultContextCheck,
168
196
  defaultContextCheckProperties,
@@ -178,4 +206,5 @@ module.exports = {
178
206
  propertyToArray,
179
207
  wordNumber,
180
208
  requiredArgument,
209
+ isA,
181
210
  }
@@ -840,6 +840,11 @@
840
840
  "verb",
841
841
  false
842
842
  ],
843
+ [
844
+ "negatable",
845
+ "queryable",
846
+ false
847
+ ],
843
848
  [
844
849
  "noun",
845
850
  "theAble",
@@ -244,6 +244,11 @@
244
244
  "verb",
245
245
  false
246
246
  ],
247
+ [
248
+ "every",
249
+ "quantifier",
250
+ false
251
+ ],
247
252
  [
248
253
  "expression",
249
254
  "expression",
@@ -514,6 +519,11 @@
514
519
  "verb",
515
520
  false
516
521
  ],
522
+ [
523
+ "negatable",
524
+ "queryable",
525
+ false
526
+ ],
517
527
  [
518
528
  "noun",
519
529
  "theAble",
@@ -1436,6 +1446,11 @@
1436
1446
  "verb",
1437
1447
  false
1438
1448
  ],
1449
+ [
1450
+ "every",
1451
+ "quantifier",
1452
+ false
1453
+ ],
1439
1454
  [
1440
1455
  "expression",
1441
1456
  "expression",
@@ -1706,6 +1721,11 @@
1706
1721
  "verb",
1707
1722
  false
1708
1723
  ],
1724
+ [
1725
+ "negatable",
1726
+ "queryable",
1727
+ false
1728
+ ],
1709
1729
  [
1710
1730
  "noun",
1711
1731
  "theAble",
@@ -3177,6 +3197,11 @@
3177
3197
  "verb",
3178
3198
  false
3179
3199
  ],
3200
+ [
3201
+ "every",
3202
+ "quantifier",
3203
+ false
3204
+ ],
3180
3205
  [
3181
3206
  "expression",
3182
3207
  "expression",
@@ -3567,6 +3592,11 @@
3567
3592
  "verb",
3568
3593
  false
3569
3594
  ],
3595
+ [
3596
+ "negatable",
3597
+ "queryable",
3598
+ false
3599
+ ],
3570
3600
  [
3571
3601
  "noun",
3572
3602
  "theAble",
@@ -4583,6 +4613,11 @@
4583
4613
  "verb",
4584
4614
  false
4585
4615
  ],
4616
+ [
4617
+ "every",
4618
+ "quantifier",
4619
+ false
4620
+ ],
4586
4621
  [
4587
4622
  "expression",
4588
4623
  "expression",
@@ -4973,6 +5008,11 @@
4973
5008
  "verb",
4974
5009
  false
4975
5010
  ],
5011
+ [
5012
+ "negatable",
5013
+ "queryable",
5014
+ false
5015
+ ],
4976
5016
  [
4977
5017
  "noun",
4978
5018
  "theAble",
@@ -5989,6 +6029,11 @@
5989
6029
  "verb",
5990
6030
  false
5991
6031
  ],
6032
+ [
6033
+ "every",
6034
+ "quantifier",
6035
+ false
6036
+ ],
5992
6037
  [
5993
6038
  "expression",
5994
6039
  "expression",
@@ -6379,6 +6424,11 @@
6379
6424
  "verb",
6380
6425
  false
6381
6426
  ],
6427
+ [
6428
+ "negatable",
6429
+ "queryable",
6430
+ false
6431
+ ],
6382
6432
  [
6383
6433
  "noun",
6384
6434
  "theAble",
@@ -7408,6 +7458,11 @@
7408
7458
  "verb",
7409
7459
  false
7410
7460
  ],
7461
+ [
7462
+ "every",
7463
+ "quantifier",
7464
+ false
7465
+ ],
7411
7466
  [
7412
7467
  "expression",
7413
7468
  "expression",
@@ -7798,6 +7853,11 @@
7798
7853
  "verb",
7799
7854
  false
7800
7855
  ],
7856
+ [
7857
+ "negatable",
7858
+ "queryable",
7859
+ false
7860
+ ],
7801
7861
  [
7802
7862
  "noun",
7803
7863
  "theAble",
@@ -8837,6 +8897,11 @@
8837
8897
  "verb",
8838
8898
  false
8839
8899
  ],
8900
+ [
8901
+ "every",
8902
+ "quantifier",
8903
+ false
8904
+ ],
8840
8905
  [
8841
8906
  "expression",
8842
8907
  "expression",
@@ -9227,6 +9292,11 @@
9227
9292
  "verb",
9228
9293
  false
9229
9294
  ],
9295
+ [
9296
+ "negatable",
9297
+ "queryable",
9298
+ false
9299
+ ],
9230
9300
  [
9231
9301
  "noun",
9232
9302
  "theAble",
@@ -10266,6 +10336,11 @@
10266
10336
  "verb",
10267
10337
  false
10268
10338
  ],
10339
+ [
10340
+ "every",
10341
+ "quantifier",
10342
+ false
10343
+ ],
10269
10344
  [
10270
10345
  "expression",
10271
10346
  "expression",
@@ -10656,6 +10731,11 @@
10656
10731
  "verb",
10657
10732
  false
10658
10733
  ],
10734
+ [
10735
+ "negatable",
10736
+ "queryable",
10737
+ false
10738
+ ],
10659
10739
  [
10660
10740
  "noun",
10661
10741
  "theAble",
@@ -11685,6 +11765,11 @@
11685
11765
  "verb",
11686
11766
  false
11687
11767
  ],
11768
+ [
11769
+ "every",
11770
+ "quantifier",
11771
+ false
11772
+ ],
11688
11773
  [
11689
11774
  "expression",
11690
11775
  "expression",
@@ -12075,6 +12160,11 @@
12075
12160
  "verb",
12076
12161
  false
12077
12162
  ],
12163
+ [
12164
+ "negatable",
12165
+ "queryable",
12166
+ false
12167
+ ],
12078
12168
  [
12079
12169
  "noun",
12080
12170
  "theAble",
@@ -13091,6 +13181,11 @@
13091
13181
  "verb",
13092
13182
  false
13093
13183
  ],
13184
+ [
13185
+ "every",
13186
+ "quantifier",
13187
+ false
13188
+ ],
13094
13189
  [
13095
13190
  "expression",
13096
13191
  "expression",
@@ -13481,6 +13576,11 @@
13481
13576
  "verb",
13482
13577
  false
13483
13578
  ],
13579
+ [
13580
+ "negatable",
13581
+ "queryable",
13582
+ false
13583
+ ],
13484
13584
  [
13485
13585
  "noun",
13486
13586
  "theAble",
@@ -14497,6 +14597,11 @@
14497
14597
  "verb",
14498
14598
  false
14499
14599
  ],
14600
+ [
14601
+ "every",
14602
+ "quantifier",
14603
+ false
14604
+ ],
14500
14605
  [
14501
14606
  "expression",
14502
14607
  "expression",
@@ -14887,6 +14992,11 @@
14887
14992
  "verb",
14888
14993
  false
14889
14994
  ],
14995
+ [
14996
+ "negatable",
14997
+ "queryable",
14998
+ false
14999
+ ],
14890
15000
  [
14891
15001
  "noun",
14892
15002
  "theAble",
@@ -15903,6 +16013,11 @@
15903
16013
  "verb",
15904
16014
  false
15905
16015
  ],
16016
+ [
16017
+ "every",
16018
+ "quantifier",
16019
+ false
16020
+ ],
15906
16021
  [
15907
16022
  "expression",
15908
16023
  "expression",
@@ -16293,6 +16408,11 @@
16293
16408
  "verb",
16294
16409
  false
16295
16410
  ],
16411
+ [
16412
+ "negatable",
16413
+ "queryable",
16414
+ false
16415
+ ],
16296
16416
  [
16297
16417
  "noun",
16298
16418
  "theAble",
@@ -17300,6 +17420,11 @@
17300
17420
  "verb",
17301
17421
  false
17302
17422
  ],
17423
+ [
17424
+ "every",
17425
+ "quantifier",
17426
+ false
17427
+ ],
17303
17428
  [
17304
17429
  "expression",
17305
17430
  "expression",
@@ -17690,6 +17815,11 @@
17690
17815
  "verb",
17691
17816
  false
17692
17817
  ],
17818
+ [
17819
+ "negatable",
17820
+ "queryable",
17821
+ false
17822
+ ],
17693
17823
  [
17694
17824
  "noun",
17695
17825
  "theAble",
@@ -18719,6 +18849,11 @@
18719
18849
  "verb",
18720
18850
  false
18721
18851
  ],
18852
+ [
18853
+ "every",
18854
+ "quantifier",
18855
+ false
18856
+ ],
18722
18857
  [
18723
18858
  "expression",
18724
18859
  "expression",
@@ -19109,6 +19244,11 @@
19109
19244
  "verb",
19110
19245
  false
19111
19246
  ],
19247
+ [
19248
+ "negatable",
19249
+ "queryable",
19250
+ false
19251
+ ],
19112
19252
  [
19113
19253
  "noun",
19114
19254
  "theAble",
@@ -20148,6 +20288,11 @@
20148
20288
  "verb",
20149
20289
  false
20150
20290
  ],
20291
+ [
20292
+ "every",
20293
+ "quantifier",
20294
+ false
20295
+ ],
20151
20296
  [
20152
20297
  "expression",
20153
20298
  "expression",
@@ -20538,6 +20683,11 @@
20538
20683
  "verb",
20539
20684
  false
20540
20685
  ],
20686
+ [
20687
+ "negatable",
20688
+ "queryable",
20689
+ false
20690
+ ],
20541
20691
  [
20542
20692
  "noun",
20543
20693
  "theAble",
@@ -354,6 +354,11 @@
354
354
  "verb",
355
355
  false
356
356
  ],
357
+ [
358
+ "every",
359
+ "quantifier",
360
+ false
361
+ ],
357
362
  [
358
363
  "hasCountOfPieces",
359
364
  "countable",
@@ -444,6 +449,11 @@
444
449
  "verb",
445
450
  false
446
451
  ],
452
+ [
453
+ "negatable",
454
+ "queryable",
455
+ false
456
+ ],
447
457
  [
448
458
  "noun",
449
459
  "theAble",
package/common/meta.js CHANGED
@@ -278,9 +278,11 @@ let config = {
278
278
  where: where(),
279
279
  match: ({context}) => context.marker == 'means' && context.from.marker == 'unknown',
280
280
  apply: async ({config, context, kms, e, isTest}) => {
281
- if (false && isTest) {
282
- return
283
- } else if (kms.dialogues) {
281
+ if (kms.dialogues) {
282
+ if (context.from.unknown && !context.to.unknown) {
283
+ // kms.dialogues.api.makeObject({ context: context.from, types: [context.to.marker], source_value: context.to.value, config });
284
+ kms.dialogues.api.makeObject({ context: context.from, types: [context.to.marker], source_value: context.to.value, config });
285
+ }
284
286
  if (context.to.value) {
285
287
  kms.stm.api.setVariable(context.from.value, context.to.value)
286
288
  } else {
@@ -196,6 +196,11 @@
196
196
  "verb",
197
197
  false
198
198
  ],
199
+ [
200
+ "negatable",
201
+ "queryable",
202
+ false
203
+ ],
199
204
  [
200
205
  "noun",
201
206
  "theAble",
@@ -1042,6 +1047,11 @@
1042
1047
  "verb",
1043
1048
  false
1044
1049
  ],
1050
+ [
1051
+ "negatable",
1052
+ "queryable",
1053
+ false
1054
+ ],
1045
1055
  [
1046
1056
  "noun",
1047
1057
  "theAble",
@@ -2030,6 +2040,40 @@
2030
2040
  0
2031
2041
  ]
2032
2042
  ],
2043
+ [
2044
+ [
2045
+ "if",
2046
+ 0
2047
+ ],
2048
+ [
2049
+ "like",
2050
+ 0
2051
+ ],
2052
+ [
2053
+ "love",
2054
+ 0
2055
+ ],
2056
+ [
2057
+ "orList",
2058
+ 0
2059
+ ],
2060
+ [
2061
+ "then",
2062
+ 0
2063
+ ],
2064
+ [
2065
+ "unknown",
2066
+ 0
2067
+ ],
2068
+ [
2069
+ "unknown",
2070
+ 1
2071
+ ],
2072
+ [
2073
+ "want",
2074
+ 0
2075
+ ]
2076
+ ],
2033
2077
  [
2034
2078
  [
2035
2079
  "if",
@@ -2395,6 +2439,40 @@
2395
2439
  0
2396
2440
  ]
2397
2441
  ],
2442
+ [
2443
+ [
2444
+ "if",
2445
+ 0
2446
+ ],
2447
+ [
2448
+ "like",
2449
+ 0
2450
+ ],
2451
+ [
2452
+ "love",
2453
+ 0
2454
+ ],
2455
+ [
2456
+ "orList",
2457
+ 0
2458
+ ],
2459
+ [
2460
+ "then",
2461
+ 0
2462
+ ],
2463
+ [
2464
+ "unknown",
2465
+ 0
2466
+ ],
2467
+ [
2468
+ "unknown",
2469
+ 1
2470
+ ],
2471
+ [
2472
+ "want",
2473
+ 0
2474
+ ]
2475
+ ],
2398
2476
  [
2399
2477
  [
2400
2478
  "if",