tpmkms_4wp 7.12.8 → 8.0.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/animals.instance.json +192 -406
- package/common/animals.js +1 -1
- package/common/avatar.js +7 -5
- package/common/characters.js +12 -6
- package/common/{pipboyTemplate.instance.json → colors.instance.json} +13784 -8900
- package/common/colors.js +71 -0
- package/common/colors.test.json +4860 -0
- package/common/concept.js +2 -2
- package/common/crew.instance.json +3945 -3636
- package/common/crew.js +5 -3
- package/common/currency.js +0 -2
- package/common/dialogues.js +152 -20
- package/common/dialogues.test.json +1053 -33
- package/common/dimension.instance.json +750 -86
- package/common/dimension.js +15 -7
- package/common/dimension.test.json +289 -312
- package/common/edible.instance.json +446 -578
- package/common/edible.js +1 -1
- package/common/emotions.instance.json +67 -39
- package/common/emotions.js +1 -1
- package/common/fastfood.instance.json +1769 -2136
- package/common/fastfood.js +2 -2
- package/common/fastfood.test.json +7941 -3647
- package/common/formulas.instance.json +996 -0
- package/common/formulas.js +19 -6
- package/common/formulas.test.json +504 -2896
- package/common/gdefaults.js +2 -0
- package/common/help.js +7 -2
- package/common/help.test.json +18 -10
- package/common/helpers/concept.js +29 -9
- package/common/helpers/dialogues.js +17 -1
- package/common/helpers/formulas.js +0 -14
- package/common/helpers/meta.js +0 -1
- package/common/helpers/properties.js +6 -13
- package/common/helpers.js +5 -0
- package/common/javascript.js +8 -6
- package/common/kirk.instance.json +5 -1
- package/common/kirk.js +1 -1
- package/common/length.instance.json +417 -811
- package/common/length.js +1 -1
- package/common/math.instance.json +1938 -1
- package/common/math.js +17 -5
- package/common/meta.instance.json +1 -1
- package/common/meta.js +33 -10
- package/common/numbers.js +28 -24
- package/common/ordering.instance.json +98 -138
- package/common/ordering.js +1 -1
- package/common/people.instance.json +68 -121
- package/common/people.js +1 -1
- package/common/pipboy.instance.json +23411 -1076
- package/common/pipboy.js +31 -4
- package/common/pipboy.test.json +13 -9
- package/common/pokemon.instance.json +172 -223
- package/common/pokemon.js +1 -1
- package/common/pressure.instance.json +131 -81
- package/common/pressure.js +1 -1
- package/common/properties.instance.json +25 -49
- package/common/properties.js +20 -15
- package/common/properties.test.json +17605 -4030
- package/common/punctuation.js +8 -0
- package/common/punctuation.test.json +233 -5
- package/common/reports.instance.json +33 -65
- package/common/reports.js +9 -9
- package/common/scorekeeper.instance.json +1 -1
- package/common/scorekeeper.js +9 -7
- package/common/sizeable.js +7 -2
- package/common/spock.instance.json +5 -1
- package/common/spock.js +1 -1
- package/common/stm.js +16 -5
- package/common/tell.js +4 -2
- package/common/temperature.instance.json +142 -252
- package/common/temperature.js +1 -1
- package/common/testing.js +0 -1
- package/common/time.js +36 -20
- package/common/time.test.json +66 -44
- package/common/tokenize.js +47 -0
- package/common/tokenize.test.json +87 -0
- package/common/ui.instance.json +13 -1
- package/common/ui.js +0 -1
- package/common/weight.instance.json +335 -228
- package/common/weight.js +1 -1
- package/common/weight.test.json +242 -238
- package/main.js +6 -8
- package/package.json +10 -18
- package/common/dimensionTemplate.instance.json +0 -582
- package/common/dimensionTemplate.js +0 -35
- package/common/dimensionTemplate.test.json +0 -2
- package/common/formulasTemplate.instance.json +0 -483
- package/common/formulasTemplate.js +0 -30
- package/common/formulasTemplate.test.json +0 -2
- package/common/mathTemplate.instance.json +0 -1635
- package/common/mathTemplate.js +0 -32
- package/common/mathTemplate.test.json +0 -1422
- package/common/pipboyTemplate.js +0 -48
- package/common/pipboyTemplate.test.json +0 -2
package/common/temperature.js
CHANGED
@@ -5,7 +5,7 @@ const temperature_tests = require('./temperature.test.json')
|
|
5
5
|
const temperature_instance = require('./temperature.instance.json')
|
6
6
|
|
7
7
|
const template = {
|
8
|
-
|
8
|
+
configs: [
|
9
9
|
"temperature is a dimension",
|
10
10
|
"celcius fahrenheit and kelvin are units of temperature",
|
11
11
|
|
package/common/testing.js
CHANGED
package/common/time.js
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
|
2
2
|
const { defaultContextCheck } = require('./helpers')
|
3
3
|
const tell = require('./tell')
|
4
|
+
const countable = require('./countable')
|
5
|
+
const numbers = require('./numbers')
|
4
6
|
const helpers = require('./helpers')
|
5
7
|
const time_tests = require('./time.test.json')
|
6
8
|
|
@@ -40,8 +42,8 @@ const configStruct = {
|
|
40
42
|
name: 'time',
|
41
43
|
operators: [
|
42
44
|
"([time])",
|
43
|
-
"([use] ((
|
44
|
-
"(([
|
45
|
+
"([use] (([timeUnit]) [timeFormat|format]))",
|
46
|
+
"(([number|]) [ampm|])"
|
45
47
|
//"(([anyConcept]) [equals|is] ([anyConcept]))",
|
46
48
|
//"(([what0|what]) [equals] (<the> ([timeConcept])))",
|
47
49
|
//"(<whatP|what> ([anyConcept]))",
|
@@ -54,40 +56,54 @@ const configStruct = {
|
|
54
56
|
bridges: [
|
55
57
|
{ "id": "time", "level": 0, "bridge": "{ ...next(operator) }" },
|
56
58
|
|
57
|
-
{ "id": "hourUnits", "level": 0, "bridge": "{ ...next(operator) }" },
|
59
|
+
// { "id": "hourUnits", "level": 0, "bridge": "{ ...next(operator) }" },
|
58
60
|
{ "id": "ampm", "level": 0, "bridge": "{ ...next(operator), hour: before[0] }" },
|
59
61
|
|
60
62
|
{ "id": "timeFormat", "level": 0, "bridge": "{ ...before[0], ...next(operator) }" },
|
61
|
-
{ "id": "count", "level": 0, "bridge": "{ ...after, count: operator.value }" },
|
62
|
-
{
|
63
|
+
// { "id": "count", "level": 0, "bridge": "{ ...after, count: operator.value }" },
|
64
|
+
{
|
65
|
+
"id": "timeUnit",
|
66
|
+
"level": 0,
|
67
|
+
words: [
|
68
|
+
...helpers.words('hour', { initial: "{ units: 'hour' }" }),
|
69
|
+
...helpers.words('minute', { initial: "{ units: 'minute' }" }),
|
70
|
+
...helpers.words('second', { initial: "{ units: 'second' }" }),
|
71
|
+
],
|
72
|
+
"bridge": "{ ...next(operator) }"
|
73
|
+
},
|
63
74
|
{ "id": "use", "level": 0,
|
64
75
|
bridge: "{ ...next(operator), format: after[0] }",
|
65
|
-
generatorp: ({g, context}) => `use ${context.format.
|
76
|
+
generatorp: ({g, context}) => `use ${context.format.quantity.value} hour time`
|
66
77
|
},
|
67
78
|
],
|
68
79
|
hierarchy: [
|
69
80
|
['time', 'queryable'],
|
70
81
|
['ampm', 'queryable'],
|
71
82
|
['time', 'theAble'],
|
83
|
+
['timeUnit', 'countable'],
|
72
84
|
],
|
73
85
|
|
74
86
|
"words": {
|
75
|
-
"
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
87
|
+
"literals": {
|
88
|
+
// " ([0-9]+)": [{"id": "count", "initial": "{ value: int(group[0]) }" }],
|
89
|
+
// " (1[0-2]|[1-9])": [{"id": "hourUnits", "initial": "{ hour: int(group[0]) }" }],
|
90
|
+
"am": [{"id": "ampm", "initial": "{ ampm: 'am', determined: true }" }],
|
91
|
+
"pm": [{"id": "ampm", "initial": "{ ampm: 'pm', determined: true }" }],
|
92
|
+
//" (1[0-2]|[1-9]) ?pm": [{"id": "count", "initial": "{ hour: int(group[0]), part: 'pm' }" }],
|
93
|
+
//" (1[0-2]|[1-9]) ?am": [{"id": "count", "initial": "{ hour: int(group[0]), part: 'am' }" }],
|
94
|
+
/*
|
95
|
+
" hours?": [{"id": "timeUnit", "initial": "{ units: 'hour' }" }],
|
96
|
+
" minutes?": [{"id": "timeUnit", "initial": "{ units: 'hour' }" }],
|
97
|
+
" seconds?": [{"id": "timeUnit", "initial": "{ units: 'seconds' }" }],
|
98
|
+
*/
|
99
|
+
}
|
84
100
|
},
|
85
101
|
|
86
102
|
generators: [
|
87
103
|
{
|
88
104
|
where: where(),
|
89
105
|
match: ({context}) => context.marker == 'ampm' && context.paraphrase,
|
90
|
-
apply: ({g, context}) => `${context.hour
|
106
|
+
apply: ({g, context, gp}) => `${gp(context.hour)} ${context.ampm}`
|
91
107
|
},
|
92
108
|
{
|
93
109
|
where: where(),
|
@@ -137,15 +153,15 @@ const configStruct = {
|
|
137
153
|
{
|
138
154
|
notes: 'use time format working case',
|
139
155
|
where: where(),
|
140
|
-
match: ({objects, context}) => context.marker == 'use' && context.format && (context.format.
|
156
|
+
match: ({objects, context}) => context.marker == 'use' && context.format && (context.format.quantity.value == 12 || context.format.quantity.value == 24),
|
141
157
|
apply: ({objects, context}) => {
|
142
|
-
objects.format = context.format.
|
158
|
+
objects.format = context.format.quantity.value
|
143
159
|
}
|
144
160
|
},
|
145
161
|
{
|
146
162
|
notes: 'use time format error case',
|
147
163
|
where: where(),
|
148
|
-
match: ({objects, context}) => context.marker == 'use' && context.format && (context.format.
|
164
|
+
match: ({objects, context}) => context.marker == 'use' && context.format && (context.format.quantity.value != 12 && context.format.quantity.value != 24),
|
149
165
|
apply: ({objects, context}) => {
|
150
166
|
context.marker = 'response'
|
151
167
|
context.text = 'The hour format is 12 hour or 24 hour'
|
@@ -157,7 +173,7 @@ const configStruct = {
|
|
157
173
|
const createConfig = () => {
|
158
174
|
const config = new Config(configStruct, module)
|
159
175
|
config.stop_auto_rebuild()
|
160
|
-
config.add(tell())
|
176
|
+
config.add(tell()).add(numbers()).add(countable())
|
161
177
|
config.api = api
|
162
178
|
config.initializer( ({config, objects, kms, isModule}) => {
|
163
179
|
if (!isModule) {
|
package/common/time.test.json
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
0
|
8
8
|
],
|
9
9
|
[
|
10
|
-
"
|
10
|
+
"number",
|
11
11
|
0
|
12
12
|
]
|
13
13
|
]
|
@@ -21,17 +21,18 @@
|
|
21
21
|
"determined": true,
|
22
22
|
"hour": {
|
23
23
|
"dead": true,
|
24
|
-
"
|
24
|
+
"instance": true,
|
25
25
|
"level": 1,
|
26
|
-
"marker": "
|
26
|
+
"marker": "number",
|
27
27
|
"range": {
|
28
28
|
"end": 0,
|
29
29
|
"start": 0
|
30
30
|
},
|
31
31
|
"text": "2",
|
32
32
|
"types": [
|
33
|
-
"
|
33
|
+
"number"
|
34
34
|
],
|
35
|
+
"value": 2,
|
35
36
|
"word": "2"
|
36
37
|
},
|
37
38
|
"level": 1,
|
@@ -53,7 +54,7 @@
|
|
53
54
|
{
|
54
55
|
"counter": 1,
|
55
56
|
"op": [
|
56
|
-
"
|
57
|
+
"number",
|
57
58
|
0
|
58
59
|
],
|
59
60
|
"ops": [
|
@@ -62,7 +63,7 @@
|
|
62
63
|
0
|
63
64
|
],
|
64
65
|
[
|
65
|
-
"
|
66
|
+
"number",
|
66
67
|
0
|
67
68
|
]
|
68
69
|
]
|
@@ -87,6 +88,7 @@
|
|
87
88
|
"dialogues": "dialogues2",
|
88
89
|
"gdefaults": "gdefaults2",
|
89
90
|
"meta": "meta2",
|
91
|
+
"numbers": "numbers2",
|
90
92
|
"pos": "pos2",
|
91
93
|
"punctuation": "punctuation2",
|
92
94
|
"sdefaults": "sdefaults2",
|
@@ -105,6 +107,8 @@
|
|
105
107
|
},
|
106
108
|
"meta2": {
|
107
109
|
},
|
110
|
+
"numbers2": {
|
111
|
+
},
|
108
112
|
"pos2": {
|
109
113
|
},
|
110
114
|
"punctuation2": {
|
@@ -131,17 +135,18 @@
|
|
131
135
|
"determined": true,
|
132
136
|
"hour": {
|
133
137
|
"dead": true,
|
134
|
-
"
|
138
|
+
"instance": true,
|
135
139
|
"level": 1,
|
136
|
-
"marker": "
|
140
|
+
"marker": "number",
|
137
141
|
"range": {
|
138
142
|
"end": 0,
|
139
143
|
"start": 0
|
140
144
|
},
|
141
145
|
"text": "2",
|
142
146
|
"types": [
|
143
|
-
"
|
147
|
+
"number"
|
144
148
|
],
|
149
|
+
"value": 2,
|
145
150
|
"word": "2"
|
146
151
|
},
|
147
152
|
"level": 1,
|
@@ -156,7 +161,7 @@
|
|
156
161
|
},
|
157
162
|
"generatedParenthesized": "",
|
158
163
|
"paraphrases": "2 pm",
|
159
|
-
"paraphrasesParenthesized": "(2 pm)",
|
164
|
+
"paraphrasesParenthesized": "((2) pm)",
|
160
165
|
"responses": [
|
161
166
|
""
|
162
167
|
]
|
@@ -167,7 +172,7 @@
|
|
167
172
|
"2 pm"
|
168
173
|
],
|
169
174
|
"paraphrasesParenthesized": [
|
170
|
-
"(2 pm)"
|
175
|
+
"((2) pm)"
|
171
176
|
],
|
172
177
|
"query": "2 pm",
|
173
178
|
"responses": [
|
@@ -182,15 +187,15 @@
|
|
182
187
|
0
|
183
188
|
],
|
184
189
|
[
|
185
|
-
"
|
190
|
+
"info",
|
186
191
|
0
|
187
192
|
],
|
188
193
|
[
|
189
|
-
"
|
194
|
+
"is",
|
190
195
|
0
|
191
196
|
],
|
192
197
|
[
|
193
|
-
"
|
198
|
+
"number",
|
194
199
|
0
|
195
200
|
],
|
196
201
|
[
|
@@ -216,15 +221,15 @@
|
|
216
221
|
0
|
217
222
|
],
|
218
223
|
[
|
219
|
-
"
|
224
|
+
"info",
|
220
225
|
0
|
221
226
|
],
|
222
227
|
[
|
223
|
-
"
|
228
|
+
"is",
|
224
229
|
0
|
225
230
|
],
|
226
231
|
[
|
227
|
-
"
|
232
|
+
"number",
|
228
233
|
0
|
229
234
|
],
|
230
235
|
[
|
@@ -246,11 +251,11 @@
|
|
246
251
|
0
|
247
252
|
],
|
248
253
|
[
|
249
|
-
"
|
254
|
+
"is",
|
250
255
|
0
|
251
256
|
],
|
252
257
|
[
|
253
|
-
"
|
258
|
+
"number",
|
254
259
|
0
|
255
260
|
],
|
256
261
|
[
|
@@ -264,11 +269,11 @@
|
|
264
269
|
0
|
265
270
|
],
|
266
271
|
[
|
267
|
-
"
|
272
|
+
"is",
|
268
273
|
0
|
269
274
|
],
|
270
275
|
[
|
271
|
-
"
|
276
|
+
"number",
|
272
277
|
0
|
273
278
|
],
|
274
279
|
[
|
@@ -286,11 +291,11 @@
|
|
286
291
|
0
|
287
292
|
],
|
288
293
|
[
|
289
|
-
"
|
294
|
+
"is",
|
290
295
|
0
|
291
296
|
],
|
292
297
|
[
|
293
|
-
"
|
298
|
+
"number",
|
294
299
|
0
|
295
300
|
],
|
296
301
|
[
|
@@ -405,17 +410,18 @@
|
|
405
410
|
"determined": true,
|
406
411
|
"hour": {
|
407
412
|
"dead": true,
|
408
|
-
"
|
413
|
+
"instance": true,
|
409
414
|
"level": 1,
|
410
|
-
"marker": "
|
415
|
+
"marker": "number",
|
411
416
|
"range": {
|
412
417
|
"end": 25,
|
413
418
|
"start": 25
|
414
419
|
},
|
415
420
|
"text": "2",
|
416
421
|
"types": [
|
417
|
-
"
|
422
|
+
"number"
|
418
423
|
],
|
424
|
+
"value": 2,
|
419
425
|
"word": "2"
|
420
426
|
},
|
421
427
|
"level": 1,
|
@@ -497,15 +503,15 @@
|
|
497
503
|
0
|
498
504
|
],
|
499
505
|
[
|
500
|
-
"
|
506
|
+
"info",
|
501
507
|
0
|
502
508
|
],
|
503
509
|
[
|
504
|
-
"
|
510
|
+
"is",
|
505
511
|
0
|
506
512
|
],
|
507
513
|
[
|
508
|
-
"
|
514
|
+
"number",
|
509
515
|
0
|
510
516
|
],
|
511
517
|
[
|
@@ -538,15 +544,15 @@
|
|
538
544
|
0
|
539
545
|
],
|
540
546
|
[
|
541
|
-
"
|
547
|
+
"info",
|
542
548
|
0
|
543
549
|
],
|
544
550
|
[
|
545
|
-
"
|
551
|
+
"is",
|
546
552
|
0
|
547
553
|
],
|
548
554
|
[
|
549
|
-
"
|
555
|
+
"number",
|
550
556
|
0
|
551
557
|
],
|
552
558
|
[
|
@@ -575,11 +581,11 @@
|
|
575
581
|
0
|
576
582
|
],
|
577
583
|
[
|
578
|
-
"
|
584
|
+
"is",
|
579
585
|
0
|
580
586
|
],
|
581
587
|
[
|
582
|
-
"
|
588
|
+
"number",
|
583
589
|
0
|
584
590
|
],
|
585
591
|
[
|
@@ -608,11 +614,11 @@
|
|
608
614
|
0
|
609
615
|
],
|
610
616
|
[
|
611
|
-
"
|
617
|
+
"is",
|
612
618
|
0
|
613
619
|
],
|
614
620
|
[
|
615
|
-
"
|
621
|
+
"number",
|
616
622
|
0
|
617
623
|
],
|
618
624
|
[
|
@@ -628,7 +634,7 @@
|
|
628
634
|
{
|
629
635
|
"counter": 5,
|
630
636
|
"op": [
|
631
|
-
"
|
637
|
+
"number",
|
632
638
|
0
|
633
639
|
],
|
634
640
|
"ops": [
|
@@ -637,11 +643,11 @@
|
|
637
643
|
0
|
638
644
|
],
|
639
645
|
[
|
640
|
-
"
|
646
|
+
"is",
|
641
647
|
0
|
642
648
|
],
|
643
649
|
[
|
644
|
-
"
|
650
|
+
"number",
|
645
651
|
0
|
646
652
|
],
|
647
653
|
[
|
@@ -712,6 +718,7 @@
|
|
712
718
|
"dialogues": "dialogues2",
|
713
719
|
"gdefaults": "gdefaults2",
|
714
720
|
"meta": "meta2",
|
721
|
+
"numbers": "numbers2",
|
715
722
|
"pos": "pos2",
|
716
723
|
"punctuation": "punctuation2",
|
717
724
|
"sdefaults": "sdefaults2",
|
@@ -730,6 +737,8 @@
|
|
730
737
|
},
|
731
738
|
"meta2": {
|
732
739
|
},
|
740
|
+
"numbers2": {
|
741
|
+
},
|
733
742
|
"pos2": {
|
734
743
|
},
|
735
744
|
"punctuation2": {
|
@@ -793,17 +802,18 @@
|
|
793
802
|
"determined": true,
|
794
803
|
"hour": {
|
795
804
|
"dead": true,
|
796
|
-
"
|
805
|
+
"instance": true,
|
797
806
|
"level": 1,
|
798
|
-
"marker": "
|
807
|
+
"marker": "number",
|
799
808
|
"range": {
|
800
809
|
"end": 25,
|
801
810
|
"start": 25
|
802
811
|
},
|
803
812
|
"text": "2",
|
804
813
|
"types": [
|
805
|
-
"
|
814
|
+
"number"
|
806
815
|
],
|
816
|
+
"value": 2,
|
807
817
|
"word": "2"
|
808
818
|
},
|
809
819
|
"level": 1,
|
@@ -869,7 +879,7 @@
|
|
869
879
|
},
|
870
880
|
"generatedParenthesized": "",
|
871
881
|
"paraphrases": "tell me when the time is 2 pm",
|
872
|
-
"paraphrasesParenthesized": "(tell (me) when ((the (time)) is (2 pm)))",
|
882
|
+
"paraphrasesParenthesized": "(tell (me) when ((the (time)) is ((2) pm)))",
|
873
883
|
"responses": [
|
874
884
|
""
|
875
885
|
]
|
@@ -880,7 +890,7 @@
|
|
880
890
|
"tell me when the time is 2 pm"
|
881
891
|
],
|
882
892
|
"paraphrasesParenthesized": [
|
883
|
-
"(tell (me) when ((the (time)) is (2 pm)))"
|
893
|
+
"(tell (me) when ((the (time)) is ((2) pm)))"
|
884
894
|
],
|
885
895
|
"query": "tell me when the time is 2 pm",
|
886
896
|
"responses": [
|
@@ -1386,6 +1396,7 @@
|
|
1386
1396
|
"dialogues": "dialogues2",
|
1387
1397
|
"gdefaults": "gdefaults2",
|
1388
1398
|
"meta": "meta2",
|
1399
|
+
"numbers": "numbers2",
|
1389
1400
|
"pos": "pos2",
|
1390
1401
|
"punctuation": "punctuation2",
|
1391
1402
|
"sdefaults": "sdefaults2",
|
@@ -1404,6 +1415,8 @@
|
|
1404
1415
|
},
|
1405
1416
|
"meta2": {
|
1406
1417
|
},
|
1418
|
+
"numbers2": {
|
1419
|
+
},
|
1407
1420
|
"pos2": {
|
1408
1421
|
},
|
1409
1422
|
"punctuation2": {
|
@@ -2122,6 +2135,7 @@
|
|
2122
2135
|
"dialogues": "dialogues2",
|
2123
2136
|
"gdefaults": "gdefaults2",
|
2124
2137
|
"meta": "meta2",
|
2138
|
+
"numbers": "numbers2",
|
2125
2139
|
"pos": "pos2",
|
2126
2140
|
"punctuation": "punctuation2",
|
2127
2141
|
"sdefaults": "sdefaults2",
|
@@ -2140,6 +2154,8 @@
|
|
2140
2154
|
},
|
2141
2155
|
"meta2": {
|
2142
2156
|
},
|
2157
|
+
"numbers2": {
|
2158
|
+
},
|
2143
2159
|
"pos2": {
|
2144
2160
|
},
|
2145
2161
|
"punctuation2": {
|
@@ -2531,6 +2547,7 @@
|
|
2531
2547
|
"dialogues": "dialogues2",
|
2532
2548
|
"gdefaults": "gdefaults2",
|
2533
2549
|
"meta": "meta2",
|
2550
|
+
"numbers": "numbers2",
|
2534
2551
|
"pos": "pos2",
|
2535
2552
|
"punctuation": "punctuation2",
|
2536
2553
|
"sdefaults": "sdefaults2",
|
@@ -2549,6 +2566,8 @@
|
|
2549
2566
|
},
|
2550
2567
|
"meta2": {
|
2551
2568
|
},
|
2569
|
+
"numbers2": {
|
2570
|
+
},
|
2552
2571
|
"pos2": {
|
2553
2572
|
},
|
2554
2573
|
"punctuation2": {
|
@@ -2905,6 +2924,7 @@
|
|
2905
2924
|
"dialogues": "dialogues2",
|
2906
2925
|
"gdefaults": "gdefaults2",
|
2907
2926
|
"meta": "meta2",
|
2927
|
+
"numbers": "numbers2",
|
2908
2928
|
"pos": "pos2",
|
2909
2929
|
"punctuation": "punctuation2",
|
2910
2930
|
"sdefaults": "sdefaults2",
|
@@ -2923,6 +2943,8 @@
|
|
2923
2943
|
},
|
2924
2944
|
"meta2": {
|
2925
2945
|
},
|
2946
|
+
"numbers2": {
|
2947
|
+
},
|
2926
2948
|
"pos2": {
|
2927
2949
|
},
|
2928
2950
|
"punctuation2": {
|
@@ -0,0 +1,47 @@
|
|
1
|
+
const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
|
2
|
+
const { defaultContextCheck } = require('./helpers')
|
3
|
+
const tokenize_tests = require('./tokenize.test.json')
|
4
|
+
|
5
|
+
let configStruct = {
|
6
|
+
name: 'tokenize',
|
7
|
+
operators: [
|
8
|
+
"([unknown])",
|
9
|
+
],
|
10
|
+
bridges: [
|
11
|
+
{ id: "unknown", level: 0, bridge: "{ ...next(operator), unknown: true, dead: true }" },
|
12
|
+
{ id: "unknown", level: 1, bridge: "{ ...next(operator) }" },
|
13
|
+
],
|
14
|
+
words: {
|
15
|
+
patterns: [
|
16
|
+
{ pattern: [{ type: 'space' }, { repeat: true }], defs: [ { remove: true } ] },
|
17
|
+
{ pattern: [{ type: 'alphanumeric' }, { repeat: true }], defs: [ { id: 'unknown', initial: "{ value: text, unknown: true }" } ] },
|
18
|
+
],
|
19
|
+
hierarchy: [
|
20
|
+
{ child: ' ', parent: 'space' },
|
21
|
+
..."0123456789".split("").map((digit) => { return { child: digit, parent: 'digit' } }),
|
22
|
+
{ child: 'lower', parent: 'letter' },
|
23
|
+
{ child: 'upper', parent: 'letter' },
|
24
|
+
...'abcdefghijklmnopqrstuvwxyz'.split("").map((letter) => { return { child: letter, parent: 'lower' } }),
|
25
|
+
...'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split("").map((letter) => { return { child: letter, parent: 'upper' } }),
|
26
|
+
{ child: 'letter', parent: 'alphanumeric' },
|
27
|
+
{ child: 'digit', parent: 'alphanumeric' },
|
28
|
+
{ child: '_', parent: 'alphanumeric' },
|
29
|
+
...`~!@#$%^&*()+-=[]{}\\|;:,<>/?'"`.split("").map((punctuation) => { return { child: punctuation, parent: 'punctuation' } }),
|
30
|
+
],
|
31
|
+
},
|
32
|
+
};
|
33
|
+
|
34
|
+
createConfig = () => new Config(configStruct, module)
|
35
|
+
|
36
|
+
knowledgeModule( {
|
37
|
+
module,
|
38
|
+
createConfig,
|
39
|
+
description: 'tokenize',
|
40
|
+
test: {
|
41
|
+
name: './tokenize.test.json',
|
42
|
+
contents: tokenize_tests,
|
43
|
+
checks: {
|
44
|
+
context: defaultContextCheck,
|
45
|
+
},
|
46
|
+
},
|
47
|
+
})
|
@@ -0,0 +1,87 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"associations": [
|
4
|
+
],
|
5
|
+
"config": {
|
6
|
+
},
|
7
|
+
"contexts": [
|
8
|
+
{
|
9
|
+
"dead": true,
|
10
|
+
"level": 1,
|
11
|
+
"marker": "unknown",
|
12
|
+
"range": {
|
13
|
+
"end": 10,
|
14
|
+
"start": 0
|
15
|
+
},
|
16
|
+
"text": "hello_world",
|
17
|
+
"topLevel": true,
|
18
|
+
"unknown": true,
|
19
|
+
"value": "hello_world",
|
20
|
+
"word": "hello_world"
|
21
|
+
}
|
22
|
+
],
|
23
|
+
"generatedParenthesized": [
|
24
|
+
""
|
25
|
+
],
|
26
|
+
"metadata": {
|
27
|
+
"opChoices": [
|
28
|
+
{
|
29
|
+
"counter": 1,
|
30
|
+
"op": [
|
31
|
+
"unknown",
|
32
|
+
0
|
33
|
+
],
|
34
|
+
"ops": [
|
35
|
+
[
|
36
|
+
"unknown",
|
37
|
+
0
|
38
|
+
]
|
39
|
+
]
|
40
|
+
}
|
41
|
+
]
|
42
|
+
},
|
43
|
+
"objects": {
|
44
|
+
"nameToUUID": {
|
45
|
+
"tokenize": "tokenize1"
|
46
|
+
},
|
47
|
+
"namespaced": {
|
48
|
+
"tokenize1": {
|
49
|
+
}
|
50
|
+
},
|
51
|
+
"processed": [
|
52
|
+
{
|
53
|
+
"context": {
|
54
|
+
"dead": true,
|
55
|
+
"level": 1,
|
56
|
+
"marker": "unknown",
|
57
|
+
"range": {
|
58
|
+
"end": 10,
|
59
|
+
"start": 0
|
60
|
+
},
|
61
|
+
"text": "hello_world",
|
62
|
+
"topLevel": true,
|
63
|
+
"unknown": true,
|
64
|
+
"value": "hello_world",
|
65
|
+
"word": "hello_world"
|
66
|
+
},
|
67
|
+
"generatedParenthesized": "",
|
68
|
+
"paraphrases": "",
|
69
|
+
"paraphrasesParenthesized": "()",
|
70
|
+
"responses": [
|
71
|
+
""
|
72
|
+
]
|
73
|
+
}
|
74
|
+
]
|
75
|
+
},
|
76
|
+
"paraphrases": [
|
77
|
+
""
|
78
|
+
],
|
79
|
+
"paraphrasesParenthesized": [
|
80
|
+
"()"
|
81
|
+
],
|
82
|
+
"query": "hello_world",
|
83
|
+
"responses": [
|
84
|
+
""
|
85
|
+
]
|
86
|
+
}
|
87
|
+
]
|