tpmkms_4wp 8.0.0-beta.0 → 8.0.0-beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. package/common/animals.instance.json +103 -113
  2. package/common/characters.js +0 -1
  3. package/common/colors.instance.json +22140 -0
  4. package/common/colors.js +71 -0
  5. package/common/colors.test.json +4860 -0
  6. package/common/concept.js +2 -2
  7. package/common/crew.instance.json +4142 -3545
  8. package/common/crew.js +4 -2
  9. package/common/dialogues.js +34 -7
  10. package/common/dialogues.test.json +1053 -33
  11. package/common/dimension.instance.json +20 -30
  12. package/common/dimension.test.json +289 -312
  13. package/common/edible.instance.json +216 -156
  14. package/common/emotions.instance.json +64 -0
  15. package/common/fastfood.instance.json +1011 -386
  16. package/common/fastfood.js +1 -1
  17. package/common/fastfood.test.json +7941 -3647
  18. package/common/formulas.instance.json +4 -0
  19. package/common/formulas.test.json +1027 -955
  20. package/common/help.test.json +14 -10
  21. package/common/helpers/concept.js +29 -9
  22. package/common/helpers/dialogues.js +17 -1
  23. package/common/helpers/formulas.js +0 -14
  24. package/common/helpers/meta.js +0 -1
  25. package/common/helpers/properties.js +6 -13
  26. package/common/kirk.instance.json +4 -0
  27. package/common/length.instance.json +93 -63
  28. package/common/math.instance.json +26 -47
  29. package/common/meta.js +0 -2
  30. package/common/ordering.instance.json +76 -0
  31. package/common/people.instance.json +35 -60
  32. package/common/pipboy.instance.json +215 -229
  33. package/common/pokemon.instance.json +131 -82
  34. package/common/pressure.instance.json +38 -48
  35. package/common/properties.instance.json +4 -0
  36. package/common/properties.js +7 -7
  37. package/common/properties.test.json +17605 -4030
  38. package/common/punctuation.js +8 -0
  39. package/common/punctuation.test.json +233 -5
  40. package/common/reports.instance.json +12 -4
  41. package/common/reports.js +0 -2
  42. package/common/sizeable.js +7 -2
  43. package/common/spock.instance.json +4 -0
  44. package/common/stm.js +16 -5
  45. package/common/temperature.instance.json +45 -59
  46. package/common/testing.js +0 -1
  47. package/common/tokenize.js +2 -1
  48. package/common/tokenize.test.json +86 -1
  49. package/common/ui.instance.json +4 -0
  50. package/common/ui.js +0 -1
  51. package/common/weight.instance.json +62 -11
  52. package/common/weight.test.json +242 -238
  53. package/main.js +2 -0
  54. package/package.json +6 -2
package/common/crew.js CHANGED
@@ -8,6 +8,7 @@ const pluralize = require('pluralize')
8
8
 
9
9
  const template = {
10
10
  configs: [
11
+ "crew modifies member",
11
12
  "kirk's name is jim",
12
13
  "kirk's rank is captain",
13
14
  "kirk's eyes are blue",
@@ -24,6 +25,7 @@ const template = {
24
25
  "mccoy is a crew member",
25
26
  "mccoy is a doctor",
26
27
  "the status of the phasers is armed",
28
+ "photon modifies torpedoes",
27
29
  "the status of the photon torpedoes is armed",
28
30
  "phasers are weapons",
29
31
  "torpedoes are weapons",
@@ -43,8 +45,8 @@ const createConfig = () => {
43
45
  config.initializer( ({config, apis}) => {
44
46
  const api = apis('properties')
45
47
  const conceptApi = apis('concept')
46
- conceptApi.kindOfConcept({ config, modifiers: ['photon'], object: 'torpedo' })
47
- conceptApi.kindOfConcept({ config, modifiers: ['crew'], object: 'member' })
48
+ // conceptApi.kindOfConcept({ config, modifiers: ['photon'], object: 'torpedo' })
49
+ // conceptApi.kindOfConcept({ config, modifiers: ['crew'], object: 'member' })
48
50
  api.createActionPrefix({
49
51
  operator: 'arm',
50
52
  create: ['arm', 'weapon'],
@@ -36,6 +36,10 @@ const warningSameNotEvaluated = (log, one) => {
36
36
  let configStruct = {
37
37
  name: 'dialogues',
38
38
  operators: [
39
+ "([makeObject] (word))",
40
+ "([setIdSuffix] (word))",
41
+ "([resetIdSuffix])",
42
+
39
43
  "(([queryable]) [is|] ([queryable|]))",
40
44
  "([is:queryBridge|] ([queryable]) ([queryable]))",
41
45
  // "(([queryable]) [is:isEdBridge|is,are] ([isEdAble|]))",
@@ -98,6 +102,30 @@ let configStruct = {
98
102
  ]
99
103
  },
100
104
  bridges: [
105
+ {
106
+ id: 'makeObject',
107
+ bridge: "{ ...next(operator), object: after[0] }",
108
+ generatorp: ({context, gp}) => `${context.word} ${gp(context.object)}`,
109
+ semantic: ({config, context, api}) => {
110
+ api.makeObject({ context: context.object, config, types: [] })
111
+ }
112
+ },
113
+ {
114
+ id: 'setIdSuffix',
115
+ bridge: "{ ...next(operator), suffix: after[0] }",
116
+ generatorp: ({context, gp}) => `${context.word} ${gp(context.suffix)}`,
117
+ semantic: ({context, api}) => {
118
+ api.setIdSuffix(context.suffix.text)
119
+ }
120
+ },
121
+ {
122
+ id: 'resetIdSuffix',
123
+ bridge: "{ ...next(operator) }",
124
+ semantic: ({context, api}) => {
125
+ api.setIdSuffix('')
126
+ }
127
+ },
128
+
101
129
  { id: "by", level: 0, bridge: "{ ...next(operator), object: after[0] }", optional: { 'isEder': "{ marker: 'unknown', implicit: true, concept: true }", }, },
102
130
 
103
131
  { id: "debug23", level: 0, bridge: "{ ...next(operator) }" },
@@ -235,7 +263,6 @@ let configStruct = {
235
263
  applyq: () => 'the test question?',
236
264
  onNevermind: ({objects, context}) => {
237
265
  objects.onNevermindWasCalled = true
238
- debugger
239
266
  objects.nevermindType = nevermindType
240
267
  return nevermindType == 'accept'
241
268
  },
@@ -303,6 +330,7 @@ let configStruct = {
303
330
  { "context": [['isEdAble', 0], ['is', 1], ], "choose": [0] },
304
331
  ],
305
332
  hierarchy: [
333
+ ['doubleQuote', 'queryable'],
306
334
  ['it', 'pronoun'],
307
335
  ['this', 'pronoun'],
308
336
  ['questionMark', 'punctuation'],
@@ -681,7 +709,6 @@ let configStruct = {
681
709
 
682
710
  */
683
711
  context.value = kms.stm.api.mentions(context)
684
- // debugger;
685
712
  if (!context.value) {
686
713
  // retry()
687
714
  context.value = { marker: 'answerNotKnown' }
@@ -897,9 +924,6 @@ let configStruct = {
897
924
 
898
925
  // move ask to the KM's since verbatim is called probably in dialogues?
899
926
  const getAsk = (config) => (uuid) => {
900
- // if (!uuid) {
901
- // debugger
902
- //}
903
927
  return (asks) => {
904
928
  const ask = (ask) => {
905
929
  let oneShot = true // default
@@ -1005,7 +1029,7 @@ const createConfig = () => {
1005
1029
  e: (context) => config.api.getEvaluator(args.s, args.log, context),
1006
1030
  }))
1007
1031
  */
1008
- config.addArgs(({config, isA}) => ({
1032
+ config.addArgs(({config, api, isA}) => ({
1009
1033
  isAListable: (context, type) => {
1010
1034
  if (context.marker == 'list' || context.listable) {
1011
1035
  return context.value.every( (element) => isA(element.marker, type) )
@@ -1026,6 +1050,9 @@ const createConfig = () => {
1026
1050
  ask: getAsk(config)(uuid),
1027
1051
  }
1028
1052
  },
1053
+ toScopedId: (context) => {
1054
+ return api('dialogues').toScopedId(context)
1055
+ },
1029
1056
  }))
1030
1057
  objects.mentioned = []
1031
1058
  objects.variables = {
@@ -1048,7 +1075,7 @@ knowledgeModule( {
1048
1075
  name: './dialogues.test.json',
1049
1076
  contents: dialogues_tests,
1050
1077
  checks: {
1051
- objects: ['onNevermindWasCalled', 'nevermindType'],
1078
+ objects: ['onNevermindWasCalled', 'nevermindType', 'idSuffix'],
1052
1079
  context: defaultContextCheck,
1053
1080
  },
1054
1081