tpmkms_4wp 9.5.1-beta.9 → 9.6.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 (114) hide show
  1. package/common/animals.instance.json +130 -0
  2. package/common/animals.js +3 -5
  3. package/common/asking.js +12 -4
  4. package/common/avatar.test.json +1001 -860
  5. package/common/can.instance.json +2182 -5
  6. package/common/can.js +102 -39
  7. package/common/can.test.json +51307 -0
  8. package/common/colors.instance.json +142 -30
  9. package/common/colors.js +3 -6
  10. package/common/comparable.instance.json +31 -1
  11. package/common/comparable.js +3 -6
  12. package/common/concept.js +25 -27
  13. package/common/concept.test.json +142 -120
  14. package/common/conjunction.test.json +32 -42
  15. package/common/crew.instance.json +400 -126
  16. package/common/crew.js +3 -6
  17. package/common/dateTimeSelectors.instance.json +2 -2
  18. package/common/dateTimeSelectors.js +6 -9
  19. package/common/dateTimeSelectors.test.json +76935 -35739
  20. package/common/dates.instance.json +50 -84
  21. package/common/dates.js +3 -6
  22. package/common/dates.test.json +284 -287
  23. package/common/dialogues.js +33 -115
  24. package/common/dialogues.test.json +1248 -1152
  25. package/common/dimension.instance.json +21498 -566
  26. package/common/dimension.js +147 -52
  27. package/common/dimension.test.json +10979 -4625
  28. package/common/drone.instance.json +24709 -0
  29. package/common/drone.js +662 -0
  30. package/common/drone.test.json +30522 -0
  31. package/common/drone_v1.instance.json +24703 -0
  32. package/common/drone_v1.js +596 -0
  33. package/common/drone_v1.test.json +115538 -0
  34. package/common/edible.instance.json +365 -65
  35. package/common/edible.js +3 -5
  36. package/common/emotions.instance.json +57 -70
  37. package/common/emotions.js +3 -6
  38. package/common/errors.js +3 -3
  39. package/common/fastfood.instance.json +1270 -244
  40. package/common/fastfood.js +10 -12
  41. package/common/fastfood.test.json +6970 -6829
  42. package/common/formulas.instance.json +10 -0
  43. package/common/formulas.js +2 -1
  44. package/common/gdefaults.js +58 -13
  45. package/common/help.js +9 -9
  46. package/common/help.test.json +65 -11
  47. package/common/helpers/dialogues.js +9 -1
  48. package/common/helpers/properties.js +37 -18
  49. package/common/helpers.js +32 -2
  50. package/common/hierarchy.js +10 -8
  51. package/common/kirk.instance.json +10 -0
  52. package/common/kirk.js +4 -6
  53. package/common/kirk.test.json +600 -424
  54. package/common/latin.instance.json +10 -10
  55. package/common/latin.js +8 -10
  56. package/common/length.instance.json +34659 -3157
  57. package/common/length.js +11 -6
  58. package/common/length.test.json +54357 -2557
  59. package/common/math.instance.json +11 -1
  60. package/common/math.js +2 -1
  61. package/common/menus.instance.json +74 -7
  62. package/common/menus.js +3 -12
  63. package/common/meta.js +4 -5
  64. package/common/nameable.js +29 -15
  65. package/common/nameable.test.json +436 -0
  66. package/common/numbers.js +1 -1
  67. package/common/ordering.instance.json +24 -2
  68. package/common/ordering.js +3 -5
  69. package/common/ordering.test.json +104 -174
  70. package/common/people.instance.json +140 -315
  71. package/common/people.js +3 -5
  72. package/common/pipboy.instance.json +171 -57
  73. package/common/pipboy.js +2 -1
  74. package/common/pokemon.instance.json +135 -5
  75. package/common/pokemon.js +3 -5
  76. package/common/pressure.instance.json +3990 -1981
  77. package/common/pressure.js +3 -5
  78. package/common/pressure.test.json +433 -477
  79. package/common/properties.instance.json +15 -16
  80. package/common/properties.js +10 -9
  81. package/common/properties.test.json +9565 -6951
  82. package/common/rates.instance.json +59 -0
  83. package/common/rates.js +95 -0
  84. package/common/rates.test.json +27702 -0
  85. package/common/reminders.js +5 -8
  86. package/common/reminders.test.json +64635 -25787
  87. package/common/reports.instance.json +22 -2
  88. package/common/reports.js +3 -5
  89. package/common/scorekeeper.js +3 -6
  90. package/common/spock.instance.json +10 -0
  91. package/common/spock.js +4 -7
  92. package/common/spock.test.json +606 -430
  93. package/common/stm.js +37 -20
  94. package/common/temperature.instance.json +3162 -1153
  95. package/common/temperature.js +3 -5
  96. package/common/temperature.test.json +433 -477
  97. package/common/time.instance.json +24852 -0
  98. package/common/time.js +136 -139
  99. package/common/time.test.json +31876 -3757
  100. package/common/ui.instance.json +12 -5
  101. package/common/ui.js +4 -13
  102. package/common/weight.instance.json +10500 -4098
  103. package/common/weight.js +3 -5
  104. package/common/weight.test.json +2601 -2263
  105. package/common/words.instance.json +9 -0
  106. package/common/words.js +50 -0
  107. package/common/words.test.json +2 -0
  108. package/common/wp.instance.json +470 -58
  109. package/common/wp.js +6 -4
  110. package/common/wp.test.json +7385 -6906
  111. package/main.js +6 -2
  112. package/package.json +21 -6
  113. package/common/listener.js +0 -50
  114. package/common/listener.test.json +0 -142
package/common/can.js CHANGED
@@ -1,8 +1,8 @@
1
1
  const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
- const { defaultContextCheck } = require('./helpers')
2
+ const { defaultContextCheck, propertyToArray } = require('./helpers')
3
3
  const hierarchy = require("./hierarchy")
4
- const can_tests = require('./can.test.json')
5
- const can_instance = require('./can.instance.json')
4
+ const tests = require('./can.test.json')
5
+ const instance = require('./can.instance.json')
6
6
 
7
7
  /*
8
8
  you can make these coffees -> list of coffees
@@ -46,28 +46,7 @@ const config = {
46
46
  // who can coffee be made by
47
47
  "((*) [whatCanQuestionPassive|can] (*) ([beCanPassive|be]) (canableAction) ([byCanPassive|by]))",
48
48
  "((*) [canPassive|can] ([beCanPassive|be]) (canableAction) ([byCanPassive|by]) (*))",
49
- /*
50
- bridge: [
51
- // b=[do] o=c a=[s, ca]
52
- apply operator { ...after[1], can } to operator
53
- // b=[do] o=[ca+c] a=[s, ca]
54
- rewire before[0] -> after[0] + after[0] -> before[0]
55
- // b=[s] o=[ca+c] a=[do, ca]
56
- apply operator
57
- ]
58
- */
59
- // Bridge('{ ...before }'-(Rewire before[0] to after[0] Set after to [ListableType(Listable(Type('likee')))]), '{ ...next(operator), likee*: after[0], liker: before[0] }')
60
49
  ],
61
- /*
62
- associations: {
63
- positive: [
64
- { context: [['what', 0], ['whatCanQuestionPassive', 0], ['unknown', 0], ['beCanPassive', 0], ['make', 0], ['byCanPassive', 0]], choose: 1 },
65
- { context: [['what', 1], ['whatCanQuestionPassive', 0], ['unknown', 0], ['beCanPassive', 0], ['make', 0], ['byCanPassive', 0]], choose: 1 },
66
- { context: [['unknown', 0], ['canPassive', 0], ['beCanPassive', 0], ['make', 0], ['byCanPassive', 0], ['unknown', 0]], choose: 1 },
67
- { context: [['unknown', 1], ['canPassive', 0], ['beCanPassive', 0], ['make', 0], ['byCanPassive', 0], ['unknown', 0]], choose: 1 },
68
- ],
69
- },
70
- */
71
50
  bridges: [
72
51
  { id: 'beCanPassive' },
73
52
  { id: 'byCanPassive' },
@@ -78,13 +57,12 @@ const config = {
78
57
  {
79
58
  id: "canStatement",
80
59
  before: ['verb'],
81
- bridge: "{ ...after[0], can: operator, verb: after[0], interpolate: [{ property: 'can' }, { property: 'verb', context: { number: 'one' } }]}",
60
+ bridge: "{ ...after[0], can: operator, verb: after[0], voice: 'active', interpolate: [{ property: 'can' }, { property: 'verb', context: { number: 'one' } }]}",
82
61
  },
83
62
  {
84
63
  id: "canQuestion",
85
64
  before: ['verb'],
86
- // bridge: "{ ...after[0], operator.number: 'infinitive', truthValueOnly: true, query: true, can: operator, arg1: [{ property: 'can' }], interpolate: append([{ property: 'can'}], after[0].interpolate)}",
87
- bridge: "{ ...after[0], operator.number: 'infinitive', truthValueOnly: true, query: true, can: operator, interpolate: append([{ property: 'can'}], after[0].interpolate)}",
65
+ bridge: "{ ...after[0], operator.form: 'infinitive', voice: 'active', truthValueOnly: true, query: true, can: operator, interpolate: append([{ property: 'can'}], after[0].interpolate)}",
88
66
  },
89
67
  {
90
68
  // "((*) [canPassive|can] ([beCanPassive|be]) (canableAction) ([byCanPassive|by]) (*))",
@@ -100,7 +78,7 @@ const config = {
100
78
  ]
101
79
  },
102
80
  { "apply": true, "operator": "operator", "set": "context" },
103
- { "apply": true, "bridge": "{ ...context, interpolate: [context.interpolate[2], { property: 'can' }, { property: 'be' }, context.interpolate[1], { property: 'by' }, context.interpolate[0]] }", "set": "context" },
81
+ { "apply": true, "bridge": "{ ...context, voice: 'passive', interpolate: [context.interpolate[2], { word: { marker: 'canPassive' } }, { word: { marker: 'beCanPassive' } }, context.interpolate[1], { word: { marker: 'byCanPassive' } }, context.interpolate[0]] }", "set": "context" },
104
82
  // { "apply": true, "bridge": "{ ...context, interpolate: [context.interpolate[2], context.interpolate[0], context.interpolate[1]] }", set: "context" },
105
83
  ],
106
84
  },
@@ -112,7 +90,7 @@ const config = {
112
90
  // { "apply": true, "bridge": "{ ...after[1], can: operator, operator: after[1], interpolate: [{ property: 'can' }, { property: 'operator' }] }", "set": "operator" },
113
91
  { "apply": true, "bridge": "{ ...after[2], can: operator, be: after[1], operator: after[2], by: after[3] }", "set": "operator" },
114
92
  { "apply": true, "operator": "operator", "set": "context" },
115
- { "apply": true, "bridge": "{ ...context, interpolate: [context.interpolate[0], { property: 'can' }, context.interpolate[2], { property: 'be' }, context.interpolate[1], { property: 'by' }] }", "set": "context" },
93
+ { "apply": true, "bridge": "{ ...context, voice: 'passive', interpolate: [context.interpolate[0], { word: { marker: 'canPassive' } }, context.interpolate[2], { word: { marker: 'beCanPassive' } }, context.interpolate[1], { word: { marker: 'byCanPassive' } }] }", "set": "context" },
116
94
  // { "apply": true, "bridge": "{ ...context, interpolate: [context.interpolate[2], context.interpolate[0], context.interpolate[1]] }", set: "context" },
117
95
  ],
118
96
  },
@@ -121,7 +99,7 @@ const config = {
121
99
  before: ['verb'],
122
100
  bridge: [
123
101
  // { "apply": true, "bridge": "{ ...after[1], can: operator, operator: after[1], interpolate: [{ property: 'can' }, { property: 'operator' }] }", "set": "operator" },
124
- { "apply": true, "bridge": "{ ...after[1], can: operator, operator: after[1] }", "set": "operator" },
102
+ { "apply": true, "bridge": "{ ...after[1], can: operator, voice: 'active', operator: after[1] }", "set": "operator" },
125
103
  {
126
104
  "rewire": [
127
105
  { "from": 'before[0]', "to": 'after[0]' },
@@ -129,14 +107,69 @@ const config = {
129
107
  ]
130
108
  },
131
109
  { "apply": true, "operator": "operator", "set": "context" },
132
- { "apply": true, "bridge": "{ ...context, operator.number: 'infinitive', interpolate: [context.interpolate[2], { property: 'can' }, context.interpolate[0], context.interpolate[1]] }", "set": "context" },
110
+ { "apply": true, "bridge": "{ ...context, operator.form: 'infinitive', interpolate: [context.interpolate[2], { property: 'can' }, context.interpolate[0], context.interpolate[1]] }", "set": "context" },
133
111
  // { "apply": true, "bridge": "{ ...context, interpolate: [context.interpolate[2], context.interpolate[0], context.interpolate[1]] }", set: "context" },
134
112
  ],
135
113
  },
136
114
  ],
115
+ semantics: [
116
+ {
117
+ match: ({context}) => context.toVoice == 'passive',
118
+ apply: async ({g, context, fragmentMapper}) => {
119
+ for (const element of propertyToArray(context)) {
120
+ if (!element.voice) {
121
+ continue
122
+ }
123
+ if (element.voice === 'passive') {
124
+ continue
125
+ }
126
+ // From
127
+ // [{"property":"canSubject"},{"property":"operator","number":"canSubject"},{"property":"canObject"}]
128
+ element.interpolate = [
129
+ element.interpolate[2],
130
+ { word: { marker: "canPassive" } },
131
+ { word: { marker: "beCanPassive" } },
132
+ // { tense: "perfect", property: "verb" },
133
+ { semantic: [{ property: "verb" }, { overrides: { tense: "perfect", evaluateWord: true } }] },
134
+ { word: { marker: "byCanPassive" } },
135
+ element.interpolate[0],
136
+ ]
137
+ element.voice = 'passive'
138
+ }
139
+ }
140
+ },
141
+ {
142
+ match: ({context}) => context.toVoice == 'active',
143
+ apply: async ({g, context, fragmentMapper}) => {
144
+ // From
145
+ // [{"property":"canSubject"},{"property":"operator","number":"canSubject"},{"property":"canObject"}]
146
+ for (const element of propertyToArray(context)) {
147
+ if (!element.voice) {
148
+ continue
149
+ }
150
+ if (element.voice === 'active') {
151
+ continue
152
+ }
153
+ element.interpolate = [
154
+ element.interpolate[5],
155
+ { "word": { "marker": "canPassive" } },
156
+ // { "number": element.interpolate[5].property, "property": "operator" },
157
+ { semantic: [{ property: "operator" }, { overrides: { form: "infinitive", evaluateWord: true } }] },
158
+ element.interpolate[0],
159
+ ]
160
+ element.voice = 'active'
161
+ }
162
+ }
163
+ },
164
+ ],
137
165
  };
138
166
 
139
167
  const template = {
168
+ fragments: [
169
+ "canobject can be canverb by cansubject",
170
+ "cansubject can canverb canobject",
171
+ ],
172
+
140
173
  configs: [
141
174
  ({isProcess, isTesting, testModuleName, apis, config, addHierarchy}) => {
142
175
  if (isProcess || isTesting) {
@@ -163,7 +196,38 @@ const template = {
163
196
  config,
164
197
  })
165
198
  }
166
- }
199
+ const api = apis('properties')
200
+ api.createActionPrefix({
201
+ before: [{tag: 'canSubject', id: 'canSubject'}],
202
+ operator: 'canVerb',
203
+ after: [{tag: 'canObject', id: 'canObject'}],
204
+ relation: true,
205
+ flatten: true,
206
+ can: true,
207
+ create: [
208
+ {
209
+ id: 'canVerb',
210
+ },
211
+ 'canObject',
212
+ 'canSubject'
213
+ ],
214
+ localHierarchy: [
215
+ ['unknown', 'canObject'],
216
+ ['unknown', 'canSubject'],
217
+ ],
218
+ config,
219
+ })
220
+ },
221
+ async ({fragments, addWordToDictionary}) => {
222
+ const fragment = await fragments("canobject can be canverb by cansubject")
223
+ // only run after rebuild template
224
+ if (fragment) {
225
+ const context = fragment.contexts()[0]
226
+ addWordToDictionary(context.be)
227
+ addWordToDictionary(context.by)
228
+ addWordToDictionary(context.can)
229
+ }
230
+ },
167
231
  ]
168
232
  }
169
233
 
@@ -175,14 +239,13 @@ knowledgeModule( {
175
239
  description: 'talk about what can be done',
176
240
  test: {
177
241
  name: './can.test.json',
178
- contents: can_tests,
242
+ contents: tests,
179
243
  checks: {
180
- context: [defaultContextCheck()],
244
+ context: [
245
+ defaultContextCheck({ extra: ['can', 'evalue', 'makeable', 'maker', 'operator', 'interpolate', 'number', 'property', 'word'] }),
246
+ ],
181
247
  },
182
248
  },
183
- template: {
184
- template,
185
- instance: can_instance,
186
- },
187
-
249
+ instance,
250
+ template,
188
251
  })