tpmkms_4wp 8.0.0-beta.64 → 8.0.0-beta.65
Sign up to get free protection for your applications and to get access to all the features.
- package/common/crew.instance.json +0 -128
- package/common/edible.instance.json +58 -2
- package/common/emotions.instance.json +0 -60
- package/common/fastfood.instance.json +659 -239
- package/common/nameable.js +13 -4
- package/common/nameable.test.json +1070 -0
- package/common/ordering.instance.json +68 -0
- package/common/people.instance.json +28 -0
- package/common/reports.instance.json +1 -1
- package/common/reports.js +5 -4
- package/common/reports.test.json +15623 -10458
- package/common/temperature.instance.json +0 -84
- package/common/tokenize.js +1 -1
- package/common/weight.instance.json +0 -52
- package/package.json +2 -2
package/common/nameable.js
CHANGED
@@ -4,6 +4,8 @@ const helpers = require('./helpers')
|
|
4
4
|
const stm = require('./stm')
|
5
5
|
const nameable_tests = require('./nameable.test.json')
|
6
6
|
|
7
|
+
// TODO but "remember the m1\n call the m1 banana" <- the on the first one
|
8
|
+
|
7
9
|
class API {
|
8
10
|
initialize({ objects, km, kms }) {
|
9
11
|
this.objects = objects
|
@@ -73,7 +75,8 @@ const api = new API()
|
|
73
75
|
const config = {
|
74
76
|
name: 'nameable',
|
75
77
|
operators: [
|
76
|
-
"([call] ([nameable]) (name))",
|
78
|
+
// "([call] ([nameable]) (name))",
|
79
|
+
"([call] ([nameable]) (name)*)",
|
77
80
|
{ pattern: "([getNamesByType] (type))", development: true },
|
78
81
|
{ pattern: "([m1])", development: true },
|
79
82
|
// { pattern: "([testPullFromContext] ([memorable]))", development: true }
|
@@ -103,12 +106,15 @@ const config = {
|
|
103
106
|
{
|
104
107
|
id: 'call',
|
105
108
|
isA: ['verb'],
|
106
|
-
bridge: "{ ...next(operator), nameable: after[0], name: after[1] }",
|
107
|
-
|
109
|
+
bridge: "{ ...next(operator), nameable: after[0], name: after[1:] }",
|
110
|
+
// bridge: "{ ...next(operator), nameable: after[0], name: after[1] }",
|
111
|
+
// generatorp: async ({context, g}) => `call ${await g(context.nameable)} ${await g(context.name)}`,
|
112
|
+
generatorp: async ({context, g, gs}) => `call ${await g(context.nameable)} ${await gs(context.name)}`,
|
108
113
|
semantic: async ({config, context, api, e}) => {
|
109
114
|
// TODO find report being referred to
|
110
115
|
const nameable = (await e(context.nameable)).evalue
|
111
|
-
const name = context.name.text
|
116
|
+
const name = context.name.map((n) => n.text).join(' ')
|
117
|
+
// const name = context.name.text
|
112
118
|
config.addWord(name, { id: nameable.marker, initial: `{ value: "${name}", pullFromContext: true, nameable_named: true }` })
|
113
119
|
api.setName(nameable, name)
|
114
120
|
}
|
@@ -131,5 +137,8 @@ knowledgeModule( {
|
|
131
137
|
context: [...defaultContextCheck, 'pullFromContext'],
|
132
138
|
objects: ['mentioned', { km: 'stm' }],
|
133
139
|
},
|
140
|
+
include: {
|
141
|
+
words: [ "peter james chunkington", "banana" ],
|
142
|
+
}
|
134
143
|
},
|
135
144
|
})
|