ekms 8.1.0 → 8.3.0-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 (44) hide show
  1. package/common/animals.instance.json +65 -13
  2. package/common/colors.instance.json +195 -14
  3. package/common/comparable.instance.json +18 -3
  4. package/common/concept.test.json +688 -0
  5. package/common/countable.test.json +664 -317
  6. package/common/crew.instance.json +27 -569
  7. package/common/dialogues.js +11 -4
  8. package/common/dimension.instance.json +15 -1
  9. package/common/edible.instance.json +334 -32
  10. package/common/edible.test.json +860 -316
  11. package/common/emotions.instance.json +1 -61
  12. package/common/fastfood.instance.json +902 -506
  13. package/common/fastfood.test.json +20879 -15283
  14. package/common/formulas.instance.json +6 -1
  15. package/common/formulas.test.json +5242 -1930
  16. package/common/gdefaults.js +14 -8
  17. package/common/helpers/concept.js +8 -4
  18. package/common/helpers/properties.js +20 -8
  19. package/common/hierarchy.js +1 -0
  20. package/common/kirk.instance.json +1 -6
  21. package/common/length.instance.json +334 -262
  22. package/common/math.instance.json +6 -1
  23. package/common/numbers.js +34 -27
  24. package/common/numbers.test.json +73 -18
  25. package/common/ordering.instance.json +12 -3
  26. package/common/ordinals.js +1 -0
  27. package/common/ordinals.test.json +106 -0
  28. package/common/people.instance.json +66 -284
  29. package/common/people.test.json +1815 -1073
  30. package/common/percentages.js +1 -0
  31. package/common/percentages.test.json +37 -37
  32. package/common/pipboy.instance.json +290 -27
  33. package/common/pokemon.instance.json +30 -13
  34. package/common/pressure.instance.json +150 -97
  35. package/common/properties.instance.json +1 -1
  36. package/common/properties.js +8 -0
  37. package/common/reports.instance.json +21 -1
  38. package/common/scorekeeper.test.json +3563 -2096
  39. package/common/spock.instance.json +1 -6
  40. package/common/temperature.instance.json +206 -149
  41. package/common/ui.instance.json +6 -1
  42. package/common/ui.js +1 -0
  43. package/common/weight.instance.json +309 -224
  44. package/package.json +2 -2
@@ -33,17 +33,29 @@ let config = {
33
33
  where: where(),
34
34
  match: ({context}) => context.generate,
35
35
  apply: async ({context, gs}) => {
36
- const existing = context.generate.filter((key) => context[key] !== undefined)
36
+ const existing = context.generate.filter((key) => context[key] !== undefined || key == 'this')
37
37
  const filtered = existing.filter((key) => {
38
38
  if (context[key] && context[key].skipDefault) {
39
39
  return false
40
40
  }
41
41
  return true
42
42
  })
43
- return gs(filtered.map((key) => context[key]))
43
+ return gs(filtered.map((key) => {
44
+ if (key == 'this') {
45
+ return {...context, generate: null}
46
+ } else {
47
+ return context[key]
48
+ }
49
+ }))
44
50
  }
45
51
  },
46
52
 
53
+ {
54
+ where: where(),
55
+ match: ({context}) => context.evalue,
56
+ apply: async ({context, g}) => await g(context.evalue)
57
+ },
58
+
47
59
  {
48
60
  where: where(),
49
61
  //({context}) => context.paraphrase && context.modifiers,
@@ -152,12 +164,6 @@ let config = {
152
164
  apply: ({context}) => context.verbatim
153
165
  },
154
166
 
155
- {
156
- where: where(),
157
- match: ({context}) => context.evalue,
158
- apply: async ({context, g}) => await g(context.evalue)
159
- },
160
-
161
167
  {
162
168
  where: where(),
163
169
  match: ({context}) => context.value && Array.isArray(context.value),
@@ -70,7 +70,7 @@ class API {
70
70
  config.addOperator({ pattern: `([${objectId}|])`, allowDups: true })
71
71
  }
72
72
 
73
- if (object.unknown) {
73
+ if (object.unknown || object.marker !== objectId) {
74
74
  config.addWord(objectSingular, { id: objectId, initial: `{ value: '${objectId}', number: 'one' }`})
75
75
  config.addWord(objectPlural, { id: objectId, initial: `{ value: '${objectId}', number: 'many' }`})
76
76
  }
@@ -79,9 +79,13 @@ class API {
79
79
  // config.addWord(modifier, { id: modifierId, initial: `{ value: '${modifierId}' }`})
80
80
  // TODO call evaluator to pick up overrides
81
81
  if (modifier.unknown) {
82
- const modifierWord = modifier.text
83
- config.addWord(pluralize.singular(modifierWord), { id: modifierId, initial: `{ value: '${modifierId}', number: 'one' }`})
84
- config.addWord(pluralize.plural(modifierWord), { id: modifierId, initial: `{ value: '${modifierId}', number: 'many' }`})
82
+ const modifierWord = modifier.word
83
+ if (pluralize.isSingular(modifierWord)) {
84
+ config.addWord(pluralize.singular(modifierWord), { id: modifierId, initial: `{ value: '${modifierId}', number: 'one' }`})
85
+ }
86
+ if (pluralize.isPlural(modifierWord)) {
87
+ config.addWord(pluralize.plural(modifierWord), { id: modifierId, initial: `{ value: '${modifierId}', number: 'many' }`})
88
+ }
85
89
  }
86
90
  })
87
91
  // modifierds.forEach((modifierId) => config.addWord(modifierId, { id: modifierId, initial: `{ value: '${modifierId}' }`}))
@@ -104,6 +104,7 @@ class API {
104
104
  localHierarchy,
105
105
  bridge: `{
106
106
  ...before,
107
+ marker: '${after[0].tag}',
107
108
  constraints: [
108
109
  {
109
110
  property: '${after[0].tag}',
@@ -329,14 +330,25 @@ class API {
329
330
  } else {
330
331
  config.addOperator({ pattern: `(${beforeOperators} [${operator}|] ${afterOperators})`, allowDups: true })
331
332
  }
332
-
333
- for (let argument of before.concat(after)) {
334
- if (create.includes(argument.id)) {
335
- // config.addHierarchy('unknown', argument.id)
336
- // config.addHierarchy('what', argument.id)
337
- // greg23 <<<<<<<<<<<< doing this
338
- config.addHierarchy(argument.id, 'unknown')
339
- config.addHierarchy(argument.id, 'what')
333
+
334
+ if (false) {
335
+ for (let argument of before.concat(after)) {
336
+ if (create.includes(argument.id)) {
337
+ // config.addHierarchy('unknown', argument.id)
338
+ // config.addHierarchy('what', argument.id)
339
+ // greg23 <<<<<<<<<<<< doing this
340
+ config.addHierarchy(argument.id, 'unknown')
341
+ config.addHierarchy(argument.id, 'what')
342
+ }
343
+ }
344
+ } else {
345
+ for (let argument of before.concat(after)) {
346
+ if (create.includes(argument.id)) {
347
+ // config.addHierarchy(argument.id, 'unknown')
348
+ // config.addHierarchy(argument.id, 'what')
349
+ localHierarchy.push([argument.id, 'unknown'])
350
+ localHierarchy.push([argument.id, 'what'])
351
+ }
340
352
  }
341
353
  }
342
354
 
@@ -52,6 +52,7 @@ let config = {
52
52
  ['have', 'canBeDoQuestion'],
53
53
  ],
54
54
  priorities: [
55
+ { "context": [['isEd', 0], ['is', 0], ], "choose": [1] },
55
56
  { "context": [['a', 0], ['questionMark', 0], ['is', 0], ], "choose": [0] },
56
57
  // [['is', 0], ['hierarchyAble', 0]],
57
58
  // [['a', 0], ['is', 0], ['hierarchyAble', 0]],
@@ -1237,7 +1237,7 @@
1237
1237
  ],
1238
1238
  [
1239
1239
  "theAble",
1240
- "theAble",
1240
+ "queryable",
1241
1241
  false
1242
1242
  ],
1243
1243
  [
@@ -1352,12 +1352,7 @@
1352
1352
  ],
1353
1353
  [
1354
1354
  "weapon",
1355
- "unknown",
1356
- false
1357
- ],
1358
- [
1359
1355
  "weapon",
1360
- "what",
1361
1356
  false
1362
1357
  ],
1363
1358
  [