@lokascript/semantic 1.0.0 → 1.1.0

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 (162) hide show
  1. package/dist/browser-ar.ar.global.js +2 -2
  2. package/dist/browser-core.core.global.js +2 -2
  3. package/dist/browser-de.de.global.js +2 -2
  4. package/dist/browser-east-asian.east-asian.global.js +2 -2
  5. package/dist/browser-en-tr.en-tr.global.js +2 -2
  6. package/dist/browser-en.en.global.js +2 -2
  7. package/dist/browser-es-en.es-en.global.js +2 -2
  8. package/dist/browser-es.es.global.js +2 -2
  9. package/dist/browser-fr.fr.global.js +2 -2
  10. package/dist/browser-id.id.global.js +2 -2
  11. package/dist/browser-ja.ja.global.js +2 -2
  12. package/dist/browser-ko.ko.global.js +2 -2
  13. package/dist/browser-lazy.lazy.global.js +2 -2
  14. package/dist/browser-priority.priority.global.js +2 -2
  15. package/dist/browser-pt.pt.global.js +2 -2
  16. package/dist/browser-qu.qu.global.js +2 -2
  17. package/dist/browser-sw.sw.global.js +2 -2
  18. package/dist/browser-tr.tr.global.js +2 -2
  19. package/dist/browser-western.western.global.js +2 -2
  20. package/dist/browser-zh.zh.global.js +2 -2
  21. package/dist/browser.global.js +2 -2
  22. package/dist/browser.global.js.map +1 -1
  23. package/dist/index.cjs +13042 -17462
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +49 -5
  26. package/dist/index.d.ts +49 -5
  27. package/dist/index.js +14044 -18464
  28. package/dist/index.js.map +1 -1
  29. package/dist/languages/ar.d.ts +1 -1
  30. package/dist/languages/ar.js +31 -44
  31. package/dist/languages/ar.js.map +1 -1
  32. package/dist/languages/de.d.ts +1 -1
  33. package/dist/languages/de.js +14 -2
  34. package/dist/languages/de.js.map +1 -1
  35. package/dist/languages/en.d.ts +1 -1
  36. package/dist/languages/en.js +558 -12
  37. package/dist/languages/en.js.map +1 -1
  38. package/dist/languages/es.d.ts +1 -1
  39. package/dist/languages/es.js +16 -0
  40. package/dist/languages/es.js.map +1 -1
  41. package/dist/languages/fr.d.ts +1 -1
  42. package/dist/languages/fr.js +14 -2
  43. package/dist/languages/fr.js.map +1 -1
  44. package/dist/languages/id.d.ts +1 -1
  45. package/dist/languages/id.js +14 -2
  46. package/dist/languages/id.js.map +1 -1
  47. package/dist/languages/ja.d.ts +1 -1
  48. package/dist/languages/ja.js +18 -3
  49. package/dist/languages/ja.js.map +1 -1
  50. package/dist/languages/ko.d.ts +8 -1
  51. package/dist/languages/ko.js +75 -43
  52. package/dist/languages/ko.js.map +1 -1
  53. package/dist/languages/pt.d.ts +1 -1
  54. package/dist/languages/pt.js +17 -0
  55. package/dist/languages/pt.js.map +1 -1
  56. package/dist/languages/qu.d.ts +12 -1
  57. package/dist/languages/qu.js +77 -2
  58. package/dist/languages/qu.js.map +1 -1
  59. package/dist/languages/sw.d.ts +1 -1
  60. package/dist/languages/sw.js.map +1 -1
  61. package/dist/languages/tr.d.ts +9 -1
  62. package/dist/languages/tr.js +96 -72
  63. package/dist/languages/tr.js.map +1 -1
  64. package/dist/languages/zh.d.ts +1 -1
  65. package/dist/languages/zh.js +16 -0
  66. package/dist/languages/zh.js.map +1 -1
  67. package/dist/{types-C4dcj53L.d.ts → types-BY3Id07j.d.ts} +20 -5
  68. package/package.json +20 -29
  69. package/src/generators/command-schemas.ts +21 -10
  70. package/src/generators/event-handler-generator.ts +50 -44
  71. package/src/generators/language-profiles.ts +6 -0
  72. package/src/generators/pattern-generator.ts +883 -1
  73. package/src/generators/profiles/arabic.ts +19 -3
  74. package/src/generators/profiles/bengali.ts +12 -1
  75. package/src/generators/profiles/chinese.ts +15 -0
  76. package/src/generators/profiles/french.ts +12 -1
  77. package/src/generators/profiles/german.ts +12 -1
  78. package/src/generators/profiles/hebrew.ts +148 -0
  79. package/src/generators/profiles/hindi.ts +12 -1
  80. package/src/generators/profiles/index.ts +2 -0
  81. package/src/generators/profiles/indonesian.ts +12 -1
  82. package/src/generators/profiles/italian.ts +16 -0
  83. package/src/generators/profiles/japanese.ts +11 -2
  84. package/src/generators/profiles/korean.ts +15 -1
  85. package/src/generators/profiles/polish.ts +12 -0
  86. package/src/generators/profiles/portuguese.ts +16 -0
  87. package/src/generators/profiles/russian.ts +11 -0
  88. package/src/generators/profiles/spanish.ts +15 -0
  89. package/src/generators/profiles/spanishMexico.ts +176 -0
  90. package/src/generators/profiles/thai.ts +11 -0
  91. package/src/generators/profiles/turkish.ts +49 -7
  92. package/src/generators/profiles/types.ts +21 -5
  93. package/src/generators/profiles/ukrainian.ts +11 -0
  94. package/src/generators/profiles/vietnamese.ts +11 -0
  95. package/src/language-building-schema.ts +111 -0
  96. package/src/languages/_all.ts +5 -1
  97. package/src/languages/es-MX.ts +32 -0
  98. package/src/languages/he.ts +15 -0
  99. package/src/parser/pattern-matcher.ts +10 -1
  100. package/src/parser/semantic-parser.ts +3 -0
  101. package/src/patterns/add/ar.ts +3 -59
  102. package/src/patterns/add/index.ts +5 -1
  103. package/src/patterns/add/ja.ts +3 -81
  104. package/src/patterns/add/ko.ts +3 -62
  105. package/src/patterns/add/qu.ts +69 -0
  106. package/src/patterns/add/tr.ts +3 -59
  107. package/src/patterns/builders.ts +1 -0
  108. package/src/patterns/decrement/tr.ts +3 -36
  109. package/src/patterns/event-handler/ar.ts +3 -139
  110. package/src/patterns/event-handler/he.ts +15 -0
  111. package/src/patterns/event-handler/index.ts +5 -1
  112. package/src/patterns/event-handler/ja.ts +3 -106
  113. package/src/patterns/event-handler/ko.ts +3 -121
  114. package/src/patterns/event-handler/ms.ts +45 -20
  115. package/src/patterns/event-handler/tr.ts +3 -158
  116. package/src/patterns/get/ar.ts +3 -37
  117. package/src/patterns/get/ja.ts +3 -41
  118. package/src/patterns/get/ko.ts +3 -41
  119. package/src/patterns/grammar-transformed/ja.ts +3 -1701
  120. package/src/patterns/grammar-transformed/ko.ts +3 -1299
  121. package/src/patterns/grammar-transformed/tr.ts +3 -1055
  122. package/src/patterns/hide/ar.ts +3 -55
  123. package/src/patterns/hide/ja.ts +3 -57
  124. package/src/patterns/hide/ko.ts +3 -57
  125. package/src/patterns/hide/tr.ts +3 -53
  126. package/src/patterns/increment/tr.ts +3 -40
  127. package/src/patterns/put/ar.ts +3 -62
  128. package/src/patterns/put/ja.ts +3 -63
  129. package/src/patterns/put/ko.ts +3 -55
  130. package/src/patterns/put/tr.ts +3 -55
  131. package/src/patterns/remove/ar.ts +3 -59
  132. package/src/patterns/remove/index.ts +5 -1
  133. package/src/patterns/remove/ja.ts +3 -62
  134. package/src/patterns/remove/ko.ts +3 -66
  135. package/src/patterns/remove/qu.ts +69 -0
  136. package/src/patterns/remove/tr.ts +3 -66
  137. package/src/patterns/set/ar.ts +3 -72
  138. package/src/patterns/set/ja.ts +3 -74
  139. package/src/patterns/set/ko.ts +3 -73
  140. package/src/patterns/set/tr.ts +3 -95
  141. package/src/patterns/show/ar.ts +3 -55
  142. package/src/patterns/show/ja.ts +3 -57
  143. package/src/patterns/show/ko.ts +3 -61
  144. package/src/patterns/show/tr.ts +3 -53
  145. package/src/patterns/take/ar.ts +3 -39
  146. package/src/patterns/toggle/ar.ts +3 -49
  147. package/src/patterns/toggle/index.ts +5 -1
  148. package/src/patterns/toggle/ja.ts +3 -144
  149. package/src/patterns/toggle/ko.ts +3 -101
  150. package/src/patterns/toggle/qu.ts +90 -0
  151. package/src/patterns/toggle/tr.ts +3 -76
  152. package/src/registry.ts +179 -15
  153. package/src/tokenizers/arabic.ts +13 -46
  154. package/src/tokenizers/bengali.ts +2 -16
  155. package/src/tokenizers/he.ts +542 -0
  156. package/src/tokenizers/index.ts +1 -0
  157. package/src/tokenizers/japanese.ts +3 -1
  158. package/src/tokenizers/korean.ts +104 -48
  159. package/src/tokenizers/ms.ts +3 -0
  160. package/src/tokenizers/quechua.ts +101 -2
  161. package/src/tokenizers/turkish.ts +64 -69
  162. package/src/types.ts +13 -0
@@ -1,14 +1,8 @@
1
1
  /**
2
2
  * Japanese Grammar-Transformed Patterns
3
3
  *
4
- * These patterns match the hybrid output from GrammarTransformer where
5
- * event and command are combined in SOV order:
6
- * English: "on click toggle .active"
7
- * Grammar output: ".active を クリック で 切り替え"
8
- *
9
- * Format: {patient} を {event-word} で {action-word}
10
- *
11
- * Tree-shakeable: Only included when Japanese is imported.
4
+ * Relying on auto-generated patterns from profile.
5
+ * Empty stub follows Hindi/Tagalog model for simpler implementation.
12
6
  */
13
7
 
14
8
  import type { LanguagePattern } from '../../types';
@@ -17,1697 +11,5 @@ import type { LanguagePattern } from '../../types';
17
11
  * Get Japanese grammar-transformed patterns.
18
12
  */
19
13
  export function getGrammarTransformedPatternsJa(): LanguagePattern[] {
20
- return [
21
- // ==========================================================================
22
- // Click + Toggle
23
- // ==========================================================================
24
- {
25
- id: 'grammar-ja-click-toggle',
26
- language: 'ja',
27
- command: 'on',
28
- priority: 75,
29
- template: {
30
- format: '{patient} を クリック で 切り替え',
31
- tokens: [
32
- { type: 'role', role: 'patient' },
33
- { type: 'literal', value: 'を' },
34
- { type: 'literal', value: 'クリック' },
35
- { type: 'literal', value: 'で' },
36
- { type: 'literal', value: '切り替え', alternatives: ['切り替える', 'トグル'] },
37
- ],
38
- },
39
- extraction: {
40
- patient: { position: 0 },
41
- event: { default: { type: 'literal', value: 'click' } },
42
- action: { default: { type: 'literal', value: 'toggle' } },
43
- },
44
- },
45
-
46
- // ==========================================================================
47
- // Click + Add
48
- // ==========================================================================
49
- {
50
- id: 'grammar-ja-click-add',
51
- language: 'ja',
52
- command: 'on',
53
- priority: 75,
54
- template: {
55
- format: '{patient} を クリック で 追加',
56
- tokens: [
57
- { type: 'role', role: 'patient' },
58
- { type: 'literal', value: 'を' },
59
- { type: 'literal', value: 'クリック' },
60
- { type: 'literal', value: 'で' },
61
- { type: 'literal', value: '追加', alternatives: ['追加する', '付ける'] },
62
- ],
63
- },
64
- extraction: {
65
- patient: { position: 0 },
66
- event: { default: { type: 'literal', value: 'click' } },
67
- action: { default: { type: 'literal', value: 'add' } },
68
- },
69
- },
70
-
71
- // ==========================================================================
72
- // Click + Remove
73
- // ==========================================================================
74
- {
75
- id: 'grammar-ja-click-remove',
76
- language: 'ja',
77
- command: 'on',
78
- priority: 75,
79
- template: {
80
- format: '{patient} を クリック で 削除',
81
- tokens: [
82
- { type: 'role', role: 'patient' },
83
- { type: 'literal', value: 'を' },
84
- { type: 'literal', value: 'クリック' },
85
- { type: 'literal', value: 'で' },
86
- { type: 'literal', value: '削除', alternatives: ['削除する', '外す', '取る'] },
87
- ],
88
- },
89
- extraction: {
90
- patient: { position: 0 },
91
- event: { default: { type: 'literal', value: 'click' } },
92
- action: { default: { type: 'literal', value: 'remove' } },
93
- },
94
- },
95
-
96
- // ==========================================================================
97
- // Click + Increment
98
- // ==========================================================================
99
- {
100
- id: 'grammar-ja-click-increment',
101
- language: 'ja',
102
- command: 'on',
103
- priority: 75,
104
- template: {
105
- format: '{patient} を クリック で 増加',
106
- tokens: [
107
- { type: 'role', role: 'patient' },
108
- { type: 'literal', value: 'を' },
109
- { type: 'literal', value: 'クリック' },
110
- { type: 'literal', value: 'で' },
111
- { type: 'literal', value: '増加', alternatives: ['増加する', '増やす'] },
112
- ],
113
- },
114
- extraction: {
115
- patient: { position: 0 },
116
- event: { default: { type: 'literal', value: 'click' } },
117
- action: { default: { type: 'literal', value: 'increment' } },
118
- },
119
- },
120
-
121
- // ==========================================================================
122
- // Click + Show
123
- // ==========================================================================
124
- {
125
- id: 'grammar-ja-click-show',
126
- language: 'ja',
127
- command: 'on',
128
- priority: 75,
129
- template: {
130
- format: '{patient} を クリック で 表示',
131
- tokens: [
132
- { type: 'role', role: 'patient' },
133
- { type: 'literal', value: 'を' },
134
- { type: 'literal', value: 'クリック' },
135
- { type: 'literal', value: 'で' },
136
- { type: 'literal', value: '表示', alternatives: ['表示する', '見せる'] },
137
- ],
138
- },
139
- extraction: {
140
- patient: { position: 0 },
141
- event: { default: { type: 'literal', value: 'click' } },
142
- action: { default: { type: 'literal', value: 'show' } },
143
- },
144
- },
145
-
146
- // ==========================================================================
147
- // Click + Hide
148
- // ==========================================================================
149
- {
150
- id: 'grammar-ja-click-hide',
151
- language: 'ja',
152
- command: 'on',
153
- priority: 75,
154
- template: {
155
- format: '{patient} を クリック で 隠す',
156
- tokens: [
157
- { type: 'role', role: 'patient' },
158
- { type: 'literal', value: 'を' },
159
- { type: 'literal', value: 'クリック' },
160
- { type: 'literal', value: 'で' },
161
- { type: 'literal', value: '隠す', alternatives: ['非表示', '隠れる'] },
162
- ],
163
- },
164
- extraction: {
165
- patient: { position: 0 },
166
- event: { default: { type: 'literal', value: 'click' } },
167
- action: { default: { type: 'literal', value: 'hide' } },
168
- },
169
- },
170
-
171
- // ==========================================================================
172
- // Click + Set
173
- // ==========================================================================
174
- {
175
- id: 'grammar-ja-click-set',
176
- language: 'ja',
177
- command: 'on',
178
- priority: 75,
179
- template: {
180
- format: '{patient} を クリック で 設定',
181
- tokens: [
182
- { type: 'role', role: 'patient' },
183
- { type: 'literal', value: 'を' },
184
- { type: 'literal', value: 'クリック' },
185
- { type: 'literal', value: 'で' },
186
- { type: 'literal', value: '設定', alternatives: ['設定する', 'セット'] },
187
- ],
188
- },
189
- extraction: {
190
- patient: { position: 0 },
191
- event: { default: { type: 'literal', value: 'click' } },
192
- action: { default: { type: 'literal', value: 'set' } },
193
- },
194
- },
195
-
196
- // ==========================================================================
197
- // Click + Decrement
198
- // ==========================================================================
199
- {
200
- id: 'grammar-ja-click-decrement',
201
- language: 'ja',
202
- command: 'on',
203
- priority: 75,
204
- template: {
205
- format: '{patient} を クリック で 減少',
206
- tokens: [
207
- { type: 'role', role: 'patient' },
208
- { type: 'literal', value: 'を' },
209
- { type: 'literal', value: 'クリック' },
210
- { type: 'literal', value: 'で' },
211
- { type: 'literal', value: '減少', alternatives: ['減少する', '減らす'] },
212
- ],
213
- },
214
- extraction: {
215
- patient: { position: 0 },
216
- event: { default: { type: 'literal', value: 'click' } },
217
- action: { default: { type: 'literal', value: 'decrement' } },
218
- },
219
- },
220
-
221
- // ==========================================================================
222
- // DESTINATION PATTERNS (higher priority)
223
- // ==========================================================================
224
-
225
- // Click + Set with destination: "{destination} を クリック で 設定 {patient} に"
226
- {
227
- id: 'grammar-ja-click-set-destination',
228
- language: 'ja',
229
- command: 'on',
230
- priority: 80,
231
- template: {
232
- format: '{destination} を クリック で 設定 {patient} に',
233
- tokens: [
234
- { type: 'role', role: 'destination' },
235
- { type: 'literal', value: 'を' },
236
- { type: 'literal', value: 'クリック' },
237
- { type: 'literal', value: 'で' },
238
- { type: 'literal', value: '設定', alternatives: ['設定する'] },
239
- { type: 'role', role: 'patient' },
240
- { type: 'literal', value: 'に' },
241
- ],
242
- },
243
- extraction: {
244
- destination: { position: 0 },
245
- patient: { marker: 'に' },
246
- event: { default: { type: 'literal', value: 'click' } },
247
- action: { default: { type: 'literal', value: 'set' } },
248
- },
249
- },
250
-
251
- // Click + Put with destination: "{patient} を クリック で 置く {destination} に"
252
- {
253
- id: 'grammar-ja-click-put-destination',
254
- language: 'ja',
255
- command: 'on',
256
- priority: 80,
257
- template: {
258
- format: '{patient} を クリック で 置く {destination} に',
259
- tokens: [
260
- { type: 'role', role: 'patient' },
261
- { type: 'literal', value: 'を' },
262
- { type: 'literal', value: 'クリック' },
263
- { type: 'literal', value: 'で' },
264
- { type: 'literal', value: '置く', alternatives: ['入れる'] },
265
- { type: 'role', role: 'destination' },
266
- { type: 'literal', value: 'に' },
267
- ],
268
- },
269
- extraction: {
270
- patient: { position: 0 },
271
- destination: { marker: 'に' },
272
- event: { default: { type: 'literal', value: 'click' } },
273
- action: { default: { type: 'literal', value: 'put' } },
274
- },
275
- },
276
-
277
- // Click + Add with destination: "{patient} を クリック で 追加 {destination} に"
278
- {
279
- id: 'grammar-ja-click-add-destination',
280
- language: 'ja',
281
- command: 'on',
282
- priority: 80,
283
- template: {
284
- format: '{patient} を クリック で 追加 {destination} に',
285
- tokens: [
286
- { type: 'role', role: 'patient' },
287
- { type: 'literal', value: 'を' },
288
- { type: 'literal', value: 'クリック' },
289
- { type: 'literal', value: 'で' },
290
- { type: 'literal', value: '追加', alternatives: ['末尾追加'] },
291
- { type: 'role', role: 'destination' },
292
- { type: 'literal', value: 'に' },
293
- ],
294
- },
295
- extraction: {
296
- patient: { position: 0 },
297
- destination: { marker: 'に' },
298
- event: { default: { type: 'literal', value: 'click' } },
299
- action: { default: { type: 'literal', value: 'add' } },
300
- },
301
- },
302
-
303
- // Click + Show with style: "{patient} を クリック で 表示 {style} で"
304
- {
305
- id: 'grammar-ja-click-show-style',
306
- language: 'ja',
307
- command: 'on',
308
- priority: 80,
309
- template: {
310
- format: '{patient} を クリック で 表示 {style} で',
311
- tokens: [
312
- { type: 'role', role: 'patient' },
313
- { type: 'literal', value: 'を' },
314
- { type: 'literal', value: 'クリック' },
315
- { type: 'literal', value: 'で' },
316
- { type: 'literal', value: '表示', alternatives: ['見せる'] },
317
- { type: 'role', role: 'style' },
318
- { type: 'literal', value: 'で' },
319
- ],
320
- },
321
- extraction: {
322
- patient: { position: 0 },
323
- style: { position: 5 },
324
- event: { default: { type: 'literal', value: 'click' } },
325
- action: { default: { type: 'literal', value: 'show' } },
326
- },
327
- },
328
-
329
- // Click + Hide with style: "{patient} を クリック で 隠す {style} で"
330
- {
331
- id: 'grammar-ja-click-hide-style',
332
- language: 'ja',
333
- command: 'on',
334
- priority: 80,
335
- template: {
336
- format: '{patient} を クリック で 隠す {style} で',
337
- tokens: [
338
- { type: 'role', role: 'patient' },
339
- { type: 'literal', value: 'を' },
340
- { type: 'literal', value: 'クリック' },
341
- { type: 'literal', value: 'で' },
342
- { type: 'literal', value: '隠す', alternatives: ['非表示'] },
343
- { type: 'role', role: 'style' },
344
- { type: 'literal', value: 'で' },
345
- ],
346
- },
347
- extraction: {
348
- patient: { position: 0 },
349
- style: { position: 5 },
350
- event: { default: { type: 'literal', value: 'click' } },
351
- action: { default: { type: 'literal', value: 'hide' } },
352
- },
353
- },
354
-
355
- // ==========================================================================
356
- // THEN-CHAIN PATTERNS (with continuation marker)
357
- // Japanese uses "それから" (sorekara) for "then"
358
- // ==========================================================================
359
-
360
- // Click + Wait then: "{duration} を クリック で 待つ それから"
361
- {
362
- id: 'grammar-ja-click-wait-then',
363
- language: 'ja',
364
- command: 'on',
365
- priority: 85,
366
- template: {
367
- format: '{duration} を クリック で 待つ それから',
368
- tokens: [
369
- { type: 'role', role: 'duration' },
370
- { type: 'literal', value: 'を' },
371
- { type: 'literal', value: 'クリック' },
372
- { type: 'literal', value: 'で' },
373
- { type: 'literal', value: '待つ', alternatives: ['待ち'] },
374
- { type: 'literal', value: 'それから', alternatives: ['次に', 'そして'] },
375
- ],
376
- },
377
- extraction: {
378
- duration: { position: 0 },
379
- event: { default: { type: 'literal', value: 'click' } },
380
- action: { default: { type: 'literal', value: 'wait' } },
381
- continues: { default: { type: 'literal', value: 'then' } },
382
- },
383
- },
384
-
385
- // Click + Toggle then: "{patient} を クリック で 切り替え それから"
386
- {
387
- id: 'grammar-ja-click-toggle-then',
388
- language: 'ja',
389
- command: 'on',
390
- priority: 85,
391
- template: {
392
- format: '{patient} を クリック で 切り替え それから',
393
- tokens: [
394
- { type: 'role', role: 'patient' },
395
- { type: 'literal', value: 'を' },
396
- { type: 'literal', value: 'クリック' },
397
- { type: 'literal', value: 'で' },
398
- { type: 'literal', value: '切り替え', alternatives: ['トグル'] },
399
- { type: 'literal', value: 'それから', alternatives: ['次に', 'そして'] },
400
- ],
401
- },
402
- extraction: {
403
- patient: { position: 0 },
404
- event: { default: { type: 'literal', value: 'click' } },
405
- action: { default: { type: 'literal', value: 'toggle' } },
406
- continues: { default: { type: 'literal', value: 'then' } },
407
- },
408
- },
409
-
410
- // Click + Add then: "{patient} を クリック で 追加 それから"
411
- {
412
- id: 'grammar-ja-click-add-then',
413
- language: 'ja',
414
- command: 'on',
415
- priority: 85,
416
- template: {
417
- format: '{patient} を クリック で 追加 それから',
418
- tokens: [
419
- { type: 'role', role: 'patient' },
420
- { type: 'literal', value: 'を' },
421
- { type: 'literal', value: 'クリック' },
422
- { type: 'literal', value: 'で' },
423
- { type: 'literal', value: '追加', alternatives: ['追加する'] },
424
- { type: 'literal', value: 'それから', alternatives: ['次に', 'そして'] },
425
- ],
426
- },
427
- extraction: {
428
- patient: { position: 0 },
429
- event: { default: { type: 'literal', value: 'click' } },
430
- action: { default: { type: 'literal', value: 'add' } },
431
- continues: { default: { type: 'literal', value: 'then' } },
432
- },
433
- },
434
-
435
- // Click + Remove then: "{patient} を クリック で 削除 それから"
436
- {
437
- id: 'grammar-ja-click-remove-then',
438
- language: 'ja',
439
- command: 'on',
440
- priority: 85,
441
- template: {
442
- format: '{patient} を クリック で 削除 それから',
443
- tokens: [
444
- { type: 'role', role: 'patient' },
445
- { type: 'literal', value: 'を' },
446
- { type: 'literal', value: 'クリック' },
447
- { type: 'literal', value: 'で' },
448
- { type: 'literal', value: '削除', alternatives: ['削除する'] },
449
- { type: 'literal', value: 'それから', alternatives: ['次に', 'そして'] },
450
- ],
451
- },
452
- extraction: {
453
- patient: { position: 0 },
454
- event: { default: { type: 'literal', value: 'click' } },
455
- action: { default: { type: 'literal', value: 'remove' } },
456
- continues: { default: { type: 'literal', value: 'then' } },
457
- },
458
- },
459
-
460
- // Click + Show then: "{patient} を クリック で 表示 それから"
461
- {
462
- id: 'grammar-ja-click-show-then',
463
- language: 'ja',
464
- command: 'on',
465
- priority: 85,
466
- template: {
467
- format: '{patient} を クリック で 表示 それから',
468
- tokens: [
469
- { type: 'role', role: 'patient' },
470
- { type: 'literal', value: 'を' },
471
- { type: 'literal', value: 'クリック' },
472
- { type: 'literal', value: 'で' },
473
- { type: 'literal', value: '表示', alternatives: ['見せる'] },
474
- { type: 'literal', value: 'それから', alternatives: ['次に', 'そして'] },
475
- ],
476
- },
477
- extraction: {
478
- patient: { position: 0 },
479
- event: { default: { type: 'literal', value: 'click' } },
480
- action: { default: { type: 'literal', value: 'show' } },
481
- continues: { default: { type: 'literal', value: 'then' } },
482
- },
483
- },
484
-
485
- // Click + Hide then: "{patient} を クリック で 隠す それから"
486
- {
487
- id: 'grammar-ja-click-hide-then',
488
- language: 'ja',
489
- command: 'on',
490
- priority: 85,
491
- template: {
492
- format: '{patient} を クリック で 隠す それから',
493
- tokens: [
494
- { type: 'role', role: 'patient' },
495
- { type: 'literal', value: 'を' },
496
- { type: 'literal', value: 'クリック' },
497
- { type: 'literal', value: 'で' },
498
- { type: 'literal', value: '隠す', alternatives: ['非表示'] },
499
- { type: 'literal', value: 'それから', alternatives: ['次に', 'そして'] },
500
- ],
501
- },
502
- extraction: {
503
- patient: { position: 0 },
504
- event: { default: { type: 'literal', value: 'click' } },
505
- action: { default: { type: 'literal', value: 'hide' } },
506
- continues: { default: { type: 'literal', value: 'then' } },
507
- },
508
- },
509
-
510
- // ==========================================================================
511
- // CONTINUATION PATTERNS (for body after then)
512
- // These match commands that follow the "それから" keyword
513
- // ==========================================================================
514
-
515
- // Remove continuation: "{patient} を 削除"
516
- {
517
- id: 'grammar-ja-remove-continuation',
518
- language: 'ja',
519
- command: 'remove',
520
- priority: 70,
521
- template: {
522
- format: '{patient} を 削除',
523
- tokens: [
524
- { type: 'role', role: 'patient' },
525
- { type: 'literal', value: 'を' },
526
- { type: 'literal', value: '削除', alternatives: ['削除する', '外す', '取る'] },
527
- ],
528
- },
529
- extraction: {
530
- patient: { position: 0 },
531
- action: { default: { type: 'literal', value: 'remove' } },
532
- },
533
- },
534
-
535
- // Toggle continuation: "{patient} を 切り替え"
536
- {
537
- id: 'grammar-ja-toggle-continuation',
538
- language: 'ja',
539
- command: 'toggle',
540
- priority: 70,
541
- template: {
542
- format: '{patient} を 切り替え',
543
- tokens: [
544
- { type: 'role', role: 'patient' },
545
- { type: 'literal', value: 'を' },
546
- { type: 'literal', value: '切り替え', alternatives: ['切り替える', 'トグル'] },
547
- ],
548
- },
549
- extraction: {
550
- patient: { position: 0 },
551
- action: { default: { type: 'literal', value: 'toggle' } },
552
- },
553
- },
554
-
555
- // Add continuation: "{patient} を 追加"
556
- {
557
- id: 'grammar-ja-add-continuation',
558
- language: 'ja',
559
- command: 'add',
560
- priority: 70,
561
- template: {
562
- format: '{patient} を 追加',
563
- tokens: [
564
- { type: 'role', role: 'patient' },
565
- { type: 'literal', value: 'を' },
566
- { type: 'literal', value: '追加', alternatives: ['追加する'] },
567
- ],
568
- },
569
- extraction: {
570
- patient: { position: 0 },
571
- action: { default: { type: 'literal', value: 'add' } },
572
- },
573
- },
574
-
575
- // Show continuation: "{patient} を 表示"
576
- {
577
- id: 'grammar-ja-show-continuation',
578
- language: 'ja',
579
- command: 'show',
580
- priority: 70,
581
- template: {
582
- format: '{patient} を 表示',
583
- tokens: [
584
- { type: 'role', role: 'patient' },
585
- { type: 'literal', value: 'を' },
586
- { type: 'literal', value: '表示', alternatives: ['表示する', '見せる'] },
587
- ],
588
- },
589
- extraction: {
590
- patient: { position: 0 },
591
- action: { default: { type: 'literal', value: 'show' } },
592
- },
593
- },
594
-
595
- // Hide continuation: "{patient} を 隠す"
596
- {
597
- id: 'grammar-ja-hide-continuation',
598
- language: 'ja',
599
- command: 'hide',
600
- priority: 70,
601
- template: {
602
- format: '{patient} を 隠す',
603
- tokens: [
604
- { type: 'role', role: 'patient' },
605
- { type: 'literal', value: 'を' },
606
- { type: 'literal', value: '隠す', alternatives: ['非表示', '隠れる'] },
607
- ],
608
- },
609
- extraction: {
610
- patient: { position: 0 },
611
- action: { default: { type: 'literal', value: 'hide' } },
612
- },
613
- },
614
-
615
- // Put into continuation: "{patient} を {destination} に 置く"
616
- {
617
- id: 'grammar-ja-put-continuation',
618
- language: 'ja',
619
- command: 'put',
620
- priority: 72,
621
- template: {
622
- format: '{patient} を {destination} に 置く',
623
- tokens: [
624
- { type: 'role', role: 'patient' },
625
- { type: 'literal', value: 'を' },
626
- { type: 'role', role: 'destination' },
627
- { type: 'literal', value: 'に' },
628
- { type: 'literal', value: '置く', alternatives: ['入れる'] },
629
- ],
630
- },
631
- extraction: {
632
- patient: { position: 0 },
633
- destination: { marker: 'に' },
634
- action: { default: { type: 'literal', value: 'put' } },
635
- },
636
- },
637
-
638
- // ==========================================================================
639
- // PUT BEFORE/AFTER PATTERNS
640
- // ==========================================================================
641
-
642
- // Click + Put before: "{value} 前に {target} を クリック で 置く"
643
- {
644
- id: 'grammar-ja-click-put-before',
645
- language: 'ja',
646
- command: 'on',
647
- priority: 78,
648
- template: {
649
- format: '{patient} 前に {destination} を クリック で 置く',
650
- tokens: [
651
- { type: 'role', role: 'patient' },
652
- { type: 'literal', value: '前に' },
653
- { type: 'role', role: 'destination' },
654
- { type: 'literal', value: 'を' },
655
- { type: 'literal', value: 'クリック' },
656
- { type: 'literal', value: 'で' },
657
- { type: 'literal', value: '置く', alternatives: ['入れる'] },
658
- ],
659
- },
660
- extraction: {
661
- patient: { position: 0 },
662
- destination: { position: 1 },
663
- event: { default: { type: 'literal', value: 'click' } },
664
- action: { default: { type: 'literal', value: 'put' } },
665
- position: { default: { type: 'literal', value: 'before' } },
666
- },
667
- },
668
-
669
- // Click + Put after: "{value} 後に {target} を クリック で 置く"
670
- {
671
- id: 'grammar-ja-click-put-after',
672
- language: 'ja',
673
- command: 'on',
674
- priority: 78,
675
- template: {
676
- format: '{patient} 後に {destination} を クリック で 置く',
677
- tokens: [
678
- { type: 'role', role: 'patient' },
679
- { type: 'literal', value: '後に' },
680
- { type: 'role', role: 'destination' },
681
- { type: 'literal', value: 'を' },
682
- { type: 'literal', value: 'クリック' },
683
- { type: 'literal', value: 'で' },
684
- { type: 'literal', value: '置く', alternatives: ['入れる'] },
685
- ],
686
- },
687
- extraction: {
688
- patient: { position: 0 },
689
- destination: { position: 1 },
690
- event: { default: { type: 'literal', value: 'click' } },
691
- action: { default: { type: 'literal', value: 'put' } },
692
- position: { default: { type: 'literal', value: 'after' } },
693
- },
694
- },
695
-
696
- // ==========================================================================
697
- // FETCH PATTERNS
698
- // ==========================================================================
699
-
700
- // Click + Fetch: "{source} を クリック で 取得"
701
- {
702
- id: 'grammar-ja-click-fetch',
703
- language: 'ja',
704
- command: 'on',
705
- priority: 75,
706
- template: {
707
- format: '{source} を クリック で 取得',
708
- tokens: [
709
- { type: 'role', role: 'source' },
710
- { type: 'literal', value: 'を' },
711
- { type: 'literal', value: 'クリック' },
712
- { type: 'literal', value: 'で' },
713
- { type: 'literal', value: '取得', alternatives: ['フェッチ', '取る'] },
714
- ],
715
- },
716
- extraction: {
717
- source: { position: 0 },
718
- event: { default: { type: 'literal', value: 'click' } },
719
- action: { default: { type: 'literal', value: 'fetch' } },
720
- },
721
- },
722
-
723
- // Click + Fetch then: "{source} を クリック で 取得 それから"
724
- {
725
- id: 'grammar-ja-click-fetch-then',
726
- language: 'ja',
727
- command: 'on',
728
- priority: 85,
729
- template: {
730
- format: '{source} を クリック で 取得 それから',
731
- tokens: [
732
- { type: 'role', role: 'source' },
733
- { type: 'literal', value: 'を' },
734
- { type: 'literal', value: 'クリック' },
735
- { type: 'literal', value: 'で' },
736
- { type: 'literal', value: '取得', alternatives: ['フェッチ', '取る'] },
737
- { type: 'literal', value: 'それから', alternatives: ['次に', 'そして'] },
738
- ],
739
- },
740
- extraction: {
741
- source: { position: 0 },
742
- event: { default: { type: 'literal', value: 'click' } },
743
- action: { default: { type: 'literal', value: 'fetch' } },
744
- continues: { default: { type: 'literal', value: 'then' } },
745
- },
746
- },
747
-
748
- // ==========================================================================
749
- // TRANSITION PATTERNS
750
- // ==========================================================================
751
-
752
- // Click + Transition: "{property} を クリック で 遷移 {value} に {duration}"
753
- {
754
- id: 'grammar-ja-click-transition',
755
- language: 'ja',
756
- command: 'on',
757
- priority: 77,
758
- template: {
759
- format: '{patient} を クリック で 遷移 {value} に {duration}',
760
- tokens: [
761
- { type: 'role', role: 'patient' },
762
- { type: 'literal', value: 'を' },
763
- { type: 'literal', value: 'クリック' },
764
- { type: 'literal', value: 'で' },
765
- { type: 'literal', value: '遷移', alternatives: ['アニメーション', '推移'] },
766
- { type: 'role', role: 'goal' },
767
- { type: 'literal', value: 'に' },
768
- { type: 'role', role: 'duration' },
769
- ],
770
- },
771
- extraction: {
772
- patient: { position: 0 },
773
- goal: { position: 1 },
774
- duration: { position: 2 },
775
- event: { default: { type: 'literal', value: 'click' } },
776
- action: { default: { type: 'literal', value: 'transition' } },
777
- },
778
- },
779
-
780
- // Click + Transition then: "{property} を クリック で 遷移 {value} に {duration} それから"
781
- {
782
- id: 'grammar-ja-click-transition-then',
783
- language: 'ja',
784
- command: 'on',
785
- priority: 87,
786
- template: {
787
- format: '{patient} を クリック で 遷移 {value} に {duration} それから',
788
- tokens: [
789
- { type: 'role', role: 'patient' },
790
- { type: 'literal', value: 'を' },
791
- { type: 'literal', value: 'クリック' },
792
- { type: 'literal', value: 'で' },
793
- { type: 'literal', value: '遷移', alternatives: ['アニメーション', '推移'] },
794
- { type: 'role', role: 'goal' },
795
- { type: 'literal', value: 'に' },
796
- { type: 'role', role: 'duration' },
797
- { type: 'literal', value: 'それから', alternatives: ['次に', 'そして'] },
798
- ],
799
- },
800
- extraction: {
801
- patient: { position: 0 },
802
- goal: { position: 1 },
803
- duration: { position: 2 },
804
- event: { default: { type: 'literal', value: 'click' } },
805
- action: { default: { type: 'literal', value: 'transition' } },
806
- continues: { default: { type: 'literal', value: 'then' } },
807
- },
808
- },
809
-
810
- // ==========================================================================
811
- // SEND PATTERNS
812
- // ==========================================================================
813
-
814
- // Click + Send: "{message} を クリック で 送る {target} に"
815
- {
816
- id: 'grammar-ja-click-send',
817
- language: 'ja',
818
- command: 'on',
819
- priority: 77,
820
- template: {
821
- format: '{patient} を クリック で 送る {destination} に',
822
- tokens: [
823
- { type: 'role', role: 'patient' },
824
- { type: 'literal', value: 'を' },
825
- { type: 'literal', value: 'クリック' },
826
- { type: 'literal', value: 'で' },
827
- { type: 'literal', value: '送る', alternatives: ['送信', '送り'] },
828
- { type: 'role', role: 'destination' },
829
- { type: 'literal', value: 'に' },
830
- ],
831
- },
832
- extraction: {
833
- patient: { position: 0 },
834
- destination: { position: 1 },
835
- event: { default: { type: 'literal', value: 'click' } },
836
- action: { default: { type: 'literal', value: 'send' } },
837
- },
838
- },
839
-
840
- // ==========================================================================
841
- // TRIGGER PATTERNS
842
- // ==========================================================================
843
-
844
- // Load + Trigger: "{event} を 読み込み で 引き金"
845
- {
846
- id: 'grammar-ja-load-trigger',
847
- language: 'ja',
848
- command: 'on',
849
- priority: 75,
850
- template: {
851
- format: '{patient} を 読み込み で 引き金',
852
- tokens: [
853
- { type: 'role', role: 'patient' },
854
- { type: 'literal', value: 'を' },
855
- { type: 'literal', value: '読み込み', alternatives: ['ロード'] },
856
- { type: 'literal', value: 'で' },
857
- { type: 'literal', value: '引き金', alternatives: ['トリガー', '発動'] },
858
- ],
859
- },
860
- extraction: {
861
- patient: { position: 0 },
862
- event: { default: { type: 'literal', value: 'load' } },
863
- action: { default: { type: 'literal', value: 'trigger' } },
864
- },
865
- },
866
-
867
- // ==========================================================================
868
- // FOCUS PATTERNS
869
- // ==========================================================================
870
-
871
- // Click + Focus: "{target} を クリック で フォーカス"
872
- {
873
- id: 'grammar-ja-click-focus',
874
- language: 'ja',
875
- command: 'on',
876
- priority: 75,
877
- template: {
878
- format: '{patient} を クリック で フォーカス',
879
- tokens: [
880
- { type: 'role', role: 'patient' },
881
- { type: 'literal', value: 'を' },
882
- { type: 'literal', value: 'クリック' },
883
- { type: 'literal', value: 'で' },
884
- { type: 'literal', value: 'フォーカス', alternatives: ['集中', '焦点'] },
885
- ],
886
- },
887
- extraction: {
888
- patient: { position: 0 },
889
- event: { default: { type: 'literal', value: 'click' } },
890
- action: { default: { type: 'literal', value: 'focus' } },
891
- },
892
- },
893
-
894
- // ==========================================================================
895
- // LOG PATTERNS
896
- // ==========================================================================
897
-
898
- // Click + Log: "{message} を クリック で 記録"
899
- {
900
- id: 'grammar-ja-click-log',
901
- language: 'ja',
902
- command: 'on',
903
- priority: 75,
904
- template: {
905
- format: '{patient} を クリック で 記録',
906
- tokens: [
907
- { type: 'role', role: 'patient' },
908
- { type: 'literal', value: 'を' },
909
- { type: 'literal', value: 'クリック' },
910
- { type: 'literal', value: 'で' },
911
- { type: 'literal', value: '記録', alternatives: ['ログ', '出力'] },
912
- ],
913
- },
914
- extraction: {
915
- patient: { position: 0 },
916
- event: { default: { type: 'literal', value: 'click' } },
917
- action: { default: { type: 'literal', value: 'log' } },
918
- },
919
- },
920
-
921
- // ==========================================================================
922
- // GO/NAVIGATE PATTERNS
923
- // ==========================================================================
924
-
925
- // Click + Go back: "back を クリック で 移動"
926
- {
927
- id: 'grammar-ja-click-go-back',
928
- language: 'ja',
929
- command: 'on',
930
- priority: 75,
931
- template: {
932
- format: 'back を クリック で 移動',
933
- tokens: [
934
- { type: 'literal', value: 'back' },
935
- { type: 'literal', value: 'を' },
936
- { type: 'literal', value: 'クリック' },
937
- { type: 'literal', value: 'で' },
938
- { type: 'literal', value: '移動', alternatives: ['いく', 'ナビゲート'] },
939
- ],
940
- },
941
- extraction: {
942
- destination: { default: { type: 'literal', value: 'back' } },
943
- event: { default: { type: 'literal', value: 'click' } },
944
- action: { default: { type: 'literal', value: 'go' } },
945
- },
946
- },
947
-
948
- // ==========================================================================
949
- // CALL PATTERNS
950
- // ==========================================================================
951
-
952
- // Click + Call: "{function} を クリック で 呼び出し"
953
- {
954
- id: 'grammar-ja-click-call',
955
- language: 'ja',
956
- command: 'on',
957
- priority: 75,
958
- template: {
959
- format: '{patient} を クリック で 呼び出し',
960
- tokens: [
961
- { type: 'role', role: 'patient' },
962
- { type: 'literal', value: 'を' },
963
- { type: 'literal', value: 'クリック' },
964
- { type: 'literal', value: 'で' },
965
- { type: 'literal', value: '呼び出し', alternatives: ['コール', '呼ぶ'] },
966
- ],
967
- },
968
- extraction: {
969
- patient: { position: 0 },
970
- event: { default: { type: 'literal', value: 'click' } },
971
- action: { default: { type: 'literal', value: 'call' } },
972
- },
973
- },
974
-
975
- // ==========================================================================
976
- // BLUR PATTERNS
977
- // ==========================================================================
978
-
979
- // Keydown + Blur: "{target} を {event} で ぼかし"
980
- {
981
- id: 'grammar-ja-keydown-blur',
982
- language: 'ja',
983
- command: 'on',
984
- priority: 75,
985
- template: {
986
- format: '{patient} を {event} で ぼかし',
987
- tokens: [
988
- { type: 'role', role: 'patient' },
989
- { type: 'literal', value: 'を' },
990
- { type: 'role', role: 'event' },
991
- { type: 'literal', value: 'で' },
992
- { type: 'literal', value: 'ぼかし', alternatives: ['ブラー', 'ぼかす'] },
993
- ],
994
- },
995
- extraction: {
996
- patient: { position: 0 },
997
- event: { position: 1 },
998
- action: { default: { type: 'literal', value: 'blur' } },
999
- },
1000
- },
1001
-
1002
- // ==========================================================================
1003
- // GET PATTERNS
1004
- // ==========================================================================
1005
-
1006
- // Click + Get: "{target} を クリック で 取得"
1007
- {
1008
- id: 'grammar-ja-click-get',
1009
- language: 'ja',
1010
- command: 'on',
1011
- priority: 75,
1012
- template: {
1013
- format: '{patient} を クリック で 取得',
1014
- tokens: [
1015
- { type: 'role', role: 'patient' },
1016
- { type: 'literal', value: 'を' },
1017
- { type: 'literal', value: 'クリック' },
1018
- { type: 'literal', value: 'で' },
1019
- { type: 'literal', value: '取得', alternatives: ['ゲット', '得る'] },
1020
- ],
1021
- },
1022
- extraction: {
1023
- patient: { position: 0 },
1024
- event: { default: { type: 'literal', value: 'click' } },
1025
- action: { default: { type: 'literal', value: 'get' } },
1026
- },
1027
- },
1028
-
1029
- // Click + Get then: "{target} を クリック で 取得 それから"
1030
- {
1031
- id: 'grammar-ja-click-get-then',
1032
- language: 'ja',
1033
- command: 'on',
1034
- priority: 85,
1035
- template: {
1036
- format: '{patient} を クリック で 取得 それから',
1037
- tokens: [
1038
- { type: 'role', role: 'patient' },
1039
- { type: 'literal', value: 'を' },
1040
- { type: 'literal', value: 'クリック' },
1041
- { type: 'literal', value: 'で' },
1042
- { type: 'literal', value: '取得', alternatives: ['ゲット', '得る'] },
1043
- { type: 'literal', value: 'それから', alternatives: ['次に', 'そして'] },
1044
- ],
1045
- },
1046
- extraction: {
1047
- patient: { position: 0 },
1048
- event: { default: { type: 'literal', value: 'click' } },
1049
- action: { default: { type: 'literal', value: 'get' } },
1050
- continues: { default: { type: 'literal', value: 'then' } },
1051
- },
1052
- },
1053
-
1054
- // ==========================================================================
1055
- // DEFAULT PATTERNS (load event)
1056
- // ==========================================================================
1057
-
1058
- // Load + Default: "{patient} を 読み込み で 既定 {goal} に"
1059
- {
1060
- id: 'grammar-ja-load-default',
1061
- language: 'ja',
1062
- command: 'on',
1063
- priority: 75,
1064
- template: {
1065
- format: '{patient} を 読み込み で 既定 {goal} に',
1066
- tokens: [
1067
- { type: 'role', role: 'patient' },
1068
- { type: 'literal', value: 'を' },
1069
- { type: 'literal', value: '読み込み', alternatives: ['ロード'] },
1070
- { type: 'literal', value: 'で' },
1071
- { type: 'literal', value: '既定', alternatives: ['デフォルト', '規定'] },
1072
- { type: 'role', role: 'goal' },
1073
- { type: 'literal', value: 'に' },
1074
- ],
1075
- },
1076
- extraction: {
1077
- patient: { position: 0 },
1078
- goal: { position: 1 },
1079
- event: { default: { type: 'literal', value: 'load' } },
1080
- action: { default: { type: 'literal', value: 'default' } },
1081
- },
1082
- },
1083
-
1084
- // ==========================================================================
1085
- // WAIT FOR EVENT PATTERNS
1086
- // ==========================================================================
1087
-
1088
- // Click + Wait for event: "2s を クリック で 待つ それから"
1089
- {
1090
- id: 'grammar-ja-click-wait-then',
1091
- language: 'ja',
1092
- command: 'on',
1093
- priority: 85,
1094
- template: {
1095
- format: '{duration} を クリック で 待つ それから',
1096
- tokens: [
1097
- { type: 'role', role: 'duration' },
1098
- { type: 'literal', value: 'を' },
1099
- { type: 'literal', value: 'クリック' },
1100
- { type: 'literal', value: 'で' },
1101
- { type: 'literal', value: '待つ', alternatives: ['ウェイト', '待機'] },
1102
- { type: 'literal', value: 'それから', alternatives: ['次に', 'そして'] },
1103
- ],
1104
- },
1105
- extraction: {
1106
- duration: { position: 0 },
1107
- event: { default: { type: 'literal', value: 'click' } },
1108
- action: { default: { type: 'literal', value: 'wait' } },
1109
- continues: { default: { type: 'literal', value: 'then' } },
1110
- },
1111
- },
1112
-
1113
- // ==========================================================================
1114
- // EXCHANGE/SWAP PATTERNS
1115
- // ==========================================================================
1116
-
1117
- // Click + Exchange: "{source} を クリック で 交換 {target} で"
1118
- {
1119
- id: 'grammar-ja-click-exchange',
1120
- language: 'ja',
1121
- command: 'on',
1122
- priority: 76,
1123
- template: {
1124
- format: '{patient} を クリック で 交換 {destination} で',
1125
- tokens: [
1126
- { type: 'role', role: 'patient' },
1127
- { type: 'literal', value: 'を' },
1128
- { type: 'literal', value: 'クリック' },
1129
- { type: 'literal', value: 'で' },
1130
- { type: 'literal', value: '交換', alternatives: ['スワップ', '入れ替え'] },
1131
- { type: 'role', role: 'destination' },
1132
- { type: 'literal', value: 'で' },
1133
- ],
1134
- },
1135
- extraction: {
1136
- patient: { position: 0 },
1137
- destination: { position: 1 },
1138
- event: { default: { type: 'literal', value: 'click' } },
1139
- action: { default: { type: 'literal', value: 'swap' } },
1140
- },
1141
- },
1142
-
1143
- // ==========================================================================
1144
- // PUT BEFORE/AFTER PATTERNS
1145
- // ==========================================================================
1146
-
1147
- // Click + Put before: "{content} 前に {target} を クリック で 置く"
1148
- {
1149
- id: 'grammar-ja-click-put-before',
1150
- language: 'ja',
1151
- command: 'on',
1152
- priority: 76,
1153
- template: {
1154
- format: '{patient} 前に {destination} を クリック で 置く',
1155
- tokens: [
1156
- { type: 'role', role: 'patient' },
1157
- { type: 'literal', value: '前に', alternatives: ['前'] },
1158
- { type: 'role', role: 'destination' },
1159
- { type: 'literal', value: 'を' },
1160
- { type: 'literal', value: 'クリック' },
1161
- { type: 'literal', value: 'で' },
1162
- { type: 'literal', value: '置く', alternatives: ['入れる', 'プット'] },
1163
- ],
1164
- },
1165
- extraction: {
1166
- patient: { position: 0 },
1167
- destination: { position: 1 },
1168
- event: { default: { type: 'literal', value: 'click' } },
1169
- action: { default: { type: 'literal', value: 'put' } },
1170
- modifier: { default: { type: 'literal', value: 'before' } },
1171
- },
1172
- },
1173
-
1174
- // Click + Put after: "{content} 後に {target} を クリック で 置く"
1175
- {
1176
- id: 'grammar-ja-click-put-after',
1177
- language: 'ja',
1178
- command: 'on',
1179
- priority: 76,
1180
- template: {
1181
- format: '{patient} 後に {destination} を クリック で 置く',
1182
- tokens: [
1183
- { type: 'role', role: 'patient' },
1184
- { type: 'literal', value: '後に', alternatives: ['後'] },
1185
- { type: 'role', role: 'destination' },
1186
- { type: 'literal', value: 'を' },
1187
- { type: 'literal', value: 'クリック' },
1188
- { type: 'literal', value: 'で' },
1189
- { type: 'literal', value: '置く', alternatives: ['入れる', 'プット'] },
1190
- ],
1191
- },
1192
- extraction: {
1193
- patient: { position: 0 },
1194
- destination: { position: 1 },
1195
- event: { default: { type: 'literal', value: 'click' } },
1196
- action: { default: { type: 'literal', value: 'put' } },
1197
- modifier: { default: { type: 'literal', value: 'after' } },
1198
- },
1199
- },
1200
-
1201
- // ==========================================================================
1202
- // POSSESSIVE PATTERNS
1203
- // ==========================================================================
1204
-
1205
- // Click + Set possessive: "私の {property} を クリック で 設定 {value} に"
1206
- {
1207
- id: 'grammar-ja-click-set-possessive',
1208
- language: 'ja',
1209
- command: 'on',
1210
- priority: 77,
1211
- template: {
1212
- format: '私の {patient} を クリック で 設定 {goal} に',
1213
- tokens: [
1214
- { type: 'literal', value: '私の', alternatives: ['あなたの', 'その'] },
1215
- { type: 'role', role: 'patient' },
1216
- { type: 'literal', value: 'を' },
1217
- { type: 'literal', value: 'クリック' },
1218
- { type: 'literal', value: 'で' },
1219
- { type: 'literal', value: '設定', alternatives: ['セット'] },
1220
- { type: 'role', role: 'goal' },
1221
- { type: 'literal', value: 'に' },
1222
- ],
1223
- },
1224
- extraction: {
1225
- patient: { position: 0 },
1226
- goal: { position: 1 },
1227
- event: { default: { type: 'literal', value: 'click' } },
1228
- action: { default: { type: 'literal', value: 'set' } },
1229
- },
1230
- },
1231
-
1232
- // ==========================================================================
1233
- // WAIT THEN REMOVE PATTERNS
1234
- // ==========================================================================
1235
-
1236
- // Click + Wait then remove: "{duration} を クリック で 待つ それから 私 を 削除"
1237
- {
1238
- id: 'grammar-ja-click-wait-then-remove',
1239
- language: 'ja',
1240
- command: 'on',
1241
- priority: 86,
1242
- template: {
1243
- format: '{duration} を クリック で 待つ それから 私 を 削除',
1244
- tokens: [
1245
- { type: 'role', role: 'duration' },
1246
- { type: 'literal', value: 'を' },
1247
- { type: 'literal', value: 'クリック' },
1248
- { type: 'literal', value: 'で' },
1249
- { type: 'literal', value: '待つ', alternatives: ['ウェイト', '待機'] },
1250
- { type: 'literal', value: 'それから', alternatives: ['次に', 'そして'] },
1251
- { type: 'literal', value: '私', alternatives: ['me'] },
1252
- { type: 'literal', value: 'を' },
1253
- { type: 'literal', value: '削除', alternatives: ['取り除く', '消す'] },
1254
- ],
1255
- },
1256
- extraction: {
1257
- duration: { position: 0 },
1258
- patient: { default: { type: 'literal', value: 'me' } },
1259
- event: { default: { type: 'literal', value: 'click' } },
1260
- action: { default: { type: 'literal', value: 'wait' } },
1261
- continues: { default: { type: 'literal', value: 'then' } },
1262
- },
1263
- },
1264
-
1265
- // ==========================================================================
1266
- // KEYDOWN/BLUR PATTERNS
1267
- // ==========================================================================
1268
-
1269
- // Keydown + Blur: "私 を keydown[key=="Escape"] で ぼかし"
1270
- {
1271
- id: 'grammar-ja-keydown-blur',
1272
- language: 'ja',
1273
- command: 'on',
1274
- priority: 76,
1275
- template: {
1276
- format: '{patient} を {event} で ぼかし',
1277
- tokens: [
1278
- { type: 'role', role: 'patient' },
1279
- { type: 'literal', value: 'を' },
1280
- { type: 'role', role: 'event' },
1281
- { type: 'literal', value: 'で' },
1282
- { type: 'literal', value: 'ぼかし', alternatives: ['ブラー', 'フォーカス解除'] },
1283
- ],
1284
- },
1285
- extraction: {
1286
- patient: { position: 0 },
1287
- event: { position: 1 },
1288
- action: { default: { type: 'literal', value: 'blur' } },
1289
- },
1290
- },
1291
-
1292
- // ==========================================================================
1293
- // INPUT EVENT PATTERNS
1294
- // ==========================================================================
1295
-
1296
- // Input + Put value: "私の 値 を {destination} に 置く 入力 で"
1297
- {
1298
- id: 'grammar-ja-input-put-value',
1299
- language: 'ja',
1300
- command: 'on',
1301
- priority: 77,
1302
- template: {
1303
- format: '私の 値 を {destination} に 置く 入力 で',
1304
- tokens: [
1305
- { type: 'literal', value: '私の', alternatives: ['あなたの', 'その'] },
1306
- { type: 'literal', value: '値', alternatives: ['価値'] },
1307
- { type: 'literal', value: 'を' },
1308
- { type: 'role', role: 'destination' },
1309
- { type: 'literal', value: 'に' },
1310
- { type: 'literal', value: '置く', alternatives: ['入れる', 'プット'] },
1311
- { type: 'literal', value: '入力', alternatives: ['インプット'] },
1312
- { type: 'literal', value: 'で' },
1313
- ],
1314
- },
1315
- extraction: {
1316
- patient: { default: { type: 'literal', value: 'my value' } },
1317
- destination: { position: 0 },
1318
- event: { default: { type: 'literal', value: 'input' } },
1319
- action: { default: { type: 'literal', value: 'put' } },
1320
- },
1321
- },
1322
-
1323
- // Input + Set: "{property} を 入力 で 設定 {value} に"
1324
- {
1325
- id: 'grammar-ja-input-set',
1326
- language: 'ja',
1327
- command: 'on',
1328
- priority: 76,
1329
- template: {
1330
- format: '{patient} を 入力 で 設定 {goal} に',
1331
- tokens: [
1332
- { type: 'role', role: 'patient' },
1333
- { type: 'literal', value: 'を' },
1334
- { type: 'literal', value: '入力', alternatives: ['インプット'] },
1335
- { type: 'literal', value: 'で' },
1336
- { type: 'literal', value: '設定', alternatives: ['セット'] },
1337
- { type: 'role', role: 'goal' },
1338
- { type: 'literal', value: 'に' },
1339
- ],
1340
- },
1341
- extraction: {
1342
- patient: { position: 0 },
1343
- goal: { position: 1 },
1344
- event: { default: { type: 'literal', value: 'input' } },
1345
- action: { default: { type: 'literal', value: 'set' } },
1346
- },
1347
- },
1348
-
1349
- // ==========================================================================
1350
- // SET PREVIOUS PATTERNS
1351
- // ==========================================================================
1352
-
1353
- // Click + Set previous: "前 <input/>.value を クリック で 設定 "" に"
1354
- {
1355
- id: 'grammar-ja-click-set-previous',
1356
- language: 'ja',
1357
- command: 'on',
1358
- priority: 77,
1359
- template: {
1360
- format: '前 {patient} を クリック で 設定 {goal} に',
1361
- tokens: [
1362
- { type: 'literal', value: '前', alternatives: ['前の', '以前'] },
1363
- { type: 'role', role: 'patient' },
1364
- { type: 'literal', value: 'を' },
1365
- { type: 'literal', value: 'クリック' },
1366
- { type: 'literal', value: 'で' },
1367
- { type: 'literal', value: '設定', alternatives: ['セット'] },
1368
- { type: 'role', role: 'goal' },
1369
- { type: 'literal', value: 'に' },
1370
- ],
1371
- },
1372
- extraction: {
1373
- patient: { position: 0 },
1374
- goal: { position: 1 },
1375
- modifier: { default: { type: 'literal', value: 'previous' } },
1376
- event: { default: { type: 'literal', value: 'click' } },
1377
- action: { default: { type: 'literal', value: 'set' } },
1378
- },
1379
- },
1380
-
1381
- // ==========================================================================
1382
- // HIDE CLOSEST THEN PATTERNS
1383
- // ==========================================================================
1384
-
1385
- // Click + Hide closest then: "最も近い .modal を クリック で 隠す それから"
1386
- {
1387
- id: 'grammar-ja-click-hide-closest-then',
1388
- language: 'ja',
1389
- command: 'on',
1390
- priority: 85,
1391
- template: {
1392
- format: '最も近い {patient} を クリック で 隠す それから',
1393
- tokens: [
1394
- { type: 'literal', value: '最も近い', alternatives: ['一番近い', '最寄りの'] },
1395
- { type: 'role', role: 'patient' },
1396
- { type: 'literal', value: 'を' },
1397
- { type: 'literal', value: 'クリック' },
1398
- { type: 'literal', value: 'で' },
1399
- { type: 'literal', value: '隠す', alternatives: ['ハイド', '非表示'] },
1400
- { type: 'literal', value: 'それから', alternatives: ['次に', 'そして'] },
1401
- ],
1402
- },
1403
- extraction: {
1404
- patient: { position: 0 },
1405
- event: { default: { type: 'literal', value: 'click' } },
1406
- action: { default: { type: 'literal', value: 'hide' } },
1407
- modifier: { default: { type: 'literal', value: 'closest' } },
1408
- continues: { default: { type: 'literal', value: 'then' } },
1409
- },
1410
- },
1411
-
1412
- // ==========================================================================
1413
- // LOAD EVENT PATTERNS
1414
- // ==========================================================================
1415
-
1416
- // Load + Call: "{function} を 読み込み で 呼び出し"
1417
- {
1418
- id: 'grammar-ja-load-call',
1419
- language: 'ja',
1420
- command: 'on',
1421
- priority: 76,
1422
- template: {
1423
- format: '{patient} を 読み込み で 呼び出し',
1424
- tokens: [
1425
- { type: 'role', role: 'patient' },
1426
- { type: 'literal', value: 'を' },
1427
- { type: 'literal', value: '読み込み', alternatives: ['ロード'] },
1428
- { type: 'literal', value: 'で' },
1429
- { type: 'literal', value: '呼び出し', alternatives: ['コール', '実行'] },
1430
- ],
1431
- },
1432
- extraction: {
1433
- patient: { position: 0 },
1434
- event: { default: { type: 'literal', value: 'load' } },
1435
- action: { default: { type: 'literal', value: 'call' } },
1436
- },
1437
- },
1438
-
1439
- // ==========================================================================
1440
- // STYLE PROPERTY SET PATTERNS
1441
- // ==========================================================================
1442
-
1443
- // Click + Set my *opacity: "私の *opacity を クリック で 設定 0.5 に"
1444
- {
1445
- id: 'grammar-ja-click-set-my-style',
1446
- language: 'ja',
1447
- command: 'on',
1448
- priority: 77,
1449
- template: {
1450
- format: '私の {patient} を クリック で 設定 {goal} に',
1451
- tokens: [
1452
- { type: 'literal', value: '私の', alternatives: ['あなたの', 'その'] },
1453
- { type: 'role', role: 'patient' },
1454
- { type: 'literal', value: 'を' },
1455
- { type: 'literal', value: 'クリック' },
1456
- { type: 'literal', value: 'で' },
1457
- { type: 'literal', value: '設定', alternatives: ['セット'] },
1458
- { type: 'role', role: 'goal' },
1459
- { type: 'literal', value: 'に' },
1460
- ],
1461
- },
1462
- extraction: {
1463
- patient: { position: 0 },
1464
- goal: { position: 1 },
1465
- event: { default: { type: 'literal', value: 'click' } },
1466
- action: { default: { type: 'literal', value: 'set' } },
1467
- },
1468
- },
1469
-
1470
- // ==========================================================================
1471
- // DEFAULT ON LOAD PATTERNS
1472
- // ==========================================================================
1473
-
1474
- // Load + Default: "私の @data-count を 読み込み で 既定 "0" に"
1475
- {
1476
- id: 'grammar-ja-load-default',
1477
- language: 'ja',
1478
- command: 'on',
1479
- priority: 77,
1480
- template: {
1481
- format: '私の {patient} を 読み込み で 既定 {goal} に',
1482
- tokens: [
1483
- { type: 'literal', value: '私の', alternatives: ['あなたの', 'その'] },
1484
- { type: 'role', role: 'patient' },
1485
- { type: 'literal', value: 'を' },
1486
- { type: 'literal', value: '読み込み', alternatives: ['ロード'] },
1487
- { type: 'literal', value: 'で' },
1488
- { type: 'literal', value: '既定', alternatives: ['デフォルト', '初期値'] },
1489
- { type: 'role', role: 'goal' },
1490
- { type: 'literal', value: 'に' },
1491
- ],
1492
- },
1493
- extraction: {
1494
- patient: { position: 0 },
1495
- goal: { position: 1 },
1496
- event: { default: { type: 'literal', value: 'load' } },
1497
- action: { default: { type: 'literal', value: 'default' } },
1498
- },
1499
- },
1500
-
1501
- // ==========================================================================
1502
- // TELL/SHOW PATTERNS
1503
- // ==========================================================================
1504
-
1505
- // Click + Tell show: "#modal を クリック で 伝える 表示 に"
1506
- {
1507
- id: 'grammar-ja-click-tell-show',
1508
- language: 'ja',
1509
- command: 'on',
1510
- priority: 76,
1511
- template: {
1512
- format: '{patient} を クリック で 伝える 表示 に',
1513
- tokens: [
1514
- { type: 'role', role: 'patient' },
1515
- { type: 'literal', value: 'を' },
1516
- { type: 'literal', value: 'クリック' },
1517
- { type: 'literal', value: 'で' },
1518
- { type: 'literal', value: '伝える', alternatives: ['テル', '告げる'] },
1519
- { type: 'literal', value: '表示', alternatives: ['ショー', '見せる'] },
1520
- { type: 'literal', value: 'に' },
1521
- ],
1522
- },
1523
- extraction: {
1524
- patient: { position: 0 },
1525
- goal: { default: { type: 'literal', value: 'show' } },
1526
- event: { default: { type: 'literal', value: 'click' } },
1527
- action: { default: { type: 'literal', value: 'tell' } },
1528
- },
1529
- },
1530
-
1531
- // ==========================================================================
1532
- // STOP EVENT THEN TOGGLE PATTERNS
1533
- // ==========================================================================
1534
-
1535
- // Click + Stop event then toggle: "the イベント を クリック で 停止 それから .active を 切り替え"
1536
- {
1537
- id: 'grammar-ja-click-stop-then-toggle',
1538
- language: 'ja',
1539
- command: 'on',
1540
- priority: 86,
1541
- template: {
1542
- format: 'the イベント を クリック で 停止 それから {patient} を 切り替え',
1543
- tokens: [
1544
- { type: 'literal', value: 'the' },
1545
- { type: 'literal', value: 'イベント', alternatives: ['event'] },
1546
- { type: 'literal', value: 'を' },
1547
- { type: 'literal', value: 'クリック' },
1548
- { type: 'literal', value: 'で' },
1549
- { type: 'literal', value: '停止', alternatives: ['ストップ', '止める'] },
1550
- { type: 'literal', value: 'それから', alternatives: ['次に', 'そして'] },
1551
- { type: 'role', role: 'patient' },
1552
- { type: 'literal', value: 'を' },
1553
- { type: 'literal', value: '切り替え', alternatives: ['トグル', '切替'] },
1554
- ],
1555
- },
1556
- extraction: {
1557
- patient: { position: 0 },
1558
- event: { default: { type: 'literal', value: 'click' } },
1559
- action: { default: { type: 'literal', value: 'halt' } },
1560
- continues: { default: { type: 'literal', value: 'then' } },
1561
- },
1562
- },
1563
-
1564
- // ==========================================================================
1565
- // MAKE THEN PUT PATTERNS
1566
- // ==========================================================================
1567
-
1568
- // Click + Make then put: "a <div.card/> を クリック で 作る それから それ を #container に 置く"
1569
- {
1570
- id: 'grammar-ja-click-make-then-put',
1571
- language: 'ja',
1572
- command: 'on',
1573
- priority: 86,
1574
- template: {
1575
- format: 'a {patient} を クリック で 作る それから',
1576
- tokens: [
1577
- { type: 'literal', value: 'a' },
1578
- { type: 'role', role: 'patient' },
1579
- { type: 'literal', value: 'を' },
1580
- { type: 'literal', value: 'クリック' },
1581
- { type: 'literal', value: 'で' },
1582
- { type: 'literal', value: '作る', alternatives: ['メイク', '作成'] },
1583
- { type: 'literal', value: 'それから', alternatives: ['次に', 'そして'] },
1584
- ],
1585
- },
1586
- extraction: {
1587
- patient: { position: 0 },
1588
- event: { default: { type: 'literal', value: 'click' } },
1589
- action: { default: { type: 'literal', value: 'make' } },
1590
- continues: { default: { type: 'literal', value: 'then' } },
1591
- },
1592
- },
1593
-
1594
- // ==========================================================================
1595
- // WAIT THEN REMOVE PATTERNS (simpler)
1596
- // ==========================================================================
1597
-
1598
- // Click + Wait duration then: "{duration} を クリック で 待つ それから"
1599
- {
1600
- id: 'grammar-ja-click-wait-duration-then',
1601
- language: 'ja',
1602
- command: 'on',
1603
- priority: 86,
1604
- template: {
1605
- format: '{duration} を クリック で 待つ それから',
1606
- tokens: [
1607
- { type: 'role', role: 'duration' },
1608
- { type: 'literal', value: 'を' },
1609
- { type: 'literal', value: 'クリック' },
1610
- { type: 'literal', value: 'で' },
1611
- { type: 'literal', value: '待つ', alternatives: ['ウェイト', '待機'] },
1612
- { type: 'literal', value: 'それから', alternatives: ['次に', 'そして'] },
1613
- ],
1614
- },
1615
- extraction: {
1616
- duration: { position: 0 },
1617
- event: { default: { type: 'literal', value: 'click' } },
1618
- action: { default: { type: 'literal', value: 'wait' } },
1619
- continues: { default: { type: 'literal', value: 'then' } },
1620
- },
1621
- },
1622
-
1623
- // ==========================================================================
1624
- // REPEAT TIMES THEN PATTERNS
1625
- // ==========================================================================
1626
-
1627
- // Click + Repeat times then: "3 times を クリック で 繰り返し それから"
1628
- {
1629
- id: 'grammar-ja-click-repeat-times-then',
1630
- language: 'ja',
1631
- command: 'on',
1632
- priority: 86,
1633
- template: {
1634
- format: '{duration} times を クリック で 繰り返し それから',
1635
- tokens: [
1636
- { type: 'role', role: 'duration' },
1637
- { type: 'literal', value: 'times', alternatives: ['回'] },
1638
- { type: 'literal', value: 'を' },
1639
- { type: 'literal', value: 'クリック' },
1640
- { type: 'literal', value: 'で' },
1641
- { type: 'literal', value: '繰り返し', alternatives: ['リピート', '反復'] },
1642
- { type: 'literal', value: 'それから', alternatives: ['次に', 'そして'] },
1643
- ],
1644
- },
1645
- extraction: {
1646
- duration: { position: 0 },
1647
- event: { default: { type: 'literal', value: 'click' } },
1648
- action: { default: { type: 'literal', value: 'repeat' } },
1649
- continues: { default: { type: 'literal', value: 'then' } },
1650
- },
1651
- },
1652
-
1653
- // ==========================================================================
1654
- // SEND PATTERNS
1655
- // ==========================================================================
1656
-
1657
- // Click + Send: "{event} を クリック で 送る {target} に"
1658
- {
1659
- id: 'grammar-ja-click-send',
1660
- language: 'ja',
1661
- command: 'on',
1662
- priority: 76,
1663
- template: {
1664
- format: '{patient} を クリック で 送る {destination} に',
1665
- tokens: [
1666
- { type: 'role', role: 'patient' },
1667
- { type: 'literal', value: 'を' },
1668
- { type: 'literal', value: 'クリック' },
1669
- { type: 'literal', value: 'で' },
1670
- { type: 'literal', value: '送る', alternatives: ['センド', '送信'] },
1671
- { type: 'role', role: 'destination' },
1672
- { type: 'literal', value: 'に' },
1673
- ],
1674
- },
1675
- extraction: {
1676
- patient: { position: 0 },
1677
- destination: { position: 1 },
1678
- event: { default: { type: 'literal', value: 'click' } },
1679
- action: { default: { type: 'literal', value: 'send' } },
1680
- },
1681
- },
1682
-
1683
- // ==========================================================================
1684
- // ASYNC FETCH THEN PUT PATTERNS
1685
- // ==========================================================================
1686
-
1687
- // Click + Async fetch then: "取得 {source} を クリック で 非同期 それから"
1688
- {
1689
- id: 'grammar-ja-click-async-fetch-then',
1690
- language: 'ja',
1691
- command: 'on',
1692
- priority: 86,
1693
- template: {
1694
- format: '取得 {source} を クリック で 非同期 それから',
1695
- tokens: [
1696
- { type: 'literal', value: '取得', alternatives: ['フェッチ', 'ゲット'] },
1697
- { type: 'role', role: 'source' },
1698
- { type: 'literal', value: 'を' },
1699
- { type: 'literal', value: 'クリック' },
1700
- { type: 'literal', value: 'で' },
1701
- { type: 'literal', value: '非同期', alternatives: ['アシンク', 'async'] },
1702
- { type: 'literal', value: 'それから', alternatives: ['次に', 'そして'] },
1703
- ],
1704
- },
1705
- extraction: {
1706
- source: { position: 0 },
1707
- event: { default: { type: 'literal', value: 'click' } },
1708
- action: { default: { type: 'literal', value: 'fetch' } },
1709
- continues: { default: { type: 'literal', value: 'then' } },
1710
- },
1711
- },
1712
- ];
14
+ return [];
1713
15
  }