ekms 9.8.0 → 9.9.0-beta.1
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/actions.instance.json +12 -10
- package/common/actions.js +14 -12
- package/common/angle.instance.json +37 -17
- package/common/animals.instance.json +54 -28
- package/common/askfor.instance.json +89 -192
- package/common/askfor.js +49 -12
- package/common/asking.js +13 -5
- package/common/avatar.js +3 -3
- package/common/can.instance.json +32 -20
- package/common/can.js +2 -2
- package/common/colors.instance.json +44 -16
- package/common/colors.js +1 -1
- package/common/comparable.instance.json +25 -22
- package/common/compass.instance.json +9 -3
- package/common/compass.js +1 -1
- package/common/concept.instance.json +14 -6
- package/common/concept.js +2 -0
- package/common/conjunction.js +20 -12
- package/common/control.js +10 -18
- package/common/countable.js +4 -3
- package/common/crew.instance.json +95 -27
- package/common/dateTimeSelectors.instance.json +4 -4
- package/common/dateTimeSelectors.js +4 -7
- package/common/dates.instance.json +52 -28
- package/common/dates.js +16 -11
- package/common/debug.instance.json +52 -0
- package/common/debug.js +52 -0
- package/common/debug.test.json +1 -0
- package/common/dialogues.js +126 -70
- package/common/dimension.instance.json +259 -492
- package/common/dimension.js +72 -12
- package/common/drone.instance.json +441 -84
- package/common/drone.js +57 -56
- package/common/drone_v1.instance.json +36 -12
- package/common/drone_v1.js +20 -15
- package/common/edible.instance.json +96 -32
- package/common/emotions.instance.json +15 -1
- package/common/evaluate.js +10 -13
- package/common/fastfood.instance.json +282 -100
- package/common/fastfood.js +30 -15
- package/common/formulas.instance.json +162 -24
- package/common/formulas.js +18 -9
- package/common/gdefaults.js +20 -96
- package/common/helpers/concept.js +2 -9
- package/common/helpers/conjunction.js +11 -1
- package/common/helpers/dialogues.js +48 -24
- package/common/helpers/gdefaults.js +15 -5
- package/common/helpers/properties.js +132 -326
- package/common/helpers.js +28 -58
- package/common/hierarchy.js +71 -41
- package/common/kirk.instance.json +3 -1
- package/common/latin.instance.json +14 -14
- package/common/latin.js +7 -7
- package/common/length.instance.json +331 -61
- package/common/linear_orderings.instance.json +1 -0
- package/common/linear_orderings.js +90 -0
- package/common/linear_orderings.test.json +1 -0
- package/common/math.instance.json +144 -5
- package/common/math.js +18 -7
- package/common/menus.instance.json +29 -11
- package/common/menus.js +8 -5
- package/common/meta.js +14 -13
- package/common/nameable.js +9 -5
- package/common/numbers.instance.json +8 -3
- package/common/numbers.js +59 -35
- package/common/ordering.instance.json +53 -4
- package/common/ordinals.js +25 -25
- package/common/people.instance.json +66 -12
- package/common/percentages.js +4 -2
- package/common/pipboy.instance.json +89 -44
- package/common/pipboy.js +21 -14
- package/common/pokemon.instance.json +39 -13
- package/common/pressure.instance.json +20 -6
- package/common/properties.instance.json +2648 -501
- package/common/properties.js +561 -82
- package/common/punctuation.js +1 -0
- package/common/rates.instance.json +2 -2
- package/common/rates.js +3 -3
- package/common/reminders.instance.json +16 -0
- package/common/reminders.js +24 -20
- package/common/reports.instance.json +11 -12
- package/common/reports.js +12 -12
- package/common/scorekeeper.js +20 -10
- package/common/sdefaults.js +30 -9
- package/common/spock.instance.json +3 -1
- package/common/stm.js +16 -21
- package/common/temperature.instance.json +40 -11
- package/common/testing.js +2 -2
- package/common/time.instance.json +149 -47
- package/common/time.js +9 -8
- package/common/ui.instance.json +4 -2
- package/common/ui.js +5 -5
- package/common/weight.instance.json +113 -21
- package/common/weight.js +5 -1
- package/common/words.js +113 -2
- package/common/wp.instance.json +125 -18
- package/common/wp.js +6 -2
- package/main.js +2 -0
- package/package.json +10 -3
package/common/meta.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { knowledgeModule, ensureTestFile, where, unflatten, flattens } = require('./runtime').theprogrammablemind
|
|
1
|
+
const { knowledgeModule, ensureTestFile, where, unflatten, flattens, debug } = require('./runtime').theprogrammablemind
|
|
2
2
|
const { defaultContextCheck } = require('./helpers')
|
|
3
3
|
const _ = require('lodash')
|
|
4
4
|
const gdefaults = require('./gdefaults.js')
|
|
@@ -78,7 +78,7 @@ const config = {
|
|
|
78
78
|
id: 'synonymOfWord',
|
|
79
79
|
operator: "((synonym/*) [synonymOfWord|of] (word))",
|
|
80
80
|
bridge: "{ ...next(operator), word: after[0] }",
|
|
81
|
-
|
|
81
|
+
semantic: ({context}) => {
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
*/
|
|
@@ -192,10 +192,10 @@ const config = {
|
|
|
192
192
|
{
|
|
193
193
|
where: where(),
|
|
194
194
|
match: ({context}) => context.marker == 'orList',
|
|
195
|
-
apply: async ({context,
|
|
195
|
+
apply: async ({context, e}) => {
|
|
196
196
|
const response = []
|
|
197
197
|
for (const value of context.value) {
|
|
198
|
-
response.push(await
|
|
198
|
+
response.push(await e(value, where()))
|
|
199
199
|
}
|
|
200
200
|
context.evalue = {
|
|
201
201
|
marker: 'orList',
|
|
@@ -219,7 +219,7 @@ const config = {
|
|
|
219
219
|
function invertMappings(mappings) {
|
|
220
220
|
return mappings.map( ({ from, to }) => { return { to: from, from: to } } )
|
|
221
221
|
}
|
|
222
|
-
return async ({context,
|
|
222
|
+
return async ({context, e, config}) => {
|
|
223
223
|
DEFINITIONs = _.cloneDeep(DEFINITIONs)
|
|
224
224
|
//const mappings = mappingss[0]
|
|
225
225
|
let toPrimes = []
|
|
@@ -229,7 +229,7 @@ const config = {
|
|
|
229
229
|
}
|
|
230
230
|
// next move add debug arg to s and g
|
|
231
231
|
TO.query = true
|
|
232
|
-
toPrimes.push([await
|
|
232
|
+
toPrimes.push([await e(TO, where()), mappings])
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
let hasResponse = false
|
|
@@ -323,12 +323,12 @@ const config = {
|
|
|
323
323
|
return ({context}) => context.evalue == defContext.from.value && !context.query && !context.objects
|
|
324
324
|
}
|
|
325
325
|
function apply(mappings, TO) {
|
|
326
|
-
return async ({context,
|
|
326
|
+
return async ({context, e}) => {
|
|
327
327
|
TO = _.cloneDeep(TO)
|
|
328
328
|
for (const { from, to } of mappings) {
|
|
329
329
|
hashIndexesSet(TO, to, hashIndexesGet(context, from))
|
|
330
330
|
}
|
|
331
|
-
toPrime = await
|
|
331
|
+
toPrime = await e(TO, where())
|
|
332
332
|
context.result = toPrime.result
|
|
333
333
|
}
|
|
334
334
|
}
|
|
@@ -349,14 +349,15 @@ const config = {
|
|
|
349
349
|
|
|
350
350
|
// setup the read semantic
|
|
351
351
|
{
|
|
352
|
+
// TODO change this disable to callOnce
|
|
352
353
|
function matchByMarker(defContext) {
|
|
353
|
-
return ({context, uuid}) => context.marker == defContext.from.marker &&
|
|
354
|
+
return ({context, uuid}) => context.marker == defContext.from.marker && !context[`disable${uuid}`]
|
|
354
355
|
}
|
|
355
356
|
function matchByValue(defContext) {
|
|
356
|
-
return ({context, uuid}) => context.value == defContext.from.value &&
|
|
357
|
+
return ({context, uuid, stack}) => context.value == defContext.from.value && !context[`disable${uuid}`]
|
|
357
358
|
}
|
|
358
359
|
function apply(mappings, TO) {
|
|
359
|
-
return async ({uuid, context,
|
|
360
|
+
return async ({uuid, context, e, g, config}) => {
|
|
360
361
|
TO = _.cloneDeep(TO)
|
|
361
362
|
for (const { from, to } of mappings) {
|
|
362
363
|
hashIndexesSet(TO, to, hashIndexesGet(context, from))
|
|
@@ -366,10 +367,10 @@ const config = {
|
|
|
366
367
|
if (context.query) {
|
|
367
368
|
TO.query = context.query
|
|
368
369
|
} else {
|
|
369
|
-
TO.
|
|
370
|
+
TO.metaDefinition = true
|
|
370
371
|
}
|
|
371
372
|
TO[`disable${uuid}`] = true
|
|
372
|
-
toPrime = await
|
|
373
|
+
toPrime = await e(TO, where())
|
|
373
374
|
if (context.query) {
|
|
374
375
|
if (toPrime.evalue) {
|
|
375
376
|
context.evalue = toPrime.evalue
|
package/common/nameable.js
CHANGED
|
@@ -19,7 +19,7 @@ class API {
|
|
|
19
19
|
context.namespaced.nameable ??= {}
|
|
20
20
|
context.namespaced.nameable.names ??= []
|
|
21
21
|
context.namespaced.nameable.names.push(name)
|
|
22
|
-
this.args.config.addWord(name, { id: context.marker, initial: `{ value: "${name}", pullFromContext: true, nameable_named: true,
|
|
22
|
+
this.args.config.addWord(name, { id: context.marker, initial: `{ value: "${name}", pullFromContext: true, nameable_named: true, isInstance: ${context.isInstance ? 'true' : 'false'} }` })
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
// used by mongo km
|
|
@@ -88,11 +88,12 @@ const config = {
|
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
id: 'getNamesByType',
|
|
91
|
+
where: where(),
|
|
91
92
|
scope: "testing",
|
|
92
93
|
isA: ['verb'],
|
|
93
94
|
bridge: "{ ...next(operator), type: after[0] }",
|
|
94
95
|
semantic: async ({context, api}) => {
|
|
95
|
-
context.
|
|
96
|
+
context.evalue = api.getNamesByType(context.type.value).join(" ")
|
|
96
97
|
context.isResponse = true
|
|
97
98
|
}
|
|
98
99
|
},
|
|
@@ -113,6 +114,7 @@ const config = {
|
|
|
113
114
|
},
|
|
114
115
|
{
|
|
115
116
|
id: 'call',
|
|
117
|
+
where: where(),
|
|
116
118
|
isA: ['verb'],
|
|
117
119
|
words: englishHelpers.conjugateVerb('call'),
|
|
118
120
|
bridge: `{
|
|
@@ -124,7 +126,7 @@ const config = {
|
|
|
124
126
|
`,
|
|
125
127
|
// generatorp: async ({context, g, gs}) => `call ${await g(context.nameable)} ${await gs(context.name)}`,
|
|
126
128
|
semantic: async ({config, context, api, e, verbatim, g}) => {
|
|
127
|
-
const nameable = (await e(context.nameable))?.evalue
|
|
129
|
+
const nameable = (await e(context.nameable, where()))?.evalue
|
|
128
130
|
if (!nameable) {
|
|
129
131
|
verbatim(`${await g(context.nameable)} is not known`)
|
|
130
132
|
return
|
|
@@ -156,7 +158,7 @@ const config = {
|
|
|
156
158
|
semantics: [
|
|
157
159
|
{
|
|
158
160
|
where: where(),
|
|
159
|
-
match: ({context}) => context.marker == 'mentions' && context.
|
|
161
|
+
match: ({context}) => context.marker == 'mentions' && context.args?.context?.nameable_named,
|
|
160
162
|
apply: async ({callId, _continue, toList, context, kms, e, log, retry}) => {
|
|
161
163
|
context.args.condition ??= () => true
|
|
162
164
|
const oldCondition = context.args.condition
|
|
@@ -188,7 +190,9 @@ knowledgeModule( {
|
|
|
188
190
|
context: [
|
|
189
191
|
defaultContextCheck({ extra: ['pullFromContext'] }),
|
|
190
192
|
],
|
|
191
|
-
objects: [
|
|
193
|
+
objects: [
|
|
194
|
+
{ km: 'stm' }
|
|
195
|
+
],
|
|
192
196
|
},
|
|
193
197
|
include: {
|
|
194
198
|
words: [ "peter james chunkington", "banana" ],
|
|
@@ -23,8 +23,11 @@
|
|
|
23
23
|
"trace": "undefined",
|
|
24
24
|
"contexts": [
|
|
25
25
|
{
|
|
26
|
-
"
|
|
26
|
+
"isInstance": true,
|
|
27
27
|
"value": 10.2345,
|
|
28
|
+
"rangeableWith": [
|
|
29
|
+
"number"
|
|
30
|
+
],
|
|
28
31
|
"text": "10.2345",
|
|
29
32
|
"marker": "number",
|
|
30
33
|
"word": "10.2345",
|
|
@@ -35,8 +38,7 @@
|
|
|
35
38
|
"dead": true,
|
|
36
39
|
"level": 1,
|
|
37
40
|
"context_index": 1,
|
|
38
|
-
"topLevel": true
|
|
39
|
-
"context_id": 2
|
|
41
|
+
"topLevel": true
|
|
40
42
|
}
|
|
41
43
|
],
|
|
42
44
|
"generated": [
|
|
@@ -89,6 +91,9 @@
|
|
|
89
91
|
}
|
|
90
92
|
],
|
|
91
93
|
"learned_contextual_priorities": [],
|
|
94
|
+
"explain_associations_details": [
|
|
95
|
+
null
|
|
96
|
+
],
|
|
92
97
|
"query": "10.2345",
|
|
93
98
|
"skipSemantics": true,
|
|
94
99
|
"key": {
|
package/common/numbers.js
CHANGED
|
@@ -4,6 +4,7 @@ const numbers_tests = require('./numbers.test.json')
|
|
|
4
4
|
const instance = require('./numbers.instance.json')
|
|
5
5
|
const gdefaults = require('./gdefaults')
|
|
6
6
|
const sdefaults = require('./sdefaults')
|
|
7
|
+
const linear_orderings = require('./linear_orderings')
|
|
7
8
|
|
|
8
9
|
/*
|
|
9
10
|
TODO
|
|
@@ -20,61 +21,57 @@ const config = {
|
|
|
20
21
|
"([integer])",
|
|
21
22
|
],
|
|
22
23
|
bridges: [
|
|
23
|
-
/*
|
|
24
|
-
{
|
|
25
|
-
id: "testNumber",
|
|
26
|
-
scope: 'testing',
|
|
27
|
-
},
|
|
28
|
-
*/
|
|
29
24
|
{
|
|
30
25
|
id: "number",
|
|
31
|
-
bridge: "{
|
|
26
|
+
bridge: "{ isInstance: false, ...next(operator) }",
|
|
27
|
+
isA: ['linearlyOrdered'],
|
|
32
28
|
},
|
|
33
29
|
{
|
|
34
30
|
id: "integer",
|
|
35
31
|
isA: ['number'],
|
|
36
|
-
|
|
32
|
+
initial: { rangeableWith: ['number'] },
|
|
33
|
+
bridge: "{ isInstance: false, ...next(operator) }"
|
|
37
34
|
},
|
|
38
35
|
],
|
|
39
36
|
words: {
|
|
40
37
|
"literals": {
|
|
41
|
-
"one": [{"id": "integer", "initial": "{ value: 1,
|
|
42
|
-
"ones": [{"id": "integer", "initial": "{ value: 1, integer: 'many',
|
|
43
|
-
"two": [{"id": "integer", "initial": "{ value: 2 ,
|
|
44
|
-
"twos": [{"id": "integer", "initial": "{ value: 2 , integer: 'many',
|
|
45
|
-
"three": [{"id": "integer", "initial": "{ value: 3,
|
|
46
|
-
"threes": [{"id": "integer", "initial": "{ value: 3, integer: 'many',
|
|
47
|
-
"four": [{"id": "integer", "initial": "{ value: 4,
|
|
48
|
-
"fours": [{"id": "integer", "initial": "{ value: 4, integer: 'many',
|
|
49
|
-
"five": [{"id": "integer", "initial": "{ value: 5,
|
|
50
|
-
"fives": [{"id": "integer", "initial": "{ value: 5, integer: 'many',
|
|
51
|
-
"six": [{"id": "integer", "initial": "{ value: 6,
|
|
52
|
-
"sixes": [{"id": "integer", "initial": "{ value: 6, integer: 'many',
|
|
53
|
-
"seven": [{"id": "integer", "initial": "{ value: 7,
|
|
54
|
-
"sevens": [{"id": "integer", "initial": "{ value: 7, integer: 'many',
|
|
55
|
-
"eight": [{"id": "integer", "initial": "{ value: 8,
|
|
56
|
-
"eights": [{"id": "integer", "initial": "{ value: 8, integer: 'many',
|
|
57
|
-
"nine": [{"id": "integer", "initial": "{ value: 9,
|
|
58
|
-
"nines": [{"id": "integer", "initial": "{ value: 9, integer: 'many',
|
|
59
|
-
"ten": [{"id": "integer", "initial": "{ value: 10,
|
|
60
|
-
"tens": [{"id": "integer", "initial": "{ value: 10, integer: 'many',
|
|
61
|
-
"pi": [{"id": "integer", "initial": { value: 3.1415926, integer: 'many',
|
|
38
|
+
"one": [{"id": "integer", "initial": "{ value: 1, isInstance: true, rangeableWith: ['number'] }" }],
|
|
39
|
+
"ones": [{"id": "integer", "initial": "{ value: 1, integer: 'many', isInstance: true, rangeableWith: ['number'] }" }],
|
|
40
|
+
"two": [{"id": "integer", "initial": "{ value: 2 , isInstance: true, rangeableWith: ['number'] }" }],
|
|
41
|
+
"twos": [{"id": "integer", "initial": "{ value: 2 , integer: 'many', isInstance: true, rangeableWith: ['number'] }" }],
|
|
42
|
+
"three": [{"id": "integer", "initial": "{ value: 3, isInstance: true, rangeableWith: ['number'] }" }],
|
|
43
|
+
"threes": [{"id": "integer", "initial": "{ value: 3, integer: 'many', isInstance: true, rangeableWith: ['number'] }" }],
|
|
44
|
+
"four": [{"id": "integer", "initial": "{ value: 4, isInstance: true, rangeableWith: ['number'] }" }],
|
|
45
|
+
"fours": [{"id": "integer", "initial": "{ value: 4, integer: 'many', isInstance: true, rangeableWith: ['number'] }" }],
|
|
46
|
+
"five": [{"id": "integer", "initial": "{ value: 5, isInstance: true, rangeableWith: ['number'] }" }],
|
|
47
|
+
"fives": [{"id": "integer", "initial": "{ value: 5, integer: 'many', isInstance: true, rangeableWith: ['number'] }" }],
|
|
48
|
+
"six": [{"id": "integer", "initial": "{ value: 6, isInstance: true, rangeableWith: ['number'] }" }],
|
|
49
|
+
"sixes": [{"id": "integer", "initial": "{ value: 6, integer: 'many', isInstance: true, rangeableWith: ['number'] }" }],
|
|
50
|
+
"seven": [{"id": "integer", "initial": "{ value: 7, isInstance: true, rangeableWith: ['number'] }" }],
|
|
51
|
+
"sevens": [{"id": "integer", "initial": "{ value: 7, integer: 'many', isInstance: true, rangeableWith: ['number'] }" }],
|
|
52
|
+
"eight": [{"id": "integer", "initial": "{ value: 8, isInstance: true, rangeableWith: ['number'] }" }],
|
|
53
|
+
"eights": [{"id": "integer", "initial": "{ value: 8, integer: 'many', isInstance: true, rangeableWith: ['number'] }" }],
|
|
54
|
+
"nine": [{"id": "integer", "initial": "{ value: 9, isInstance: true, rangeableWith: ['number'] }" }],
|
|
55
|
+
"nines": [{"id": "integer", "initial": "{ value: 9, integer: 'many', isInstance: true, rangeableWith: ['number'] }" }],
|
|
56
|
+
"ten": [{"id": "integer", "initial": "{ value: 10, isInstance: true, rangeableWith: ['number'] }" }],
|
|
57
|
+
"tens": [{"id": "integer", "initial": "{ value: 10, integer: 'many', isInstance: true, rangeableWith: ['number'] }" }],
|
|
58
|
+
"pi": [{"id": "integer", "initial": { value: 3.1415926, integer: 'many', isInstance: true, rangeableWith: ['number'] } }],
|
|
62
59
|
},
|
|
63
60
|
patterns: [
|
|
64
61
|
{
|
|
65
62
|
pattern: [{ type: 'digit' }, { repeat: true }],
|
|
66
63
|
allow_partial_matches: false,
|
|
67
|
-
defs: [{id: "integer", uuid: '1', initial: "{ value: int(text),
|
|
64
|
+
defs: [{id: "integer", uuid: '1', initial: "{ value: int(text), isInstance: true, rangeableWith: ['number'] }" }]
|
|
68
65
|
},
|
|
69
66
|
{
|
|
70
67
|
pattern: [{ type: 'digit' }, { repeat: true }, '.', { type: 'digit' }, { repeat: true }],
|
|
71
68
|
allow_partial_matches: false,
|
|
72
|
-
defs: [{id: "number", uuid: '1', initial: "{ value: float(text),
|
|
69
|
+
defs: [{id: "number", uuid: '1', initial: "{ value: float(text), isInstance: true, rangeableWith: ['number'] }" }]
|
|
73
70
|
},
|
|
74
71
|
{
|
|
75
72
|
pattern: ['.', { type: 'digit' }, { repeat: true }],
|
|
76
73
|
allow_partial_matches: false,
|
|
77
|
-
defs: [{id: "number", uuid: '1', initial: "{ value: float(text),
|
|
74
|
+
defs: [{id: "number", uuid: '1', initial: "{ value: float(text), isInstance: true, rangeableWith: ['number'] }" }]
|
|
78
75
|
},
|
|
79
76
|
],
|
|
80
77
|
},
|
|
@@ -114,6 +111,33 @@ const config = {
|
|
|
114
111
|
],
|
|
115
112
|
|
|
116
113
|
semantics: [
|
|
114
|
+
{
|
|
115
|
+
where: where(),
|
|
116
|
+
match: ({context, callId, isA, toFinalValue}) => {
|
|
117
|
+
const left = toFinalValue(context.left)
|
|
118
|
+
const right = toFinalValue(context.right)
|
|
119
|
+
return context.marker == 'linearlyOrderedCompare' && isA(context.left, ['number', 'mathematicalExpression']) && isA(context.right, ['number', 'mathematicalExpression'])
|
|
120
|
+
},
|
|
121
|
+
apply: ({context, callId, toFinalValue, resolveEvaluate}) => {
|
|
122
|
+
const { left, right } = context
|
|
123
|
+
const l = toFinalValue(left)
|
|
124
|
+
const r = toFinalValue(right)
|
|
125
|
+
if (l == r) {
|
|
126
|
+
resolveEvaluate(context, '==')
|
|
127
|
+
} else if (l < r) {
|
|
128
|
+
resolveEvaluate(context, '<')
|
|
129
|
+
} else if (r > l) {
|
|
130
|
+
resolveEvaluate(context, '>')
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
where: where(),
|
|
136
|
+
match: ({context, debug, isA}) => context.marker == 'unify' && context.terms.every((term) => term.isInstance && isA(term, 'number')),
|
|
137
|
+
apply: ({context, resolveEvaluate}) => {
|
|
138
|
+
resolveEvaluate(context, context.terms[0].value == context.terms[1].value)
|
|
139
|
+
}
|
|
140
|
+
},
|
|
117
141
|
],
|
|
118
142
|
};
|
|
119
143
|
|
|
@@ -125,7 +149,7 @@ const template = {
|
|
|
125
149
|
|
|
126
150
|
knowledgeModule( {
|
|
127
151
|
config,
|
|
128
|
-
includes: [gdefaults, sdefaults],
|
|
152
|
+
includes: [linear_orderings, gdefaults, sdefaults],
|
|
129
153
|
|
|
130
154
|
instance,
|
|
131
155
|
template,
|
|
@@ -137,8 +161,8 @@ knowledgeModule( {
|
|
|
137
161
|
contents: numbers_tests,
|
|
138
162
|
checks: {
|
|
139
163
|
context: [
|
|
140
|
-
defaultContextCheck({ marker: 'number', exported: true, extra: ['
|
|
141
|
-
defaultContextCheck({ match: ({isA, context}) => isA(context.marker, 'integer'), exported: true, extra: ['
|
|
164
|
+
defaultContextCheck({ marker: 'number', exported: true, extra: ['isInstance'] }),
|
|
165
|
+
defaultContextCheck({ match: ({isA, context}) => isA(context.marker, 'integer'), exported: true, extra: ['isInstance'] }),
|
|
142
166
|
defaultContextCheck()
|
|
143
167
|
],
|
|
144
168
|
}
|
|
@@ -203,8 +203,7 @@
|
|
|
203
203
|
"types": [
|
|
204
204
|
"unknown"
|
|
205
205
|
],
|
|
206
|
-
"level": 0
|
|
207
|
-
"evaluate": false
|
|
206
|
+
"level": 0
|
|
208
207
|
},
|
|
209
208
|
"two": {
|
|
210
209
|
"marker": "xfx",
|
|
@@ -288,7 +287,6 @@
|
|
|
288
287
|
"level": 2,
|
|
289
288
|
"context_index": 1,
|
|
290
289
|
"topLevel": true,
|
|
291
|
-
"context_id": 2,
|
|
292
290
|
"touchedBy": [
|
|
293
291
|
"ordering#call2"
|
|
294
292
|
]
|
|
@@ -779,6 +777,9 @@
|
|
|
779
777
|
}
|
|
780
778
|
],
|
|
781
779
|
"learned_contextual_priorities": [],
|
|
780
|
+
"explain_associations_details": [
|
|
781
|
+
null
|
|
782
|
+
],
|
|
782
783
|
"query": "wants is xfx between wanter and wantee",
|
|
783
784
|
"key": {
|
|
784
785
|
"query": "wants is xfx between wanter and wantee"
|
|
@@ -1361,6 +1362,23 @@
|
|
|
1361
1362
|
],
|
|
1362
1363
|
"level": 0
|
|
1363
1364
|
},
|
|
1365
|
+
"relationBacked": false,
|
|
1366
|
+
"orderingArgs": {
|
|
1367
|
+
"name": "preference",
|
|
1368
|
+
"marker": "like",
|
|
1369
|
+
"object": "liker",
|
|
1370
|
+
"category": "likee"
|
|
1371
|
+
},
|
|
1372
|
+
"relationArgs": [
|
|
1373
|
+
{
|
|
1374
|
+
"tag": "liker",
|
|
1375
|
+
"id": "object"
|
|
1376
|
+
},
|
|
1377
|
+
{
|
|
1378
|
+
"tag": "likee",
|
|
1379
|
+
"id": "object"
|
|
1380
|
+
}
|
|
1381
|
+
],
|
|
1364
1382
|
"operator": {
|
|
1365
1383
|
"value": "like",
|
|
1366
1384
|
"isVerb": true,
|
|
@@ -1449,6 +1467,23 @@
|
|
|
1449
1467
|
],
|
|
1450
1468
|
"level": 0
|
|
1451
1469
|
},
|
|
1470
|
+
"relationBacked": false,
|
|
1471
|
+
"orderingArgs": {
|
|
1472
|
+
"name": "preference",
|
|
1473
|
+
"marker": "love",
|
|
1474
|
+
"object": "lover",
|
|
1475
|
+
"category": "lovee"
|
|
1476
|
+
},
|
|
1477
|
+
"relationArgs": [
|
|
1478
|
+
{
|
|
1479
|
+
"tag": "lover",
|
|
1480
|
+
"id": "object"
|
|
1481
|
+
},
|
|
1482
|
+
{
|
|
1483
|
+
"tag": "lovee",
|
|
1484
|
+
"id": "object"
|
|
1485
|
+
}
|
|
1486
|
+
],
|
|
1452
1487
|
"operator": {
|
|
1453
1488
|
"value": "love",
|
|
1454
1489
|
"isVerb": true,
|
|
@@ -1542,6 +1577,18 @@
|
|
|
1542
1577
|
],
|
|
1543
1578
|
"level": 0
|
|
1544
1579
|
},
|
|
1580
|
+
"relationBacked": false,
|
|
1581
|
+
"orderingArgs": {},
|
|
1582
|
+
"relationArgs": [
|
|
1583
|
+
{
|
|
1584
|
+
"tag": "wanter",
|
|
1585
|
+
"id": "object"
|
|
1586
|
+
},
|
|
1587
|
+
{
|
|
1588
|
+
"tag": "wantee",
|
|
1589
|
+
"id": "object"
|
|
1590
|
+
}
|
|
1591
|
+
],
|
|
1545
1592
|
"operator": {
|
|
1546
1593
|
"value": "want",
|
|
1547
1594
|
"text": "wants",
|
|
@@ -1585,7 +1632,6 @@
|
|
|
1585
1632
|
"level": 1,
|
|
1586
1633
|
"context_index": 1,
|
|
1587
1634
|
"topLevel": true,
|
|
1588
|
-
"context_id": 2,
|
|
1589
1635
|
"touchedBy": [
|
|
1590
1636
|
"ordering#call2"
|
|
1591
1637
|
]
|
|
@@ -2946,6 +2992,9 @@
|
|
|
2946
2992
|
}
|
|
2947
2993
|
],
|
|
2948
2994
|
"learned_contextual_priorities": [],
|
|
2995
|
+
"explain_associations_details": [
|
|
2996
|
+
null
|
|
2997
|
+
],
|
|
2949
2998
|
"query": "if x likes y or x loves y then x wants y",
|
|
2950
2999
|
"key": {
|
|
2951
3000
|
"query": "if x likes y or x loves y then x wants y"
|
package/common/ordinals.js
CHANGED
|
@@ -16,7 +16,7 @@ const config = {
|
|
|
16
16
|
{
|
|
17
17
|
id: "ordinal",
|
|
18
18
|
isA: ["listable"],
|
|
19
|
-
bridge: "{
|
|
19
|
+
bridge: "{ isInstance: false, ordinal: true, ...next(operator) }",
|
|
20
20
|
initial: { 'notConjunctableWith':['quantity', 'number'] },
|
|
21
21
|
},
|
|
22
22
|
{
|
|
@@ -41,7 +41,7 @@ const config = {
|
|
|
41
41
|
semantics: [
|
|
42
42
|
{
|
|
43
43
|
where: where(),
|
|
44
|
-
match: ({context}) => context.marker == 'mentions' && context.
|
|
44
|
+
match: ({context}) => context.marker == 'mentions' && context.args?.context?.ordinal,
|
|
45
45
|
apply: async ({callId, _continue, toList, context, kms, e, log, toArray, retry}) => {
|
|
46
46
|
// const ordinals = toArray(context.args?.context?.ordinal)
|
|
47
47
|
const lastNotFirst = context.args?.context?.ordinal.value < 0
|
|
@@ -87,31 +87,31 @@ const config = {
|
|
|
87
87
|
],
|
|
88
88
|
words: {
|
|
89
89
|
"literals": {
|
|
90
|
-
"first": [{"id": "ordinal", "initial": "{ value: 1, ordinal: true,
|
|
91
|
-
"last": [{"id": "ordinal", "initial": "{ value: -1, ordinal: true,
|
|
92
|
-
"1st": [{"id": "ordinal", "initial": "{ value: 1, ordinal: true,
|
|
93
|
-
"second": [{"id": "ordinal", "initial": "{ value: 2, ordinal: true,
|
|
94
|
-
"2nd": [{"id": "ordinal", "initial": "{ value: 2, ordinal: true,
|
|
95
|
-
"third": [{"id": "ordinal", "initial": "{ value: 3, ordinal: true,
|
|
96
|
-
"3rd": [{"id": "ordinal", "initial": "{ value: 3, ordinal: true,
|
|
97
|
-
"fourth": [{"id": "ordinal", "initial": "{ value: 4, ordinal: true,
|
|
98
|
-
"4rd": [{"id": "ordinal", "initial": "{ value: 4, ordinal: true,
|
|
99
|
-
"fifth": [{"id": "ordinal", "initial": "{ value: 5, ordinal: true,
|
|
100
|
-
"5th": [{"id": "ordinal", "initial": "{ value: 5, ordinal: true,
|
|
101
|
-
"sixth": [{"id": "ordinal", "initial": "{ value: 6, ordinal: true,
|
|
102
|
-
"6th": [{"id": "ordinal", "initial": "{ value: 6, ordinal: true,
|
|
103
|
-
"seventh": [{"id": "ordinal", "initial": "{ value: 7, ordinal: true,
|
|
104
|
-
"7th": [{"id": "ordinal", "initial": "{ value: 7, ordinal: true,
|
|
105
|
-
"eigth": [{"id": "ordinal", "initial": "{ value: 8, ordinal: true,
|
|
106
|
-
"8th": [{"id": "ordinal", "initial": "{ value: 8, ordinal: true,
|
|
107
|
-
"ninth": [{"id": "ordinal", "initial": "{ value: 9, ordinal: true,
|
|
108
|
-
"9th": [{"id": "ordinal", "initial": "{ value: 9, ordinal: true,
|
|
90
|
+
"first": [{"id": "ordinal", "initial": "{ value: 1, ordinal: true, isInstance: true }" }],
|
|
91
|
+
"last": [{"id": "ordinal", "initial": "{ value: -1, ordinal: true, isInstance: true }" }],
|
|
92
|
+
"1st": [{"id": "ordinal", "initial": "{ value: 1, ordinal: true, isInstance: true }" }],
|
|
93
|
+
"second": [{"id": "ordinal", "initial": "{ value: 2, ordinal: true, isInstance: true }" }],
|
|
94
|
+
"2nd": [{"id": "ordinal", "initial": "{ value: 2, ordinal: true, isInstance: true }" }],
|
|
95
|
+
"third": [{"id": "ordinal", "initial": "{ value: 3, ordinal: true, isInstance: true }" }],
|
|
96
|
+
"3rd": [{"id": "ordinal", "initial": "{ value: 3, ordinal: true, isInstance: true }" }],
|
|
97
|
+
"fourth": [{"id": "ordinal", "initial": "{ value: 4, ordinal: true, isInstance: true }" }],
|
|
98
|
+
"4rd": [{"id": "ordinal", "initial": "{ value: 4, ordinal: true, isInstance: true }" }],
|
|
99
|
+
"fifth": [{"id": "ordinal", "initial": "{ value: 5, ordinal: true, isInstance: true }" }],
|
|
100
|
+
"5th": [{"id": "ordinal", "initial": "{ value: 5, ordinal: true, isInstance: true }" }],
|
|
101
|
+
"sixth": [{"id": "ordinal", "initial": "{ value: 6, ordinal: true, isInstance: true }" }],
|
|
102
|
+
"6th": [{"id": "ordinal", "initial": "{ value: 6, ordinal: true, isInstance: true }" }],
|
|
103
|
+
"seventh": [{"id": "ordinal", "initial": "{ value: 7, ordinal: true, isInstance: true }" }],
|
|
104
|
+
"7th": [{"id": "ordinal", "initial": "{ value: 7, ordinal: true, isInstance: true }" }],
|
|
105
|
+
"eigth": [{"id": "ordinal", "initial": "{ value: 8, ordinal: true, isInstance: true }" }],
|
|
106
|
+
"8th": [{"id": "ordinal", "initial": "{ value: 8, ordinal: true, isInstance: true }" }],
|
|
107
|
+
"ninth": [{"id": "ordinal", "initial": "{ value: 9, ordinal: true, isInstance: true }" }],
|
|
108
|
+
"9th": [{"id": "ordinal", "initial": "{ value: 9, ordinal: true, isInstance: true }" }],
|
|
109
109
|
},
|
|
110
110
|
patterns: [
|
|
111
|
-
{ "pattern": [{ type: 'digit' }, { repeat: true }, 'th'], defs: [{id: "ordinal", uuid: '1', initial: "{ value: int(substr(text, -2)), ordinal: true,
|
|
112
|
-
{ "pattern": [{ type: 'digit' }, { repeat: true }, '1st'], defs: [{id: "ordinal", uuid: '1', initial: "{ value: int(substr(text, -2)), ordinal: true,
|
|
113
|
-
{ "pattern": [{ type: 'digit' }, { repeat: true }, '2nd'], defs: [{id: "ordinal", uuid: '1', initial: "{ value: int(substr(text, -2)), ordinal: true,
|
|
114
|
-
{ "pattern": [{ type: 'digit' }, { repeat: true }, '3rd'], defs: [{id: "ordinal", uuid: '1', initial: "{ value: int(substr(text, -2)), ordinal: true,
|
|
111
|
+
{ "pattern": [{ type: 'digit' }, { repeat: true }, 'th'], defs: [{id: "ordinal", uuid: '1', initial: "{ value: int(substr(text, -2)), ordinal: true, isInstance: true }" }]},
|
|
112
|
+
{ "pattern": [{ type: 'digit' }, { repeat: true }, '1st'], defs: [{id: "ordinal", uuid: '1', initial: "{ value: int(substr(text, -2)), ordinal: true, isInstance: true }" }]},
|
|
113
|
+
{ "pattern": [{ type: 'digit' }, { repeat: true }, '2nd'], defs: [{id: "ordinal", uuid: '1', initial: "{ value: int(substr(text, -2)), ordinal: true, isInstance: true }" }]},
|
|
114
|
+
{ "pattern": [{ type: 'digit' }, { repeat: true }, '3rd'], defs: [{id: "ordinal", uuid: '1', initial: "{ value: int(substr(text, -2)), ordinal: true, isInstance: true }" }]},
|
|
115
115
|
],
|
|
116
116
|
},
|
|
117
117
|
};
|