tpmkms 9.5.1-beta.13 → 9.5.1-beta.15

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.
@@ -0,0 +1,2 @@
1
+ {
2
+ }
@@ -0,0 +1,53 @@
1
+ const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
+ const { defaultContextCheck } = require('./helpers')
3
+ const words_tests = require('./words.test.json')
4
+ const words_instance = require('./words.instance.json')
5
+ const tokenize = require('./tokenize')
6
+
7
+ function initializer({objects, config, isModule}) {
8
+ objects.words = []
9
+ config.addArgs((args) => ({
10
+ getWordFromDictionary: (partial) => {
11
+ for (const word of objects.words) {
12
+ let matches = true
13
+ for (const key in partial) {
14
+ if (partial[key] !== word[key]) {
15
+ matches = false
16
+ }
17
+ }
18
+ if (matches) {
19
+ return word
20
+ }
21
+ }
22
+ },
23
+ addWordToDictionary: (context) => {
24
+ objects.words.push(context)
25
+ }
26
+ }))
27
+ }
28
+
29
+ const template = {
30
+ configs: [],
31
+ fragments: [],
32
+ }
33
+
34
+ knowledgeModule( {
35
+ config: { name: 'words' },
36
+ includes: [tokenize],
37
+ initializer,
38
+
39
+ module,
40
+ description: 'talking about words',
41
+ test: {
42
+ name: './words.test.json',
43
+ contents: words_tests,
44
+ checks: {
45
+ context: [defaultContextCheck()],
46
+ }
47
+ },
48
+ template: {
49
+ template,
50
+ instance: words_instance,
51
+ },
52
+
53
+ })
@@ -0,0 +1,2 @@
1
+ [
2
+ ]
package/package.json CHANGED
@@ -163,6 +163,7 @@
163
163
  "common/avatar.test.json",
164
164
  "common/can.instance.json",
165
165
  "common/can.js",
166
+ "common/can.test.json",
166
167
  "common/characters.js",
167
168
  "common/characters.test.json",
168
169
  "common/colors.instance.json",
@@ -333,6 +334,9 @@
333
334
  "common/weight.instance.json",
334
335
  "common/weight.js",
335
336
  "common/weight.test.json",
337
+ "common/words.instance.json",
338
+ "common/words.js",
339
+ "common/words.test.json",
336
340
  "common/wp.instance.json",
337
341
  "common/wp.js",
338
342
  "common/wp.test.json",
@@ -354,8 +358,8 @@
354
358
  "scriptjs": "^2.5.9",
355
359
  "table": "^6.7.1",
356
360
  "uuid": "^9.0.0",
357
- "theprogrammablemind": "9.5.1-beta.13"
361
+ "theprogrammablemind": "9.5.1-beta.15"
358
362
  },
359
- "version": "9.5.1-beta.13",
363
+ "version": "9.5.1-beta.15",
360
364
  "license": "UNLICENSED"
361
365
  }