tpmkms_4wp 9.5.1-beta.2 → 9.5.1-beta.20
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.
- package/common/animals.instance.json +21 -61
- package/common/asking.js +102 -100
- package/common/can.instance.json +2180 -0
- package/common/can.js +254 -0
- package/common/can.test.json +50706 -0
- package/common/characters.js +3 -3
- package/common/colors.instance.json +38 -10
- package/common/comparable.instance.json +2 -2
- package/common/concept.test.json +54 -40
- package/common/conjunction.js +13 -5
- package/common/crew.instance.json +241 -123
- package/common/crew.js +1 -1
- package/common/currency.js +1 -1
- package/common/dates.instance.json +87 -3
- package/common/dialogues.js +41 -119
- package/common/dimension.instance.json +16 -12
- package/common/dimension.js +23 -4
- package/common/dimension.test.json +1758 -2351
- package/common/edible.instance.json +79 -95
- package/common/emotions.instance.json +53 -80
- package/common/emotions.js +1 -1
- package/common/english_helpers.js +277 -67
- package/common/fastfood.instance.json +35 -663
- package/common/fastfood.js +4 -4
- package/common/formulas.instance.json +1 -1
- package/common/gdefaults.js +85 -14
- package/common/help.js +2 -2
- package/common/help.test.json +65 -11
- package/common/helpers/concept.js +1 -1
- package/common/helpers/conjunction.js +54 -44
- package/common/helpers/dateTimeSelectors.js +2 -2
- package/common/helpers/dialogues.js +1 -1
- package/common/helpers/formulas.js +13 -11
- package/common/helpers/menus.js +12 -12
- package/common/helpers/meta.js +8 -8
- package/common/helpers/properties.js +102 -21
- package/common/helpers.js +82 -46
- package/common/hierarchy.js +4 -3
- package/common/kirk.instance.json +1 -1
- package/common/latin.instance.json +10 -10
- package/common/latin.js +5 -5
- package/common/length.instance.json +20 -2
- package/common/length.test.json +2241 -1801
- package/common/math.instance.json +20 -20
- package/common/math.js +45 -44
- package/common/menus.instance.json +3 -3
- package/common/menus.js +1 -1
- package/common/meta.js +49 -33
- package/common/ordering.instance.json +20 -30
- package/common/ordering.js +1 -1
- package/common/ordering.test.json +354 -296
- package/common/people.instance.json +56 -258
- package/common/people.js +1 -1
- package/common/people.test.json +952 -681
- package/common/pipboy.instance.json +72 -16
- package/common/pokemon.instance.json +8 -8
- package/common/pokemon.js +1 -1
- package/common/pressure.instance.json +6 -2
- package/common/properties.instance.json +4 -12
- package/common/properties.js +16 -3
- package/common/reminders.js +1 -1
- package/common/reports.instance.json +3 -3
- package/common/reports.js +18 -16
- package/common/scorekeeper.js +4 -4
- package/common/sdefaults.js +22 -2
- package/common/spock.instance.json +1 -1
- package/common/stgame.js +1 -1
- package/common/stm.js +2 -2
- package/common/tell.js +1 -1
- package/common/temperature.instance.json +6 -2
- package/common/tester.js +3 -3
- package/common/time.js +3 -3
- package/common/tokenize.js +1 -1
- package/common/weight.instance.json +19 -2
- package/common/words.instance.json +9 -0
- package/common/words.js +53 -0
- package/common/words.test.json +2 -0
- package/common/wp.instance.json +320 -8
- package/common/wp.js +8 -4
- package/common/wp.test.json +3469 -0
- package/main.js +0 -2
- package/package.json +9 -5
- package/common/listener.js +0 -50
- package/common/listener.test.json +0 -142
package/common/crew.js
CHANGED
|
@@ -37,7 +37,7 @@ const template = {
|
|
|
37
37
|
],
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
function initializer({config, apis}) {
|
|
41
41
|
const api = apis('properties')
|
|
42
42
|
const conceptApi = apis('concept')
|
|
43
43
|
// conceptApi.kindOfConcept({ config, modifiers: ['photon'], object: 'torpedo' })
|
package/common/currency.js
CHANGED
|
@@ -89,7 +89,7 @@ const config = {
|
|
|
89
89
|
],
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
function initializer({config, objects, apis, addWord, addGenerator, baseConfig, uuid}) {
|
|
93
93
|
const api = apis('currency')
|
|
94
94
|
units = api.getUnits()
|
|
95
95
|
for (word in units) {
|
|
@@ -2972,7 +2972,7 @@
|
|
|
2972
2972
|
"text": "january, february, march, april, may, june, july, august, september, october, november and december",
|
|
2973
2973
|
"range": {
|
|
2974
2974
|
"start": 0,
|
|
2975
|
-
"end":
|
|
2975
|
+
"end": 98
|
|
2976
2976
|
},
|
|
2977
2977
|
"types": [
|
|
2978
2978
|
"list",
|
|
@@ -3401,6 +3401,20 @@
|
|
|
3401
3401
|
0
|
|
3402
3402
|
]
|
|
3403
3403
|
],
|
|
3404
|
+
[
|
|
3405
|
+
[
|
|
3406
|
+
"is",
|
|
3407
|
+
0
|
|
3408
|
+
],
|
|
3409
|
+
[
|
|
3410
|
+
"list",
|
|
3411
|
+
1
|
|
3412
|
+
],
|
|
3413
|
+
[
|
|
3414
|
+
"unknown",
|
|
3415
|
+
0
|
|
3416
|
+
]
|
|
3417
|
+
],
|
|
3404
3418
|
[
|
|
3405
3419
|
[
|
|
3406
3420
|
"is",
|
|
@@ -11477,7 +11491,7 @@
|
|
|
11477
11491
|
"text": "monday, tuesday, wednesday, thursday, friday, saturday and sunday",
|
|
11478
11492
|
"range": {
|
|
11479
11493
|
"start": 0,
|
|
11480
|
-
"end":
|
|
11494
|
+
"end": 64
|
|
11481
11495
|
},
|
|
11482
11496
|
"types": [
|
|
11483
11497
|
"list",
|
|
@@ -11751,6 +11765,20 @@
|
|
|
11751
11765
|
0
|
|
11752
11766
|
]
|
|
11753
11767
|
],
|
|
11768
|
+
[
|
|
11769
|
+
[
|
|
11770
|
+
"is",
|
|
11771
|
+
0
|
|
11772
|
+
],
|
|
11773
|
+
[
|
|
11774
|
+
"list",
|
|
11775
|
+
1
|
|
11776
|
+
],
|
|
11777
|
+
[
|
|
11778
|
+
"unknown",
|
|
11779
|
+
0
|
|
11780
|
+
]
|
|
11781
|
+
],
|
|
11754
11782
|
[
|
|
11755
11783
|
[
|
|
11756
11784
|
"is",
|
|
@@ -15659,7 +15687,7 @@
|
|
|
15659
15687
|
"text": "ac, bc, bce and ad",
|
|
15660
15688
|
"range": {
|
|
15661
15689
|
"start": 0,
|
|
15662
|
-
"end":
|
|
15690
|
+
"end": 17
|
|
15663
15691
|
},
|
|
15664
15692
|
"types": [
|
|
15665
15693
|
"list",
|
|
@@ -15840,6 +15868,20 @@
|
|
|
15840
15868
|
0
|
|
15841
15869
|
]
|
|
15842
15870
|
],
|
|
15871
|
+
[
|
|
15872
|
+
[
|
|
15873
|
+
"is",
|
|
15874
|
+
0
|
|
15875
|
+
],
|
|
15876
|
+
[
|
|
15877
|
+
"list",
|
|
15878
|
+
1
|
|
15879
|
+
],
|
|
15880
|
+
[
|
|
15881
|
+
"unknown",
|
|
15882
|
+
0
|
|
15883
|
+
]
|
|
15884
|
+
],
|
|
15843
15885
|
[
|
|
15844
15886
|
[
|
|
15845
15887
|
"is",
|
|
@@ -18801,6 +18843,48 @@
|
|
|
18801
18843
|
0
|
|
18802
18844
|
]
|
|
18803
18845
|
],
|
|
18846
|
+
[
|
|
18847
|
+
[
|
|
18848
|
+
"is",
|
|
18849
|
+
0
|
|
18850
|
+
],
|
|
18851
|
+
[
|
|
18852
|
+
"list",
|
|
18853
|
+
1
|
|
18854
|
+
],
|
|
18855
|
+
[
|
|
18856
|
+
"unknown",
|
|
18857
|
+
0
|
|
18858
|
+
]
|
|
18859
|
+
],
|
|
18860
|
+
[
|
|
18861
|
+
[
|
|
18862
|
+
"is",
|
|
18863
|
+
0
|
|
18864
|
+
],
|
|
18865
|
+
[
|
|
18866
|
+
"list",
|
|
18867
|
+
1
|
|
18868
|
+
],
|
|
18869
|
+
[
|
|
18870
|
+
"unknown",
|
|
18871
|
+
0
|
|
18872
|
+
]
|
|
18873
|
+
],
|
|
18874
|
+
[
|
|
18875
|
+
[
|
|
18876
|
+
"is",
|
|
18877
|
+
0
|
|
18878
|
+
],
|
|
18879
|
+
[
|
|
18880
|
+
"list",
|
|
18881
|
+
1
|
|
18882
|
+
],
|
|
18883
|
+
[
|
|
18884
|
+
"unknown",
|
|
18885
|
+
0
|
|
18886
|
+
]
|
|
18887
|
+
],
|
|
18804
18888
|
[
|
|
18805
18889
|
[
|
|
18806
18890
|
"setIdSuffix",
|
package/common/dialogues.js
CHANGED
|
@@ -16,9 +16,7 @@ const dialogues_tests = require('./dialogues.test.json')
|
|
|
16
16
|
const { defaultObjectCheck, defaultContextCheck, indent, focus } = require('./helpers')
|
|
17
17
|
const pluralize = require('pluralize')
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const warningIsANotImplemented = (log, context) => {
|
|
19
|
+
function warningIsANotImplemented(log, context) {
|
|
22
20
|
const description = 'WARNING from Dialogues KM: For semantics in order to handle sentences of type "x is y?", set the response to what you like.'
|
|
23
21
|
const match = `({context, hierarchy}) => hierarchy.isA(context.marker, 'is') && context.query && <other conditions as you like>`
|
|
24
22
|
const apply = `({context}) => <do stuff...>; context.evalue = <value>`
|
|
@@ -27,7 +25,7 @@ const warningIsANotImplemented = (log, context) => {
|
|
|
27
25
|
log(indent(message, 4))
|
|
28
26
|
}
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
function warningSameNotEvaluated(log, one) {
|
|
31
29
|
const description = 'WARNING from Dialogues KM: For the "X is Y" type phrase implement a same handler.'
|
|
32
30
|
const match = `({context}) => context.marker == '${one.marker}' && context.same && <other conditions as you like>`
|
|
33
31
|
const apply = '({context}) => <do stuff... context.same is the other value>; context.sameWasProcessed = true'
|
|
@@ -36,7 +34,7 @@ const warningSameNotEvaluated = (log, one) => {
|
|
|
36
34
|
log(indent(message, 4))
|
|
37
35
|
}
|
|
38
36
|
|
|
39
|
-
|
|
37
|
+
function listorama(type) {
|
|
40
38
|
return [
|
|
41
39
|
{ context: [[type, 0], ['list', 0], [type, 0]], choose: 0 },
|
|
42
40
|
{ context: [[type, 1], ['list', 0], [type, 0]], choose: 0 },
|
|
@@ -56,38 +54,23 @@ const config = {
|
|
|
56
54
|
|
|
57
55
|
"(([queryable]) [is|] ([queryable|]))",
|
|
58
56
|
"([isQuery|] ([queryable]) ([queryable]))",
|
|
59
|
-
// "(([queryable]) [is:isEdBridge|is,are] ([isEdAble|]))",
|
|
60
57
|
// who is the car owned by
|
|
61
58
|
"(([queryable]) [(<isEd|> ([isEdAble|]))])",
|
|
62
59
|
|
|
63
|
-
/* TODO investigate this:
|
|
64
|
-
{"pattern":"(([ownee])^ <owned|owned> ([by] ([owner])?))","uuid":"people1"}
|
|
65
|
-
{"pattern":"(([isEdee])^ <isEdAble|> ([by] ([isEder])?))","uuid":"dialogues2"}
|
|
66
|
-
*/
|
|
67
60
|
"(([isEdee])^ <isEdAble|> ([by] ([isEder])?))",
|
|
68
61
|
"([isEdee|])",
|
|
69
62
|
"([isEder|])",
|
|
70
63
|
|
|
71
|
-
// "([nevermind])",
|
|
72
|
-
// { pattern: "([nevermindTestSetup] (allowed))", scope: "testing" },
|
|
73
64
|
"([why])",
|
|
74
65
|
"([reason])",
|
|
75
|
-
// "([thisitthat|])",
|
|
76
|
-
// "([it])",
|
|
77
|
-
// "([this])",
|
|
78
|
-
// "([that])",
|
|
79
66
|
|
|
80
67
|
"(<what> ([whatAble|]))",
|
|
81
68
|
"([what:optional])",
|
|
82
|
-
// "(<the|> ([theAble|]))",
|
|
83
|
-
// "(<a|a,an> ([theAble|]))",
|
|
84
|
-
// "([unknown])",
|
|
85
69
|
|
|
86
70
|
"([be] ([briefOrWordy|]))",
|
|
87
71
|
|
|
88
72
|
"([([canBeQuestion])])",
|
|
89
73
|
"(([canBeQuestion/1,2]) <questionMark|>)",
|
|
90
|
-
// "(([is/2]) <questionMark|>)",
|
|
91
74
|
|
|
92
75
|
"(([what]) [(<does|> ([doesAble|]))])",
|
|
93
76
|
"([canBeDoQuestion])",
|
|
@@ -101,46 +84,29 @@ const config = {
|
|
|
101
84
|
|
|
102
85
|
"([to] ([toAble|]))",
|
|
103
86
|
],
|
|
104
|
-
associations: {
|
|
105
|
-
positive: [
|
|
106
|
-
{ context: [['unknown', 0], ['isEdAble', 0]], choose: 1 },
|
|
107
|
-
{ context: [['isQuery', 0], ['a', 0], ['unknown', 0], ['a', 0], ['unknown', 0]], choose: { index: 0, increment: true } },
|
|
108
|
-
|
|
109
|
-
{ context: [["unknown",0],["isEd",0],["isEdAble",0],["by",0],["unknown",0]], choose: { index: 0, increment: true } },
|
|
110
|
-
{ context: [["unknown",0],["isEd",0],["isEdAble",0],["by",1]], choose: { index: 0, increment: true } },
|
|
111
|
-
{ context: [["unknown",0],["isEd",0],["isEdAble",0]], choose: { index: 0, increment: true } },
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
// ...listorama('unknown'),
|
|
115
|
-
// ...listorama('queryable'),
|
|
116
|
-
{ context: [['unknown', 0], ['list', 0], ['unknown', 0]], choose: 0 },
|
|
117
|
-
{ context: [['unknown', 0], ['list', 0], ['unknown', 1]], choose: 0 },
|
|
118
|
-
{ context: [['unknown', 1], ['list', 0], ['unknown', 0]], choose: 0 },
|
|
119
|
-
{ context: [['unknown', 1], ['list', 0], ['unknown', 1]], choose: 0 },
|
|
120
|
-
|
|
121
|
-
{ context: [['queryable', 0], ['list', 0], ['unknown', 0]], choose: 1 },
|
|
122
|
-
{ context: [['queryable', 0], ['list', 0], ['unknown', 1]], choose: 1 },
|
|
123
|
-
{ context: [['queryable', 1], ['list', 0], ['unknown', 0]], choose: 1 },
|
|
124
|
-
{ context: [['queryable', 1], ['list', 0], ['unknown', 1]], choose: 1 },
|
|
125
|
-
|
|
126
|
-
{ context: [['unknown', 0], ['list', 0], ['queryable', 0]], choose: 2 },
|
|
127
|
-
{ context: [['unknown', 0], ['list', 0], ['queryable', 1]], choose: 2 },
|
|
128
|
-
{ context: [['unknown', 1], ['list', 0], ['queryable', 0]], choose: 2 },
|
|
129
|
-
{ context: [['unknown', 1], ['list', 0], ['queryable', 1]], choose: 2 },
|
|
130
|
-
|
|
131
|
-
{ context: [['queryable', 0], ['list', 0], ['queryable', 0]], choose: 0 },
|
|
132
|
-
{ context: [['queryable', 0], ['list', 0], ['queryable', 1]], choose: 0 },
|
|
133
|
-
{ context: [['queryable', 1], ['list', 0], ['queryable', 0]], choose: 0 },
|
|
134
|
-
{ context: [['queryable', 1], ['list', 0], ['queryable', 1]], choose: 0 },
|
|
135
|
-
]
|
|
136
|
-
},
|
|
137
87
|
bridges: [
|
|
138
88
|
{
|
|
139
89
|
id: 'thatVerb',
|
|
140
90
|
before: ['verb'],
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
91
|
+
bridge: `
|
|
92
|
+
{
|
|
93
|
+
...after[0],
|
|
94
|
+
verb: after[0],
|
|
95
|
+
that: operator,
|
|
96
|
+
generate: ['that', 'verb'],
|
|
97
|
+
localPriorities: { actLike: ["subordinatedVerb", 0] },
|
|
98
|
+
bridge_override: {
|
|
99
|
+
operator: after[0].marker,
|
|
100
|
+
bridge: '{
|
|
101
|
+
...bridge.subject,
|
|
102
|
+
postModifiers: ["conditions"],
|
|
103
|
+
modifiers: [],
|
|
104
|
+
generate: concatm("thatClause.", bridge.generate),
|
|
105
|
+
thatClause: bridge,
|
|
106
|
+
conditions: append(bridge.subject.conditions, [bridge])
|
|
107
|
+
}'
|
|
108
|
+
}
|
|
109
|
+
}`,
|
|
144
110
|
},
|
|
145
111
|
|
|
146
112
|
{
|
|
@@ -203,7 +169,16 @@ const config = {
|
|
|
203
169
|
},
|
|
204
170
|
{ id: "toAble" },
|
|
205
171
|
|
|
206
|
-
{
|
|
172
|
+
{
|
|
173
|
+
id: "be",
|
|
174
|
+
level: 0,
|
|
175
|
+
bridge: `{
|
|
176
|
+
...next(operator),
|
|
177
|
+
form: 'infinitive',
|
|
178
|
+
type: after[0]
|
|
179
|
+
}`
|
|
180
|
+
},
|
|
181
|
+
|
|
207
182
|
{ id: "briefOrWordy" },
|
|
208
183
|
|
|
209
184
|
{ id: "yesno" },
|
|
@@ -246,38 +221,6 @@ const config = {
|
|
|
246
221
|
{ id: "doesAble", level: 0, bridge: "{ ...next(operator) }" },
|
|
247
222
|
{ id: "doesAble", level: 1, bridge: "{ ...next(operator), before: before[0] }" },
|
|
248
223
|
{ id: "does", level: 0, bridge: "{ query: true, what: operator.marker, ...context, number: operator.number, object.number: operator.number }*" },
|
|
249
|
-
|
|
250
|
-
/*
|
|
251
|
-
{
|
|
252
|
-
id: 'the',
|
|
253
|
-
level: 0,
|
|
254
|
-
bridge: '{ ...after[0], focusableForPhrase: true, pullFromContext: true, concept: true, wantsValue: true, determiner: "the", modifiers: append(["determiner"], after[0].modifiers)}'
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
id: "a",
|
|
258
|
-
level: 0,
|
|
259
|
-
// bridge: "{ ...after[0], pullFromContext: false, instance: true, concept: true, number: 'one', wantsValue: true, determiner: operator, modifiers: append(['determiner'], after[0].modifiers) }"
|
|
260
|
-
bridge: "{ ...after[0], pullFromContext: false, concept: true, number: 'one', wantsValue: true, determiner: operator, modifiers: append(['determiner'], after[0].modifiers) }"
|
|
261
|
-
},
|
|
262
|
-
*/
|
|
263
|
-
/*
|
|
264
|
-
{
|
|
265
|
-
id: "theAble",
|
|
266
|
-
children: ['noun'],
|
|
267
|
-
bridge: "{ ...next(operator) }"
|
|
268
|
-
},
|
|
269
|
-
*/
|
|
270
|
-
|
|
271
|
-
// TODO make this hierarchy thing work
|
|
272
|
-
/*
|
|
273
|
-
{
|
|
274
|
-
id: "thisitthat",
|
|
275
|
-
level: 0,
|
|
276
|
-
isA: ['queryable'],
|
|
277
|
-
before: ['verby'],
|
|
278
|
-
bridge: "{ ...next(operator) }"
|
|
279
|
-
},
|
|
280
|
-
*/
|
|
281
224
|
{
|
|
282
225
|
id: "why",
|
|
283
226
|
level: 0,
|
|
@@ -287,31 +230,10 @@ const config = {
|
|
|
287
230
|
id: "reason",
|
|
288
231
|
isA: ['theAble', 'queryable'],
|
|
289
232
|
},
|
|
290
|
-
/*
|
|
291
|
-
{
|
|
292
|
-
id: "it",
|
|
293
|
-
level: 0,
|
|
294
|
-
isA: ['thisitthat'],
|
|
295
|
-
bridge: "{ ...next(operator), pullFromContext: true, unknown: true, determined: true }"
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
id: "this",
|
|
299
|
-
level: 0,
|
|
300
|
-
isA: ['thisitthat'],
|
|
301
|
-
bridge: "{ ...next(operator), unknown: true, pullFromContext: true }"
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
id: "that",
|
|
305
|
-
level: 0,
|
|
306
|
-
isA: ['thisitthat'],
|
|
307
|
-
bridge: "{ ...next(operator), unknown: true, pullFromContext: true }"
|
|
308
|
-
},
|
|
309
|
-
*/
|
|
310
233
|
],
|
|
311
234
|
words: {
|
|
312
235
|
"literals": {
|
|
313
236
|
"?": [{"id": "questionMark", "initial": "{}" }],
|
|
314
|
-
// "the": [{"id": "the", "initial": "{ modifiers: [] }" }],
|
|
315
237
|
"who": [{"id": "what", "initial": "{ modifiers: [], query: true }" }],
|
|
316
238
|
"yes": [{"id": "yesno", "initial": "{ value: true }" }],
|
|
317
239
|
"no": [{"id": "yesno", "initial": "{ value: false }" }],
|
|
@@ -320,6 +242,7 @@ const config = {
|
|
|
320
242
|
"does": [{"id": "does", "initial": "{ number: 'one' }" }],
|
|
321
243
|
"do": [{"id": "does", "initial": "{ number: 'many' }" }],
|
|
322
244
|
"is": [
|
|
245
|
+
{"id": "be", "initial": "{ form: 'infinitive' }" },
|
|
323
246
|
{"id": "is", "initial": "{ number: 'one' }" },
|
|
324
247
|
{"id": "isQuery", "initial": "{ number: 'one' }" },
|
|
325
248
|
{"id": "isEd", "initial": "{ number: 'one' }" }
|
|
@@ -347,12 +270,9 @@ const config = {
|
|
|
347
270
|
['it', 'pronoun'],
|
|
348
271
|
['this', 'pronoun'],
|
|
349
272
|
['questionMark', 'punctuation'],
|
|
350
|
-
// ['questionMark', 'isEd'],
|
|
351
273
|
['a', 'article'],
|
|
352
274
|
['the', 'article'],
|
|
353
|
-
// ['unknown', 'theAble'],
|
|
354
275
|
['theAble', 'queryable'],
|
|
355
|
-
// ['unknown', 'queryable'],
|
|
356
276
|
['it', 'queryable'],
|
|
357
277
|
['what', 'queryable'],
|
|
358
278
|
['whatAble', 'queryable'],
|
|
@@ -369,11 +289,13 @@ const config = {
|
|
|
369
289
|
{
|
|
370
290
|
where: where(),
|
|
371
291
|
notes: "handle making responses brief",
|
|
372
|
-
match: ({context, objects}) => (context.topLevel || context.isResponse) && objects.brief && !context.briefWasRun,
|
|
292
|
+
match: ({context, objects, callId}) => (context.topLevel || context.isResponse) && objects.brief && !context.briefWasRun,
|
|
373
293
|
apply: async ({context, g}) => {
|
|
374
294
|
const focussed = focus(context)
|
|
375
295
|
context.briefWasRun = true
|
|
376
|
-
|
|
296
|
+
const result = await g(focussed)
|
|
297
|
+
context.briefWasRun = false
|
|
298
|
+
return result
|
|
377
299
|
},
|
|
378
300
|
priority: -2,
|
|
379
301
|
},
|
|
@@ -393,7 +315,7 @@ const config = {
|
|
|
393
315
|
where: where(),
|
|
394
316
|
notes: "be brief or wordy",
|
|
395
317
|
match: ({context}) => context.marker == 'be',
|
|
396
|
-
apply: ({context}) => `be ${context.type
|
|
318
|
+
apply: ({context}) => `be ${context.type?.word}`,
|
|
397
319
|
},
|
|
398
320
|
/*
|
|
399
321
|
{
|
|
@@ -528,7 +450,7 @@ const config = {
|
|
|
528
450
|
return `${await gp(context.one)} ${isMany(context.one) || isMany(context.two) || isMany(context) ? "are" : "is"} ${await g(context.two)}`
|
|
529
451
|
}
|
|
530
452
|
|
|
531
|
-
|
|
453
|
+
function hasFocus(property) {
|
|
532
454
|
if (context.focusableForPhrase) {
|
|
533
455
|
return true
|
|
534
456
|
}
|
|
@@ -554,7 +476,7 @@ const config = {
|
|
|
554
476
|
} else {
|
|
555
477
|
// TODO fix this using the assumed and that whole mess. change isResponse to useValue
|
|
556
478
|
if (context.isResponse) {
|
|
557
|
-
return `${await gp(context.one, { responding: true })} ${isMany(context.one) || isMany(context.two) || isMany(context) ? "are" : "is"} ${await g(context.two)}`
|
|
479
|
+
return `${await gp(context.one, { assumed: { responding: true } })} ${isMany(context.one) || isMany(context.two) || isMany(context) ? "are" : "is"} ${await g(context.two)}`
|
|
558
480
|
} else {
|
|
559
481
|
return `${await gp(context.one)} ${isMany(context.one) || isMany(context.two) || isMany(context) ? "are" : "is"} ${await gr(context.two)}`
|
|
560
482
|
}
|
|
@@ -788,7 +710,7 @@ const config = {
|
|
|
788
710
|
],
|
|
789
711
|
};
|
|
790
712
|
|
|
791
|
-
|
|
713
|
+
function initializer({objects, config, isModule}) {
|
|
792
714
|
/* TODO add this beck in. some stuff from config needs to be here
|
|
793
715
|
config.addArgs((args) => ({
|
|
794
716
|
e: (context) => config.api.getEvaluator(args.s, args.log, context),
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"configs": [
|
|
3
3
|
"dimension and unit are concepts",
|
|
4
|
+
{
|
|
5
|
+
"apply": "({apis}) => {\n apis('properties').addHierarchyWatcher({\n match: ({parentId}) => parentId == 'unit',\n apply: ({config, childId, parent}) => {\n config.updateBridge(childId, ({ bridge }) => {\n // console.log(JSON.stringify(childId, null, 2))\n // console.log(JSON.stringify(parentId, null, 2))\n // debugger\n // if (!bridge) {\n // debugger\n // return\n // }\n if (!bridge.init) {\n bridge.init = {}\n }\n // bridge.init['dimension'] = parent.object.marker\n bridge.init['dimension'] = parent.object.value\n })\n }\n })\n }"
|
|
6
|
+
},
|
|
4
7
|
{
|
|
5
8
|
"name": "dimension",
|
|
6
9
|
"operators": [
|
|
@@ -47,10 +50,9 @@
|
|
|
47
50
|
],
|
|
48
51
|
"bridges": [
|
|
49
52
|
{
|
|
50
|
-
"where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:
|
|
53
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:82",
|
|
51
54
|
"id": "dimension",
|
|
52
55
|
"bridge": "{ ...next(operator) }",
|
|
53
|
-
"isA": [],
|
|
54
56
|
"generatorpr": {}
|
|
55
57
|
},
|
|
56
58
|
{
|
|
@@ -65,7 +67,7 @@
|
|
|
65
67
|
"id": "amount"
|
|
66
68
|
},
|
|
67
69
|
{
|
|
68
|
-
"where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:
|
|
70
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:107",
|
|
69
71
|
"id": "degree",
|
|
70
72
|
"words": [
|
|
71
73
|
{
|
|
@@ -82,10 +84,10 @@
|
|
|
82
84
|
{
|
|
83
85
|
"id": "amountOfDimension",
|
|
84
86
|
"convolution": true,
|
|
85
|
-
"bridge": "{ marker: operator('dimension'), unit: after[0], value: before[0].value, amount: before[0] }"
|
|
87
|
+
"bridge": "{ marker: next(catch(operator(after[0].dimension), operator('dimension'))), dead: true, unit: after[0], value: before[0].value, amount: before[0] }"
|
|
86
88
|
},
|
|
87
89
|
{
|
|
88
|
-
"where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:
|
|
90
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:121",
|
|
89
91
|
"id": "convertToUnits",
|
|
90
92
|
"bridge": "{ ...next(operator), from: before[0], to: after[0] }",
|
|
91
93
|
"isA": [
|
|
@@ -1135,7 +1137,7 @@
|
|
|
1135
1137
|
"text": "dimension and unit",
|
|
1136
1138
|
"range": {
|
|
1137
1139
|
"start": 0,
|
|
1138
|
-
"end":
|
|
1140
|
+
"end": 17
|
|
1139
1141
|
},
|
|
1140
1142
|
"types": [
|
|
1141
1143
|
"list",
|
|
@@ -1546,6 +1548,9 @@
|
|
|
1546
1548
|
"query": "dimension and unit are concepts"
|
|
1547
1549
|
}
|
|
1548
1550
|
},
|
|
1551
|
+
{
|
|
1552
|
+
"apply": "({apis}) => {\n apis('properties').addHierarchyWatcher({\n match: ({parentId}) => parentId == 'unit',\n apply: ({config, childId, parent}) => {\n config.updateBridge(childId, ({ bridge }) => {\n // console.log(JSON.stringify(childId, null, 2))\n // console.log(JSON.stringify(parentId, null, 2))\n // debugger\n // if (!bridge) {\n // debugger\n // return\n // }\n if (!bridge.init) {\n bridge.init = {}\n }\n // bridge.init['dimension'] = parent.object.marker\n bridge.init['dimension'] = parent.object.value\n })\n }\n })\n }"
|
|
1553
|
+
},
|
|
1549
1554
|
{
|
|
1550
1555
|
"extraConfig": true,
|
|
1551
1556
|
"name": "dimension",
|
|
@@ -1587,15 +1592,14 @@
|
|
|
1587
1592
|
],
|
|
1588
1593
|
"generators": [
|
|
1589
1594
|
{
|
|
1590
|
-
"where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:
|
|
1595
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:75"
|
|
1591
1596
|
}
|
|
1592
1597
|
],
|
|
1593
1598
|
"bridges": [
|
|
1594
1599
|
{
|
|
1595
|
-
"where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:
|
|
1600
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:82",
|
|
1596
1601
|
"id": "dimension",
|
|
1597
1602
|
"bridge": "{ ...next(operator) }",
|
|
1598
|
-
"isA": [],
|
|
1599
1603
|
"generatorpr": {}
|
|
1600
1604
|
},
|
|
1601
1605
|
{
|
|
@@ -1610,7 +1614,7 @@
|
|
|
1610
1614
|
"id": "amount"
|
|
1611
1615
|
},
|
|
1612
1616
|
{
|
|
1613
|
-
"where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:
|
|
1617
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:107",
|
|
1614
1618
|
"id": "degree",
|
|
1615
1619
|
"words": [
|
|
1616
1620
|
{
|
|
@@ -1626,10 +1630,10 @@
|
|
|
1626
1630
|
{
|
|
1627
1631
|
"id": "amountOfDimension",
|
|
1628
1632
|
"convolution": true,
|
|
1629
|
-
"bridge": "{ marker: operator('dimension'), unit: after[0], value: before[0].value, amount: before[0] }"
|
|
1633
|
+
"bridge": "{ marker: next(catch(operator(after[0].dimension), operator('dimension'))), dead: true, unit: after[0], value: before[0].value, amount: before[0] }"
|
|
1630
1634
|
},
|
|
1631
1635
|
{
|
|
1632
|
-
"where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:
|
|
1636
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:121",
|
|
1633
1637
|
"id": "convertToUnits",
|
|
1634
1638
|
"bridge": "{ ...next(operator), from: before[0], to: after[0] }",
|
|
1635
1639
|
"isA": [
|
package/common/dimension.js
CHANGED
|
@@ -50,8 +50,6 @@ class API {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
const api = new API()
|
|
54
|
-
|
|
55
53
|
const config = {
|
|
56
54
|
name: 'dimension',
|
|
57
55
|
operators: [
|
|
@@ -84,7 +82,6 @@ const config = {
|
|
|
84
82
|
where: where(),
|
|
85
83
|
id: "dimension",
|
|
86
84
|
bridge: "{ ...next(operator) }",
|
|
87
|
-
isA: [],
|
|
88
85
|
generatorpr: {
|
|
89
86
|
match: ({context}) => context.amount,
|
|
90
87
|
apply: async ({context, gp, gr}) => `${await gr(context.amount)} ${await gp(context.unit)}`,
|
|
@@ -117,7 +114,8 @@ const config = {
|
|
|
117
114
|
{
|
|
118
115
|
id: "amountOfDimension",
|
|
119
116
|
convolution: true,
|
|
120
|
-
bridge: "{ marker: operator('dimension'), unit: after[0], value: before[0].value, amount: before[0] }"
|
|
117
|
+
bridge: "{ marker: next(catch(operator(after[0].dimension), operator('dimension'))), dead: true, unit: after[0], value: before[0].value, amount: before[0] }"
|
|
118
|
+
// bridge: "{ marker: operator('dimension'), unit: after[0], value: before[0].value, amount: before[0] }"
|
|
121
119
|
},
|
|
122
120
|
{
|
|
123
121
|
where: where(),
|
|
@@ -180,6 +178,27 @@ const config = {
|
|
|
180
178
|
const template = {
|
|
181
179
|
configs: [
|
|
182
180
|
"dimension and unit are concepts",
|
|
181
|
+
({apis}) => {
|
|
182
|
+
apis('properties').addHierarchyWatcher({
|
|
183
|
+
match: ({parentId}) => parentId == 'unit',
|
|
184
|
+
apply: ({config, childId, parent}) => {
|
|
185
|
+
config.updateBridge(childId, ({ bridge }) => {
|
|
186
|
+
// console.log(JSON.stringify(childId, null, 2))
|
|
187
|
+
// console.log(JSON.stringify(parentId, null, 2))
|
|
188
|
+
// debugger
|
|
189
|
+
// if (!bridge) {
|
|
190
|
+
// debugger
|
|
191
|
+
// return
|
|
192
|
+
// }
|
|
193
|
+
if (!bridge.init) {
|
|
194
|
+
bridge.init = {}
|
|
195
|
+
}
|
|
196
|
+
// bridge.init['dimension'] = parent.object.marker
|
|
197
|
+
bridge.init['dimension'] = parent.object.value
|
|
198
|
+
})
|
|
199
|
+
}
|
|
200
|
+
})
|
|
201
|
+
},
|
|
183
202
|
config,
|
|
184
203
|
],
|
|
185
204
|
}
|