tpmkms_4wp 9.1.1 → 9.2.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.
Files changed (65) hide show
  1. package/common/animals.instance.json +21 -8
  2. package/common/articles.js +3 -0
  3. package/common/asking.test.json +193 -72
  4. package/common/avatar.js +0 -6
  5. package/common/colors.instance.json +32 -18
  6. package/common/comparable.instance.json +3 -0
  7. package/common/comparable.js +6 -0
  8. package/common/concept.js +1 -1
  9. package/common/crew.instance.json +4885 -1224
  10. package/common/crew.js +0 -7
  11. package/common/crew.test.json +1904 -0
  12. package/common/dates.instance.json +28562 -0
  13. package/common/dates.js +152 -0
  14. package/common/dates.test.json +10239 -0
  15. package/common/dialogues.js +30 -10
  16. package/common/dimension.instance.json +3 -2
  17. package/common/edible.instance.json +1292 -517
  18. package/common/emotions.instance.json +7 -14
  19. package/common/emotions.js +4 -5
  20. package/common/events.js +3 -3
  21. package/common/events.test.json +107 -36
  22. package/common/fastfood.instance.json +4649 -13349
  23. package/common/fastfood.js +2 -1
  24. package/common/formulas.instance.json +1 -0
  25. package/common/formulas.js +3 -1
  26. package/common/formulas.test.json +643 -711
  27. package/common/gdefaults.js +14 -0
  28. package/common/helpers/concept.js +7 -2
  29. package/common/helpers/dialogues.js +4 -1
  30. package/common/helpers/menus.js +154 -0
  31. package/common/helpers/properties.js +2 -27
  32. package/common/helpers.js +57 -0
  33. package/common/hierarchy.js +4 -3
  34. package/common/kirk.instance.json +156 -10
  35. package/common/length.instance.json +17 -2
  36. package/common/math.instance.json +1 -0
  37. package/common/menus.instance.json +10097 -0
  38. package/common/menus.js +261 -0
  39. package/common/menus.test.json +27226 -0
  40. package/common/meta.js +3 -3
  41. package/common/negation.js +5 -0
  42. package/common/ordering.instance.json +4 -2
  43. package/common/people.instance.json +96 -8
  44. package/common/pipboy.instance.json +61 -135
  45. package/common/pipboy.js +0 -7
  46. package/common/pokemon.instance.json +15 -2
  47. package/common/pressure.instance.json +6 -2
  48. package/common/properties.instance.json +1 -0
  49. package/common/properties.js +20 -5
  50. package/common/punctuation.js +3 -0
  51. package/common/reports.instance.json +6 -3
  52. package/common/reports.js +12 -3
  53. package/common/sdefaults.js +28 -3
  54. package/common/spock.instance.json +156 -10
  55. package/common/stm.js +2 -1
  56. package/common/temperature.instance.json +150 -2
  57. package/common/tester.js +24 -2
  58. package/common/ui.instance.json +446 -0
  59. package/common/ui.js +9 -4
  60. package/common/ui.test.json +6794 -0
  61. package/common/weight.instance.json +14 -0
  62. package/common/wp.instance.json +6497 -9
  63. package/common/wp.js +10 -0
  64. package/main.js +4 -0
  65. package/package.json +12 -3
@@ -0,0 +1,152 @@
1
+ const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
+ const { defaultContextCheck } = require('./helpers')
3
+ const dates_tests = require('./dates.test.json')
4
+ const dates_instance = require('./dates.instance.json')
5
+ const hierarchy = require('./hierarchy')
6
+ const ordinals = require('./ordinals')
7
+ const helpers = require('./helpers')
8
+
9
+ /*
10
+ january 10 1990
11
+ january 1990
12
+ january 20th
13
+ */
14
+ const template = {
15
+ configs: [
16
+ "setidsuffix _dates",
17
+ "january, february, march, april, may, june, july, august, september, october, november and december are months",
18
+ "monday, tuesday, wednesday, thursday, friday, saturday and sunday are days",
19
+ "ac, bc, bce and ad are eras",
20
+ // "ac, bc,, bce,, and ad are eras",
21
+ /*
22
+ "bc and bce mean the same thing",
23
+ "ad is a synonym for ce",
24
+ "bc stands for before christ",
25
+ "ad synonym for anno domino",
26
+ "bce stands for before common era",
27
+ "ce is an abbreviation of common era",
28
+ "use ce and bce",
29
+ "use bc and ad",
30
+ */
31
+ {
32
+ operators: [
33
+ "([dayNumber_dates|])",
34
+ "([yearNumber_dates|])",
35
+ "([monthNumber_dates|])",
36
+ "([dateSeparator_dates|])",
37
+ "([era_dates|])",
38
+ "([date_dates|])",
39
+ "([dateEra_dates] (date_dates/*) (era_dates/*))",
40
+ "([monthDayYear_dates] (month_dates/*) (dayNumber_dates/*) (yearNumber_dates/*))",
41
+ "([monthDayYearWithSlashes_dates] (monthNumber_dates/*) (dateSeparator_dates/*) (dayNumber_dates/*) (dateSeparator_dates/*) (yearNumber_dates/*))",
42
+ ],
43
+ bridges: [
44
+ {
45
+ id: 'era_dates',
46
+ words: ['era'],
47
+ bridge: "{ ...next(operator) }"
48
+ },
49
+ {
50
+ id: 'date_dates',
51
+ words: ['date'],
52
+ bridge: "{ ...next(operator) }"
53
+ },
54
+ {
55
+ id: 'dateEra_dates',
56
+ isA: ['date_dates'],
57
+ convolution: true,
58
+ bridge: "{ ...next(after[0]), era: after[1], interpolate: concat(after[0].interpolate, ' ${era}') }"
59
+ },
60
+ {
61
+ id: 'dateSeparator_dates',
62
+ words: ['/'],
63
+ bridge: "{ ...next(operator) }"
64
+ },
65
+ {
66
+ id: 'monthDayYearWithSlashes_dates',
67
+ isA: ['date_dates'],
68
+ convolution: true,
69
+ bridge: "{ ...next(operator), day: after[2], month: after[0], year: after[4], interpolate: '${month}/${day}/${year}' }",
70
+ },
71
+ {
72
+ id: 'dayNumber_dates',
73
+ isA: ['integer'],
74
+ associations: ['dates'],
75
+ bridge: "{ ...next(operator) }"
76
+ },
77
+ {
78
+ id: 'monthNumber_dates',
79
+ isA: ['integer'],
80
+ bridge: "{ ...next(operator) }"
81
+ },
82
+ {
83
+ id: 'yearNumber_dates',
84
+ isA: ['integer'],
85
+ bridge: "{ ...next(operator) }"
86
+ },
87
+ {
88
+ id: 'monthDayYear_dates',
89
+ convolution: true,
90
+ isA: ['date_dates'],
91
+ localHierarchy: [
92
+ ['ordinal', 'dayNumber_dates'],
93
+ ],
94
+ bridge: "{ ...next(operator), month: after[0], day: after[1], year: after[2], interpolate: '${month} ${day} ${year}' }"
95
+ },
96
+ ],
97
+ words: {
98
+ patterns: [
99
+ {
100
+ pattern: [{ type: 'digit' }, { repeat: true }],
101
+ allow_partial_matches: false,
102
+ defs: [{id: "dayNumber_dates", uuid: '1', initial: "{ value: int(text), instance: true }" }]
103
+ },
104
+ {
105
+ pattern: [{ type: 'digit' }, { repeat: true }],
106
+ allow_partial_matches: false,
107
+ defs: [{id: "monthNumber_dates", uuid: '1', initial: "{ value: int(text), instance: true }" }]
108
+ },
109
+ {
110
+ pattern: [{ type: 'digit' }, { repeat: true }],
111
+ allow_partial_matches: false,
112
+ defs: [{id: "yearNumber_dates", uuid: '1', initial: "{ value: int(text), instance: true }" }]
113
+ },
114
+ ],
115
+ }
116
+ },
117
+ (args) => {
118
+ const as = ['jan', 'feb', 'mar', 'apr', 'jun', 'jul', 'aug', 'sept', 'oct', 'nov', 'dec']
119
+ const ms = ['january', 'february', 'march', 'april', 'june', 'july', 'august', 'september', 'october', 'november', 'december']
120
+ for (let i = 0; i < as.length; ++i) {
121
+ args.makeObject({...args, context: { word: as[i], value: `${as[i]}_dates`}, types: [`${ms[i]}_dates`]})
122
+ }
123
+
124
+ /*
125
+ const word = 'bc'
126
+ const synonym = 'bce'
127
+ args.makeObject({...args, context: { word: synonym, value: `${synonym}_dates`}, types: [`${word}_dates`]})
128
+ */
129
+ },
130
+ "resetIdSuffix",
131
+ ],
132
+ }
133
+
134
+ knowledgeModule( {
135
+ config: { name: 'dates' },
136
+ includes: [ordinals, hierarchy],
137
+
138
+ module,
139
+ description: 'talking about dates',
140
+ test: {
141
+ name: './dates.test.json',
142
+ contents: dates_tests,
143
+ checks: {
144
+ context: defaultContextCheck(['day', 'month', 'year', 'era']),
145
+ },
146
+ },
147
+ template: {
148
+ template,
149
+ instance: dates_instance,
150
+ },
151
+
152
+ })