@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.
- package/dist/browser-ar.ar.global.js +2 -2
- package/dist/browser-core.core.global.js +2 -2
- package/dist/browser-de.de.global.js +2 -2
- package/dist/browser-east-asian.east-asian.global.js +2 -2
- package/dist/browser-en-tr.en-tr.global.js +2 -2
- package/dist/browser-en.en.global.js +2 -2
- package/dist/browser-es-en.es-en.global.js +2 -2
- package/dist/browser-es.es.global.js +2 -2
- package/dist/browser-fr.fr.global.js +2 -2
- package/dist/browser-id.id.global.js +2 -2
- package/dist/browser-ja.ja.global.js +2 -2
- package/dist/browser-ko.ko.global.js +2 -2
- package/dist/browser-lazy.lazy.global.js +2 -2
- package/dist/browser-priority.priority.global.js +2 -2
- package/dist/browser-pt.pt.global.js +2 -2
- package/dist/browser-qu.qu.global.js +2 -2
- package/dist/browser-sw.sw.global.js +2 -2
- package/dist/browser-tr.tr.global.js +2 -2
- package/dist/browser-western.western.global.js +2 -2
- package/dist/browser-zh.zh.global.js +2 -2
- package/dist/browser.global.js +2 -2
- package/dist/browser.global.js.map +1 -1
- package/dist/index.cjs +13042 -17462
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -5
- package/dist/index.d.ts +49 -5
- package/dist/index.js +14044 -18464
- package/dist/index.js.map +1 -1
- package/dist/languages/ar.d.ts +1 -1
- package/dist/languages/ar.js +31 -44
- package/dist/languages/ar.js.map +1 -1
- package/dist/languages/de.d.ts +1 -1
- package/dist/languages/de.js +14 -2
- package/dist/languages/de.js.map +1 -1
- package/dist/languages/en.d.ts +1 -1
- package/dist/languages/en.js +558 -12
- package/dist/languages/en.js.map +1 -1
- package/dist/languages/es.d.ts +1 -1
- package/dist/languages/es.js +16 -0
- package/dist/languages/es.js.map +1 -1
- package/dist/languages/fr.d.ts +1 -1
- package/dist/languages/fr.js +14 -2
- package/dist/languages/fr.js.map +1 -1
- package/dist/languages/id.d.ts +1 -1
- package/dist/languages/id.js +14 -2
- package/dist/languages/id.js.map +1 -1
- package/dist/languages/ja.d.ts +1 -1
- package/dist/languages/ja.js +18 -3
- package/dist/languages/ja.js.map +1 -1
- package/dist/languages/ko.d.ts +8 -1
- package/dist/languages/ko.js +75 -43
- package/dist/languages/ko.js.map +1 -1
- package/dist/languages/pt.d.ts +1 -1
- package/dist/languages/pt.js +17 -0
- package/dist/languages/pt.js.map +1 -1
- package/dist/languages/qu.d.ts +12 -1
- package/dist/languages/qu.js +77 -2
- package/dist/languages/qu.js.map +1 -1
- package/dist/languages/sw.d.ts +1 -1
- package/dist/languages/sw.js.map +1 -1
- package/dist/languages/tr.d.ts +9 -1
- package/dist/languages/tr.js +96 -72
- package/dist/languages/tr.js.map +1 -1
- package/dist/languages/zh.d.ts +1 -1
- package/dist/languages/zh.js +16 -0
- package/dist/languages/zh.js.map +1 -1
- package/dist/{types-C4dcj53L.d.ts → types-BY3Id07j.d.ts} +20 -5
- package/package.json +20 -29
- package/src/generators/command-schemas.ts +21 -10
- package/src/generators/event-handler-generator.ts +50 -44
- package/src/generators/language-profiles.ts +6 -0
- package/src/generators/pattern-generator.ts +883 -1
- package/src/generators/profiles/arabic.ts +19 -3
- package/src/generators/profiles/bengali.ts +12 -1
- package/src/generators/profiles/chinese.ts +15 -0
- package/src/generators/profiles/french.ts +12 -1
- package/src/generators/profiles/german.ts +12 -1
- package/src/generators/profiles/hebrew.ts +148 -0
- package/src/generators/profiles/hindi.ts +12 -1
- package/src/generators/profiles/index.ts +2 -0
- package/src/generators/profiles/indonesian.ts +12 -1
- package/src/generators/profiles/italian.ts +16 -0
- package/src/generators/profiles/japanese.ts +11 -2
- package/src/generators/profiles/korean.ts +15 -1
- package/src/generators/profiles/polish.ts +12 -0
- package/src/generators/profiles/portuguese.ts +16 -0
- package/src/generators/profiles/russian.ts +11 -0
- package/src/generators/profiles/spanish.ts +15 -0
- package/src/generators/profiles/spanishMexico.ts +176 -0
- package/src/generators/profiles/thai.ts +11 -0
- package/src/generators/profiles/turkish.ts +49 -7
- package/src/generators/profiles/types.ts +21 -5
- package/src/generators/profiles/ukrainian.ts +11 -0
- package/src/generators/profiles/vietnamese.ts +11 -0
- package/src/language-building-schema.ts +111 -0
- package/src/languages/_all.ts +5 -1
- package/src/languages/es-MX.ts +32 -0
- package/src/languages/he.ts +15 -0
- package/src/parser/pattern-matcher.ts +10 -1
- package/src/parser/semantic-parser.ts +3 -0
- package/src/patterns/add/ar.ts +3 -59
- package/src/patterns/add/index.ts +5 -1
- package/src/patterns/add/ja.ts +3 -81
- package/src/patterns/add/ko.ts +3 -62
- package/src/patterns/add/qu.ts +69 -0
- package/src/patterns/add/tr.ts +3 -59
- package/src/patterns/builders.ts +1 -0
- package/src/patterns/decrement/tr.ts +3 -36
- package/src/patterns/event-handler/ar.ts +3 -139
- package/src/patterns/event-handler/he.ts +15 -0
- package/src/patterns/event-handler/index.ts +5 -1
- package/src/patterns/event-handler/ja.ts +3 -106
- package/src/patterns/event-handler/ko.ts +3 -121
- package/src/patterns/event-handler/ms.ts +45 -20
- package/src/patterns/event-handler/tr.ts +3 -158
- package/src/patterns/get/ar.ts +3 -37
- package/src/patterns/get/ja.ts +3 -41
- package/src/patterns/get/ko.ts +3 -41
- package/src/patterns/grammar-transformed/ja.ts +3 -1701
- package/src/patterns/grammar-transformed/ko.ts +3 -1299
- package/src/patterns/grammar-transformed/tr.ts +3 -1055
- package/src/patterns/hide/ar.ts +3 -55
- package/src/patterns/hide/ja.ts +3 -57
- package/src/patterns/hide/ko.ts +3 -57
- package/src/patterns/hide/tr.ts +3 -53
- package/src/patterns/increment/tr.ts +3 -40
- package/src/patterns/put/ar.ts +3 -62
- package/src/patterns/put/ja.ts +3 -63
- package/src/patterns/put/ko.ts +3 -55
- package/src/patterns/put/tr.ts +3 -55
- package/src/patterns/remove/ar.ts +3 -59
- package/src/patterns/remove/index.ts +5 -1
- package/src/patterns/remove/ja.ts +3 -62
- package/src/patterns/remove/ko.ts +3 -66
- package/src/patterns/remove/qu.ts +69 -0
- package/src/patterns/remove/tr.ts +3 -66
- package/src/patterns/set/ar.ts +3 -72
- package/src/patterns/set/ja.ts +3 -74
- package/src/patterns/set/ko.ts +3 -73
- package/src/patterns/set/tr.ts +3 -95
- package/src/patterns/show/ar.ts +3 -55
- package/src/patterns/show/ja.ts +3 -57
- package/src/patterns/show/ko.ts +3 -61
- package/src/patterns/show/tr.ts +3 -53
- package/src/patterns/take/ar.ts +3 -39
- package/src/patterns/toggle/ar.ts +3 -49
- package/src/patterns/toggle/index.ts +5 -1
- package/src/patterns/toggle/ja.ts +3 -144
- package/src/patterns/toggle/ko.ts +3 -101
- package/src/patterns/toggle/qu.ts +90 -0
- package/src/patterns/toggle/tr.ts +3 -76
- package/src/registry.ts +179 -15
- package/src/tokenizers/arabic.ts +13 -46
- package/src/tokenizers/bengali.ts +2 -16
- package/src/tokenizers/he.ts +542 -0
- package/src/tokenizers/index.ts +1 -0
- package/src/tokenizers/japanese.ts +3 -1
- package/src/tokenizers/korean.ts +104 -48
- package/src/tokenizers/ms.ts +3 -0
- package/src/tokenizers/quechua.ts +101 -2
- package/src/tokenizers/turkish.ts +64 -69
- package/src/types.ts +13 -0
package/src/patterns/add/ar.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Arabic Add Patterns
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
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'];
|
package/src/patterns/add/ja.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Japanese Add Patterns
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
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
|
}
|
package/src/patterns/add/ko.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Korean Add Patterns
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
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
|
+
}
|
package/src/patterns/add/tr.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Turkish Add Patterns
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
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
|
}
|
package/src/patterns/builders.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Turkish Decrement Patterns
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
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
|
-
*
|
|
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'];
|