@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,8 +1,8 @@
1
1
  /**
2
2
  * Arabic Add Patterns
3
3
  *
4
- * Hand-crafted patterns for "add" command.
5
- * Arabic uses VSO order: أضف {patient} إلى {target}
4
+ * Strategy: Return empty array to rely on auto-generated patterns from profile.
5
+ * This follows the Tagalog model which achieves 100% pass rate with pure generation.
6
6
  */
7
7
 
8
8
  import type { LanguagePattern } from '../../types';
@@ -11,61 +11,5 @@ import type { LanguagePattern } from '../../types';
11
11
  * Get Arabic add patterns.
12
12
  */
13
13
  export function getAddPatternsAr(): LanguagePattern[] {
14
- return [
15
- {
16
- id: 'add-ar-full',
17
- language: 'ar',
18
- command: 'add',
19
- priority: 100,
20
- template: {
21
- format: 'أضف {patient} إلى {destination}',
22
- tokens: [
23
- { type: 'literal', value: 'أضف', alternatives: ['اضف', 'أضيف', 'اضافة'] },
24
- { type: 'role', role: 'patient' },
25
- { type: 'literal', value: 'إلى', alternatives: ['الى', 'ل', 'لـ'] },
26
- { type: 'role', role: 'destination' },
27
- ],
28
- },
29
- extraction: {
30
- patient: { position: 1 },
31
- destination: { marker: 'إلى', markerAlternatives: ['الى', 'ل', 'لـ'] },
32
- },
33
- },
34
- {
35
- id: 'add-ar-simple',
36
- language: 'ar',
37
- command: 'add',
38
- priority: 90,
39
- template: {
40
- format: 'أضف {patient}',
41
- tokens: [
42
- { type: 'literal', value: 'أضف', alternatives: ['اضف', 'أضيف'] },
43
- { type: 'role', role: 'patient' },
44
- ],
45
- },
46
- extraction: {
47
- patient: { position: 1 },
48
- destination: { default: { type: 'reference', value: 'me' } },
49
- },
50
- },
51
- {
52
- id: 'add-ar-with-على',
53
- language: 'ar',
54
- command: 'add',
55
- priority: 95,
56
- template: {
57
- format: 'أضف {patient} على {destination}',
58
- tokens: [
59
- { type: 'literal', value: 'أضف', alternatives: ['اضف'] },
60
- { type: 'role', role: 'patient' },
61
- { type: 'literal', value: 'على' },
62
- { type: 'role', role: 'destination' },
63
- ],
64
- },
65
- extraction: {
66
- patient: { position: 1 },
67
- destination: { marker: 'على' },
68
- },
69
- },
70
- ];
14
+ return [];
71
15
  }
@@ -16,6 +16,7 @@ import { getAddPatternsJa } from './ja';
16
16
  import { getAddPatternsKo } from './ko';
17
17
  import { getAddPatternsMs } from './ms';
18
18
  import { getAddPatternsPl } from './pl';
19
+ import { getAddPatternsQu } from './qu';
19
20
  import { getAddPatternsRu } from './ru';
20
21
  import { getAddPatternsTh } from './th';
21
22
  import { getAddPatternsTl } from './tl';
@@ -45,6 +46,8 @@ export function getAddPatternsForLanguage(language: string): LanguagePattern[] {
45
46
  return getAddPatternsMs();
46
47
  case 'pl':
47
48
  return getAddPatternsPl();
49
+ case 'qu':
50
+ return getAddPatternsQu();
48
51
  case 'ru':
49
52
  return getAddPatternsRu();
50
53
  case 'th':
@@ -73,6 +76,7 @@ export { getAddPatternsJa } from './ja';
73
76
  export { getAddPatternsKo } from './ko';
74
77
  export { getAddPatternsMs } from './ms';
75
78
  export { getAddPatternsPl } from './pl';
79
+ export { getAddPatternsQu } from './qu';
76
80
  export { getAddPatternsRu } from './ru';
77
81
  export { getAddPatternsTh } from './th';
78
82
  export { getAddPatternsTl } from './tl';
@@ -84,4 +88,4 @@ export { getAddPatternsZh } from './zh';
84
88
  /**
85
89
  * Languages that have hand-crafted add patterns.
86
90
  */
87
- export const addPatternLanguages = ['ar', 'bn', 'hi', 'it', 'ja', 'ko', 'ms', 'pl', 'ru', 'th', 'tl', 'tr', 'uk', 'vi', 'zh'];
91
+ export const addPatternLanguages = ['ar', 'bn', 'hi', 'it', 'ja', 'ko', 'ms', 'pl', 'qu', 'ru', 'th', 'tl', 'tr', 'uk', 'vi', 'zh'];
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Japanese Add Patterns
3
3
  *
4
- * Hand-crafted patterns for "add" command.
5
- * Japanese uses SOV order: {target} {patient} を 追加
4
+ * Relying on auto-generated patterns from profile.
5
+ * Empty stub follows Hindi/Tagalog model for simpler implementation.
6
6
  */
7
7
 
8
8
  import type { LanguagePattern } from '../../types';
@@ -11,83 +11,5 @@ import type { LanguagePattern } from '../../types';
11
11
  * Get Japanese add patterns.
12
12
  */
13
13
  export function getAddPatternsJa(): LanguagePattern[] {
14
- return [
15
- {
16
- id: 'add-ja-full',
17
- language: 'ja',
18
- command: 'add',
19
- priority: 100,
20
- template: {
21
- format: '{destination} に {patient} を 追加',
22
- tokens: [
23
- { type: 'role', role: 'destination' },
24
- { type: 'literal', value: 'に' },
25
- { type: 'role', role: 'patient' },
26
- { type: 'literal', value: 'を' },
27
- { type: 'literal', value: '追加', alternatives: ['追加する', '加える'] },
28
- ],
29
- },
30
- extraction: {
31
- destination: { position: 0 },
32
- patient: { marker: 'を' },
33
- },
34
- },
35
- {
36
- id: 'add-ja-simple',
37
- language: 'ja',
38
- command: 'add',
39
- priority: 90,
40
- template: {
41
- format: '{patient} を 追加',
42
- tokens: [
43
- { type: 'role', role: 'patient' },
44
- { type: 'literal', value: 'を' },
45
- { type: 'literal', value: '追加', alternatives: ['追加する', '加える'] },
46
- ],
47
- },
48
- extraction: {
49
- patient: { position: 0 },
50
- destination: { default: { type: 'reference', value: 'me' } },
51
- },
52
- },
53
- {
54
- id: 'add-ja-possessive',
55
- language: 'ja',
56
- command: 'add',
57
- priority: 95,
58
- template: {
59
- format: '{destination} の {patient} を 追加',
60
- tokens: [
61
- { type: 'role', role: 'destination' },
62
- { type: 'literal', value: 'の' },
63
- { type: 'role', role: 'patient' },
64
- { type: 'literal', value: 'を' },
65
- { type: 'literal', value: '追加', alternatives: ['追加する'] },
66
- ],
67
- },
68
- extraction: {
69
- destination: { position: 0 },
70
- patient: { marker: 'を' },
71
- },
72
- },
73
- // Phase 6d: Word order flexibility - verb-first pattern
74
- {
75
- id: 'add-ja-verb-first',
76
- language: 'ja',
77
- command: 'add',
78
- priority: 75,
79
- template: {
80
- format: '追加 {patient} を',
81
- tokens: [
82
- { type: 'literal', value: '追加', alternatives: ['追加する'] },
83
- { type: 'role', role: 'patient' },
84
- { type: 'literal', value: 'を' },
85
- ],
86
- },
87
- extraction: {
88
- patient: { position: 1 },
89
- destination: { default: { type: 'reference', value: 'me' } },
90
- },
91
- },
92
- ];
14
+ return [];
93
15
  }
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Korean Add Patterns
3
3
  *
4
- * Hand-crafted patterns for "add" command.
5
- * Korean uses SOV order: {target} {patient} 추가
4
+ * Strategy: Return empty array to rely on auto-generated patterns from profile.
5
+ * This follows the Tagalog model which achieves 100% pass rate with pure generation.
6
6
  */
7
7
 
8
8
  import type { LanguagePattern } from '../../types';
@@ -11,64 +11,5 @@ import type { LanguagePattern } from '../../types';
11
11
  * Get Korean add patterns.
12
12
  */
13
13
  export function getAddPatternsKo(): LanguagePattern[] {
14
- return [
15
- {
16
- id: 'add-ko-full',
17
- language: 'ko',
18
- command: 'add',
19
- priority: 100,
20
- template: {
21
- format: '{destination} 에 {patient} 를 추가',
22
- tokens: [
23
- { type: 'role', role: 'destination' },
24
- { type: 'literal', value: '에' },
25
- { type: 'role', role: 'patient' },
26
- { type: 'literal', value: '를', alternatives: ['을'] },
27
- { type: 'literal', value: '추가', alternatives: ['추가하다', '추가해', '더하다'] },
28
- ],
29
- },
30
- extraction: {
31
- destination: { position: 0 },
32
- patient: { marker: '를', markerAlternatives: ['을'] },
33
- },
34
- },
35
- {
36
- id: 'add-ko-simple',
37
- language: 'ko',
38
- command: 'add',
39
- priority: 90,
40
- template: {
41
- format: '{patient} 를 추가',
42
- tokens: [
43
- { type: 'role', role: 'patient' },
44
- { type: 'literal', value: '를', alternatives: ['을'] },
45
- { type: 'literal', value: '추가', alternatives: ['추가하다', '추가해'] },
46
- ],
47
- },
48
- extraction: {
49
- patient: { position: 0 },
50
- destination: { default: { type: 'reference', value: 'me' } },
51
- },
52
- },
53
- {
54
- id: 'add-ko-possessive',
55
- language: 'ko',
56
- command: 'add',
57
- priority: 95,
58
- template: {
59
- format: '{destination} 의 {patient} 를 추가',
60
- tokens: [
61
- { type: 'role', role: 'destination' },
62
- { type: 'literal', value: '의' },
63
- { type: 'role', role: 'patient' },
64
- { type: 'literal', value: '를', alternatives: ['을'] },
65
- { type: 'literal', value: '추가', alternatives: ['추가하다'] },
66
- ],
67
- },
68
- extraction: {
69
- destination: { position: 0 },
70
- patient: { marker: '를', markerAlternatives: ['을'] },
71
- },
72
- },
73
- ];
14
+ return [];
74
15
  }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Quechua Add Patterns
3
+ *
4
+ * Patterns for parsing "add" command in Quechua (Runasimi).
5
+ * SOV word order with postposition suffixes (-ta for patient, -man for destination).
6
+ */
7
+
8
+ import type { LanguagePattern } from '../../types';
9
+
10
+ export function getAddPatternsQu(): LanguagePattern[] {
11
+ return [
12
+ // SOV pattern: .active ta yapay (patient + verb)
13
+ {
14
+ id: 'add-qu-sov',
15
+ language: 'qu',
16
+ command: 'add',
17
+ priority: 100,
18
+ template: {
19
+ format: '{patient} ta yapay',
20
+ tokens: [
21
+ { type: 'role', role: 'patient' },
22
+ { type: 'literal', value: 'ta' },
23
+ { type: 'literal', value: 'yapay', alternatives: ['yapaykuy'] },
24
+ ],
25
+ },
26
+ extraction: {
27
+ patient: { position: 0 },
28
+ },
29
+ },
30
+ // Simple pattern: yapay .active (verb + patient, more casual)
31
+ {
32
+ id: 'add-qu-simple',
33
+ language: 'qu',
34
+ command: 'add',
35
+ priority: 90,
36
+ template: {
37
+ format: 'yapay {patient}',
38
+ tokens: [
39
+ { type: 'literal', value: 'yapay', alternatives: ['yapaykuy'] },
40
+ { type: 'role', role: 'patient' },
41
+ ],
42
+ },
43
+ extraction: {
44
+ patient: { position: 1 },
45
+ },
46
+ },
47
+ // With destination: #button man .active ta yapay
48
+ {
49
+ id: 'add-qu-with-dest',
50
+ language: 'qu',
51
+ command: 'add',
52
+ priority: 95,
53
+ template: {
54
+ format: '{destination} man {patient} ta yapay',
55
+ tokens: [
56
+ { type: 'role', role: 'destination' },
57
+ { type: 'literal', value: 'man' },
58
+ { type: 'role', role: 'patient' },
59
+ { type: 'literal', value: 'ta' },
60
+ { type: 'literal', value: 'yapay', alternatives: ['yapaykuy'] },
61
+ ],
62
+ },
63
+ extraction: {
64
+ destination: { position: 0 },
65
+ patient: { position: 2 },
66
+ },
67
+ },
68
+ ];
69
+ }
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Turkish Add Patterns
3
3
  *
4
- * Hand-crafted patterns for "add" command.
5
- * Turkish uses SOV order: {target}'a {patient} ekle
4
+ * Strategy: Return empty array to rely on auto-generated patterns from profile.
5
+ * This follows the Tagalog model which achieves 100% pass rate with pure generation.
6
6
  */
7
7
 
8
8
  import type { LanguagePattern } from '../../types';
@@ -11,61 +11,5 @@ import type { LanguagePattern } from '../../types';
11
11
  * Get Turkish add patterns.
12
12
  */
13
13
  export function getAddPatternsTr(): LanguagePattern[] {
14
- return [
15
- {
16
- id: 'add-tr-full',
17
- language: 'tr',
18
- command: 'add',
19
- priority: 100,
20
- template: {
21
- format: "{destination}'a {patient} ekle",
22
- tokens: [
23
- { type: 'role', role: 'destination' },
24
- { type: 'literal', value: "'a", alternatives: ["'e", "'ya", "'ye", '-a', '-e'] },
25
- { type: 'role', role: 'patient' },
26
- { type: 'literal', value: 'ekle', alternatives: ['eklemek', 'ekler'] },
27
- ],
28
- },
29
- extraction: {
30
- destination: { position: 0 },
31
- patient: { position: 2 },
32
- },
33
- },
34
- {
35
- id: 'add-tr-simple',
36
- language: 'tr',
37
- command: 'add',
38
- priority: 90,
39
- template: {
40
- format: '{patient} ekle',
41
- tokens: [
42
- { type: 'role', role: 'patient' },
43
- { type: 'literal', value: 'ekle', alternatives: ['eklemek'] },
44
- ],
45
- },
46
- extraction: {
47
- patient: { position: 0 },
48
- destination: { default: { type: 'reference', value: 'me' } },
49
- },
50
- },
51
- {
52
- id: 'add-tr-locative',
53
- language: 'tr',
54
- command: 'add',
55
- priority: 95,
56
- template: {
57
- format: '{destination} için {patient} ekle',
58
- tokens: [
59
- { type: 'role', role: 'destination' },
60
- { type: 'literal', value: 'için' },
61
- { type: 'role', role: 'patient' },
62
- { type: 'literal', value: 'ekle', alternatives: ['eklemek'] },
63
- ],
64
- },
65
- extraction: {
66
- destination: { position: 0 },
67
- patient: { position: 2 },
68
- },
69
- },
70
- ];
14
+ return [];
71
15
  }
@@ -185,6 +185,7 @@ const handcraftedLanguages = [
185
185
  'th',
186
186
  'ms',
187
187
  'tl',
188
+ 'he',
188
189
  ];
189
190
 
190
191
  /**
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Turkish Decrement Patterns
3
3
  *
4
- * Hand-crafted patterns for "decrement" command.
5
- * Turkish: counter azalt (SOV order)
4
+ * Strategy: Return empty array to rely on auto-generated patterns from profile.
5
+ * This follows the Tagalog model which achieves 100% pass rate with pure generation.
6
6
  */
7
7
 
8
8
  import type { LanguagePattern } from '../../types';
@@ -11,38 +11,5 @@ import type { LanguagePattern } from '../../types';
11
11
  * Get Turkish decrement patterns.
12
12
  */
13
13
  export function getDecrementPatternsTr(): LanguagePattern[] {
14
- return [
15
- {
16
- id: 'decrement-tr-full',
17
- language: 'tr',
18
- command: 'decrement',
19
- priority: 100,
20
- template: {
21
- format: '{patient} azalt',
22
- tokens: [
23
- { type: 'role', role: 'patient', expectedTypes: ['selector', 'reference', 'expression'] },
24
- { type: 'literal', value: 'azalt', alternatives: ['azaltmak', 'düşür', 'decrement'] },
25
- ],
26
- },
27
- extraction: {
28
- patient: { position: 0 },
29
- },
30
- },
31
- {
32
- id: 'decrement-tr-svo',
33
- language: 'tr',
34
- command: 'decrement',
35
- priority: 90,
36
- template: {
37
- format: 'azalt {patient}',
38
- tokens: [
39
- { type: 'literal', value: 'azalt', alternatives: ['azaltmak'] },
40
- { type: 'role', role: 'patient', expectedTypes: ['selector', 'reference', 'expression'] },
41
- ],
42
- },
43
- extraction: {
44
- patient: { position: 1 },
45
- },
46
- },
47
- ];
14
+ return [];
48
15
  }
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Arabic Event Handler Patterns
3
3
  *
4
- * Tree-shakeable: Only included when Arabic is imported.
4
+ * Strategy: Return empty array to rely on auto-generated patterns from profile.
5
+ * This follows the Tagalog model which achieves 100% pass rate with pure generation.
5
6
  */
6
7
 
7
8
  import type { LanguagePattern } from '../../types';
@@ -10,142 +11,5 @@ import type { LanguagePattern } from '../../types';
10
11
  * Get Arabic event handler patterns.
11
12
  */
12
13
  export function getEventHandlerPatternsAr(): LanguagePattern[] {
13
- return [
14
- {
15
- id: 'event-ar-temporal-source',
16
- language: 'ar',
17
- command: 'on',
18
- priority: 115,
19
- template: {
20
- format: 'عندما {event} من {source} {body}',
21
- tokens: [
22
- { type: 'literal', value: 'عندما', alternatives: ['حين', 'لمّا'] },
23
- { type: 'role', role: 'event' },
24
- { type: 'literal', value: 'من' },
25
- { type: 'role', role: 'source' },
26
- ],
27
- },
28
- extraction: {
29
- event: { position: 1 },
30
- source: { marker: 'من' },
31
- },
32
- },
33
- {
34
- id: 'event-ar-temporal-indama',
35
- language: 'ar',
36
- command: 'on',
37
- priority: 105,
38
- template: {
39
- format: 'عندما {event} {body}',
40
- tokens: [
41
- { type: 'literal', value: 'عندما' },
42
- { type: 'role', role: 'event' },
43
- ],
44
- },
45
- extraction: {
46
- event: { position: 1 },
47
- },
48
- },
49
- {
50
- id: 'event-ar-temporal-lamma',
51
- language: 'ar',
52
- command: 'on',
53
- priority: 103,
54
- template: {
55
- format: 'لمّا {event} {body}',
56
- tokens: [
57
- { type: 'literal', value: 'لمّا', alternatives: ['لما'] },
58
- { type: 'role', role: 'event' },
59
- ],
60
- },
61
- extraction: {
62
- event: { position: 1 },
63
- },
64
- },
65
- {
66
- id: 'event-ar-temporal-hina',
67
- language: 'ar',
68
- command: 'on',
69
- priority: 102,
70
- template: {
71
- format: 'حين {event} {body}',
72
- tokens: [
73
- { type: 'literal', value: 'حين', alternatives: ['حينما'] },
74
- { type: 'role', role: 'event' },
75
- ],
76
- },
77
- extraction: {
78
- event: { position: 1 },
79
- },
80
- },
81
- {
82
- id: 'event-ar-standard',
83
- language: 'ar',
84
- command: 'on',
85
- priority: 100,
86
- template: {
87
- format: 'عند {event} {body}',
88
- tokens: [
89
- { type: 'literal', value: 'عند', alternatives: ['على', 'لدى'] },
90
- { type: 'role', role: 'event' },
91
- ],
92
- },
93
- extraction: {
94
- event: { position: 1 },
95
- },
96
- },
97
- {
98
- id: 'event-ar-source',
99
- language: 'ar',
100
- command: 'on',
101
- priority: 110,
102
- template: {
103
- format: 'عند {event} من {source} {body}',
104
- tokens: [
105
- { type: 'literal', value: 'عند' },
106
- { type: 'role', role: 'event' },
107
- { type: 'literal', value: 'من' },
108
- { type: 'role', role: 'source' },
109
- ],
110
- },
111
- extraction: {
112
- event: { position: 1 },
113
- source: { marker: 'من' },
114
- },
115
- },
116
- {
117
- id: 'event-ar-conditional',
118
- language: 'ar',
119
- command: 'on',
120
- priority: 95,
121
- template: {
122
- format: 'إذا {event} {body}',
123
- tokens: [
124
- { type: 'literal', value: 'إذا', alternatives: ['اذا', 'لو'] },
125
- { type: 'role', role: 'event' },
126
- ],
127
- },
128
- extraction: {
129
- event: { position: 1 },
130
- },
131
- },
132
- {
133
- id: 'event-ar-selector-first',
134
- language: 'ar',
135
- command: 'on',
136
- priority: 92, // Lower than standard patterns (95-115)
137
- template: {
138
- format: '{source} على {event} {body}',
139
- tokens: [
140
- { type: 'role', role: 'source', expectedTypes: ['selector'] },
141
- { type: 'literal', value: 'على' },
142
- { type: 'role', role: 'event' },
143
- ],
144
- },
145
- extraction: {
146
- source: { position: 0 },
147
- event: { position: 2 },
148
- },
149
- },
150
- ];
14
+ return [];
151
15
  }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Hebrew Event Handler Patterns
3
+ *
4
+ * Strategy: Return empty array to rely on auto-generated patterns from profile.
5
+ * Hebrew uses SVO word order with preposition-based event markers (ב/כש/עם).
6
+ */
7
+
8
+ import type { LanguagePattern } from '../../types';
9
+
10
+ /**
11
+ * Get Hebrew event handler patterns.
12
+ */
13
+ export function getEventHandlerPatternsHe(): LanguagePattern[] {
14
+ return [];
15
+ }
@@ -14,6 +14,7 @@ import { getEventHandlerPatternsDe } from './de';
14
14
  import { getEventHandlerPatternsEn } from './en';
15
15
  import { getEventHandlerPatternsEs } from './es';
16
16
  import { getEventHandlerPatternsFr } from './fr';
17
+ import { getEventHandlerPatternsHe } from './he';
17
18
  import { getEventHandlerPatternsHi } from './hi';
18
19
  import { getEventHandlerPatternsId } from './id';
19
20
  import { getEventHandlerPatternsIt } from './it';
@@ -49,6 +50,8 @@ export function getEventHandlerPatternsForLanguage(language: string): LanguagePa
49
50
  return getEventHandlerPatternsEs();
50
51
  case 'fr':
51
52
  return getEventHandlerPatternsFr();
53
+ case 'he':
54
+ return getEventHandlerPatternsHe();
52
55
  case 'hi':
53
56
  return getEventHandlerPatternsHi();
54
57
  case 'id':
@@ -95,6 +98,7 @@ export { getEventHandlerPatternsDe } from './de';
95
98
  export { getEventHandlerPatternsEn } from './en';
96
99
  export { getEventHandlerPatternsEs } from './es';
97
100
  export { getEventHandlerPatternsFr } from './fr';
101
+ export { getEventHandlerPatternsHe } from './he';
98
102
  export { getEventHandlerPatternsHi } from './hi';
99
103
  export { getEventHandlerPatternsId } from './id';
100
104
  export { getEventHandlerPatternsIt } from './it';
@@ -116,4 +120,4 @@ export { getEventHandlerPatternsZh } from './zh';
116
120
  /**
117
121
  * Languages that have hand-crafted event-handler patterns.
118
122
  */
119
- export const eventhandlerPatternLanguages = ['ar', 'bn', 'de', 'en', 'es', 'fr', 'hi', 'id', 'it', 'ja', 'ko', 'ms', 'pl', 'pt', 'qu', 'ru', 'sw', 'th', 'tl', 'tr', 'uk', 'vi', 'zh'];
123
+ export const eventhandlerPatternLanguages = ['ar', 'bn', 'de', 'en', 'es', 'fr', 'he', 'hi', 'id', 'it', 'ja', 'ko', 'ms', 'pl', 'pt', 'qu', 'ru', 'sw', 'th', 'tl', 'tr', 'uk', 'vi', 'zh'];