@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Arabic Remove 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 remove patterns.
|
|
12
12
|
*/
|
|
13
13
|
export function getRemovePatternsAr(): LanguagePattern[] {
|
|
14
|
-
return [
|
|
15
|
-
{
|
|
16
|
-
id: 'remove-ar-full',
|
|
17
|
-
language: 'ar',
|
|
18
|
-
command: 'remove',
|
|
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: 'من' },
|
|
26
|
-
{ type: 'role', role: 'destination' },
|
|
27
|
-
],
|
|
28
|
-
},
|
|
29
|
-
extraction: {
|
|
30
|
-
patient: { position: 1 },
|
|
31
|
-
destination: { marker: 'من' },
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
id: 'remove-ar-simple',
|
|
36
|
-
language: 'ar',
|
|
37
|
-
command: 'remove',
|
|
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: 'remove-ar-with-عن',
|
|
53
|
-
language: 'ar',
|
|
54
|
-
command: 'remove',
|
|
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 { getRemovePatternsJa } from './ja';
|
|
|
16
16
|
import { getRemovePatternsKo } from './ko';
|
|
17
17
|
import { getRemovePatternsMs } from './ms';
|
|
18
18
|
import { getRemovePatternsPl } from './pl';
|
|
19
|
+
import { getRemovePatternsQu } from './qu';
|
|
19
20
|
import { getRemovePatternsRu } from './ru';
|
|
20
21
|
import { getRemovePatternsTh } from './th';
|
|
21
22
|
import { getRemovePatternsTl } from './tl';
|
|
@@ -45,6 +46,8 @@ export function getRemovePatternsForLanguage(language: string): LanguagePattern[
|
|
|
45
46
|
return getRemovePatternsMs();
|
|
46
47
|
case 'pl':
|
|
47
48
|
return getRemovePatternsPl();
|
|
49
|
+
case 'qu':
|
|
50
|
+
return getRemovePatternsQu();
|
|
48
51
|
case 'ru':
|
|
49
52
|
return getRemovePatternsRu();
|
|
50
53
|
case 'th':
|
|
@@ -73,6 +76,7 @@ export { getRemovePatternsJa } from './ja';
|
|
|
73
76
|
export { getRemovePatternsKo } from './ko';
|
|
74
77
|
export { getRemovePatternsMs } from './ms';
|
|
75
78
|
export { getRemovePatternsPl } from './pl';
|
|
79
|
+
export { getRemovePatternsQu } from './qu';
|
|
76
80
|
export { getRemovePatternsRu } from './ru';
|
|
77
81
|
export { getRemovePatternsTh } from './th';
|
|
78
82
|
export { getRemovePatternsTl } from './tl';
|
|
@@ -84,4 +88,4 @@ export { getRemovePatternsZh } from './zh';
|
|
|
84
88
|
/**
|
|
85
89
|
* Languages that have hand-crafted remove patterns.
|
|
86
90
|
*/
|
|
87
|
-
export const removePatternLanguages = ['ar', 'bn', 'hi', 'it', 'ja', 'ko', 'ms', 'pl', 'ru', 'th', 'tl', 'tr', 'uk', 'vi', 'zh'];
|
|
91
|
+
export const removePatternLanguages = ['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 Remove 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,64 +11,5 @@ import type { LanguagePattern } from '../../types';
|
|
|
11
11
|
* Get Japanese remove patterns.
|
|
12
12
|
*/
|
|
13
13
|
export function getRemovePatternsJa(): LanguagePattern[] {
|
|
14
|
-
return [
|
|
15
|
-
{
|
|
16
|
-
id: 'remove-ja-full',
|
|
17
|
-
language: 'ja',
|
|
18
|
-
command: 'remove',
|
|
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: 'remove-ja-simple',
|
|
37
|
-
language: 'ja',
|
|
38
|
-
command: 'remove',
|
|
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: 'remove-ja-possessive',
|
|
55
|
-
language: 'ja',
|
|
56
|
-
command: 'remove',
|
|
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
|
-
];
|
|
14
|
+
return [];
|
|
74
15
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Korean Remove 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,68 +11,5 @@ import type { LanguagePattern } from '../../types';
|
|
|
11
11
|
* Get Korean remove patterns.
|
|
12
12
|
*/
|
|
13
13
|
export function getRemovePatternsKo(): LanguagePattern[] {
|
|
14
|
-
return [
|
|
15
|
-
{
|
|
16
|
-
id: 'remove-ko-full',
|
|
17
|
-
language: 'ko',
|
|
18
|
-
command: 'remove',
|
|
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
|
-
{
|
|
28
|
-
type: 'literal',
|
|
29
|
-
value: '제거',
|
|
30
|
-
alternatives: ['제거하다', '삭제', '삭제하다', '빼다'],
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
extraction: {
|
|
35
|
-
destination: { position: 0 },
|
|
36
|
-
patient: { marker: '를', markerAlternatives: ['을'] },
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: 'remove-ko-simple',
|
|
41
|
-
language: 'ko',
|
|
42
|
-
command: 'remove',
|
|
43
|
-
priority: 90,
|
|
44
|
-
template: {
|
|
45
|
-
format: '{patient} 를 제거',
|
|
46
|
-
tokens: [
|
|
47
|
-
{ type: 'role', role: 'patient' },
|
|
48
|
-
{ type: 'literal', value: '를', alternatives: ['을'] },
|
|
49
|
-
{ type: 'literal', value: '제거', alternatives: ['제거하다', '삭제', '삭제하다'] },
|
|
50
|
-
],
|
|
51
|
-
},
|
|
52
|
-
extraction: {
|
|
53
|
-
patient: { position: 0 },
|
|
54
|
-
destination: { default: { type: 'reference', value: 'me' } },
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
id: 'remove-ko-possessive',
|
|
59
|
-
language: 'ko',
|
|
60
|
-
command: 'remove',
|
|
61
|
-
priority: 95,
|
|
62
|
-
template: {
|
|
63
|
-
format: '{destination} 의 {patient} 를 제거',
|
|
64
|
-
tokens: [
|
|
65
|
-
{ type: 'role', role: 'destination' },
|
|
66
|
-
{ type: 'literal', value: '의' },
|
|
67
|
-
{ type: 'role', role: 'patient' },
|
|
68
|
-
{ type: 'literal', value: '를', alternatives: ['을'] },
|
|
69
|
-
{ type: 'literal', value: '제거', alternatives: ['제거하다'] },
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
extraction: {
|
|
73
|
-
destination: { position: 0 },
|
|
74
|
-
patient: { marker: '를', markerAlternatives: ['을'] },
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
];
|
|
14
|
+
return [];
|
|
78
15
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quechua Remove Patterns
|
|
3
|
+
*
|
|
4
|
+
* Patterns for parsing "remove" command in Quechua (Runasimi).
|
|
5
|
+
* SOV word order with postposition suffixes (-ta for patient, -manta for source).
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { LanguagePattern } from '../../types';
|
|
9
|
+
|
|
10
|
+
export function getRemovePatternsQu(): LanguagePattern[] {
|
|
11
|
+
return [
|
|
12
|
+
// SOV pattern: .active ta qichuy (patient + verb)
|
|
13
|
+
{
|
|
14
|
+
id: 'remove-qu-sov',
|
|
15
|
+
language: 'qu',
|
|
16
|
+
command: 'remove',
|
|
17
|
+
priority: 100,
|
|
18
|
+
template: {
|
|
19
|
+
format: '{patient} ta qichuy',
|
|
20
|
+
tokens: [
|
|
21
|
+
{ type: 'role', role: 'patient' },
|
|
22
|
+
{ type: 'literal', value: 'ta' },
|
|
23
|
+
{ type: 'literal', value: 'qichuy', alternatives: ['hurquy', 'anchuchiy'] },
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
extraction: {
|
|
27
|
+
patient: { position: 0 },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
// Simple pattern: qichuy .active (verb + patient, more casual)
|
|
31
|
+
{
|
|
32
|
+
id: 'remove-qu-simple',
|
|
33
|
+
language: 'qu',
|
|
34
|
+
command: 'remove',
|
|
35
|
+
priority: 90,
|
|
36
|
+
template: {
|
|
37
|
+
format: 'qichuy {patient}',
|
|
38
|
+
tokens: [
|
|
39
|
+
{ type: 'literal', value: 'qichuy', alternatives: ['hurquy', 'anchuchiy'] },
|
|
40
|
+
{ type: 'role', role: 'patient' },
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
extraction: {
|
|
44
|
+
patient: { position: 1 },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
// With source: #button manta .active ta qichuy
|
|
48
|
+
{
|
|
49
|
+
id: 'remove-qu-with-source',
|
|
50
|
+
language: 'qu',
|
|
51
|
+
command: 'remove',
|
|
52
|
+
priority: 95,
|
|
53
|
+
template: {
|
|
54
|
+
format: '{source} manta {patient} ta qichuy',
|
|
55
|
+
tokens: [
|
|
56
|
+
{ type: 'role', role: 'source' },
|
|
57
|
+
{ type: 'literal', value: 'manta' },
|
|
58
|
+
{ type: 'role', role: 'patient' },
|
|
59
|
+
{ type: 'literal', value: 'ta' },
|
|
60
|
+
{ type: 'literal', value: 'qichuy', alternatives: ['hurquy', 'anchuchiy'] },
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
extraction: {
|
|
64
|
+
source: { position: 0 },
|
|
65
|
+
patient: { position: 2 },
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Turkish Remove 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,68 +11,5 @@ import type { LanguagePattern } from '../../types';
|
|
|
11
11
|
* Get Turkish remove patterns.
|
|
12
12
|
*/
|
|
13
13
|
export function getRemovePatternsTr(): LanguagePattern[] {
|
|
14
|
-
return [
|
|
15
|
-
{
|
|
16
|
-
id: 'remove-tr-full',
|
|
17
|
-
language: 'tr',
|
|
18
|
-
command: 'remove',
|
|
19
|
-
priority: 100,
|
|
20
|
-
template: {
|
|
21
|
-
format: "{destination}'dan {patient} kaldır",
|
|
22
|
-
tokens: [
|
|
23
|
-
{ type: 'role', role: 'destination' },
|
|
24
|
-
{
|
|
25
|
-
type: 'literal',
|
|
26
|
-
value: "'dan",
|
|
27
|
-
alternatives: ["'den", "'tan", "'ten", '-dan', '-den'],
|
|
28
|
-
},
|
|
29
|
-
{ type: 'role', role: 'patient' },
|
|
30
|
-
{
|
|
31
|
-
type: 'literal',
|
|
32
|
-
value: 'kaldır',
|
|
33
|
-
alternatives: ['kaldırmak', 'sil', 'silmek', 'çıkar'],
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
extraction: {
|
|
38
|
-
destination: { position: 0 },
|
|
39
|
-
patient: { position: 2 },
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
id: 'remove-tr-simple',
|
|
44
|
-
language: 'tr',
|
|
45
|
-
command: 'remove',
|
|
46
|
-
priority: 90,
|
|
47
|
-
template: {
|
|
48
|
-
format: '{patient} kaldır',
|
|
49
|
-
tokens: [
|
|
50
|
-
{ type: 'role', role: 'patient' },
|
|
51
|
-
{ type: 'literal', value: 'kaldır', alternatives: ['kaldırmak', 'sil', 'silmek'] },
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
extraction: {
|
|
55
|
-
patient: { position: 0 },
|
|
56
|
-
destination: { default: { type: 'reference', value: 'me' } },
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
id: 'remove-tr-accusative',
|
|
61
|
-
language: 'tr',
|
|
62
|
-
command: 'remove',
|
|
63
|
-
priority: 95,
|
|
64
|
-
template: {
|
|
65
|
-
format: "{patient}'i kaldır",
|
|
66
|
-
tokens: [
|
|
67
|
-
{ type: 'role', role: 'patient' },
|
|
68
|
-
{ type: 'literal', value: "'i", alternatives: ["'ı", "'u", "'ü", '-i', '-ı'] },
|
|
69
|
-
{ type: 'literal', value: 'kaldır', alternatives: ['kaldırmak', 'sil'] },
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
extraction: {
|
|
73
|
-
patient: { position: 0 },
|
|
74
|
-
destination: { default: { type: 'reference', value: 'me' } },
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
];
|
|
14
|
+
return [];
|
|
78
15
|
}
|
package/src/patterns/set/ar.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Arabic Set 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,74 +11,5 @@ import type { LanguagePattern } from '../../types';
|
|
|
11
11
|
* Get Arabic set patterns.
|
|
12
12
|
*/
|
|
13
13
|
export function getSetPatternsAr(): LanguagePattern[] {
|
|
14
|
-
return [
|
|
15
|
-
{
|
|
16
|
-
id: 'set-ar-full',
|
|
17
|
-
language: 'ar',
|
|
18
|
-
command: 'set',
|
|
19
|
-
priority: 100,
|
|
20
|
-
template: {
|
|
21
|
-
format: 'اضبط {destination} إلى {patient}',
|
|
22
|
-
tokens: [
|
|
23
|
-
{ type: 'literal', value: 'اضبط', alternatives: ['أضبط', 'عيّن', 'عين', 'حدد'] },
|
|
24
|
-
{
|
|
25
|
-
type: 'role',
|
|
26
|
-
role: 'destination',
|
|
27
|
-
expectedTypes: ['property-path', 'selector', 'reference', 'expression'],
|
|
28
|
-
},
|
|
29
|
-
{ type: 'literal', value: 'إلى', alternatives: ['الى', 'ل', 'لـ'] },
|
|
30
|
-
{ type: 'role', role: 'patient', expectedTypes: ['literal', 'expression', 'reference'] },
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
extraction: {
|
|
34
|
-
destination: { position: 1 },
|
|
35
|
-
patient: { marker: 'إلى', markerAlternatives: ['الى', 'ل', 'لـ'] },
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
id: 'set-ar-simple',
|
|
40
|
-
language: 'ar',
|
|
41
|
-
command: 'set',
|
|
42
|
-
priority: 90,
|
|
43
|
-
template: {
|
|
44
|
-
format: 'اضبط {destination} {patient}',
|
|
45
|
-
tokens: [
|
|
46
|
-
{ type: 'literal', value: 'اضبط', alternatives: ['أضبط', 'عيّن'] },
|
|
47
|
-
{
|
|
48
|
-
type: 'role',
|
|
49
|
-
role: 'destination',
|
|
50
|
-
expectedTypes: ['property-path', 'selector', 'reference', 'expression'],
|
|
51
|
-
},
|
|
52
|
-
{ type: 'role', role: 'patient', expectedTypes: ['literal', 'expression', 'reference'] },
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
extraction: {
|
|
56
|
-
destination: { position: 1 },
|
|
57
|
-
patient: { position: 2 },
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
id: 'set-ar-على',
|
|
62
|
-
language: 'ar',
|
|
63
|
-
command: 'set',
|
|
64
|
-
priority: 95,
|
|
65
|
-
template: {
|
|
66
|
-
format: 'اضبط {destination} على {patient}',
|
|
67
|
-
tokens: [
|
|
68
|
-
{ type: 'literal', value: 'اضبط', alternatives: ['أضبط'] },
|
|
69
|
-
{
|
|
70
|
-
type: 'role',
|
|
71
|
-
role: 'destination',
|
|
72
|
-
expectedTypes: ['property-path', 'selector', 'reference', 'expression'],
|
|
73
|
-
},
|
|
74
|
-
{ type: 'literal', value: 'على' },
|
|
75
|
-
{ type: 'role', role: 'patient', expectedTypes: ['literal', 'expression', 'reference'] },
|
|
76
|
-
],
|
|
77
|
-
},
|
|
78
|
-
extraction: {
|
|
79
|
-
destination: { position: 1 },
|
|
80
|
-
patient: { marker: 'على' },
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
];
|
|
14
|
+
return [];
|
|
84
15
|
}
|
package/src/patterns/set/ja.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Japanese Set 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,76 +11,5 @@ import type { LanguagePattern } from '../../types';
|
|
|
11
11
|
* Get Japanese set patterns.
|
|
12
12
|
*/
|
|
13
13
|
export function getSetPatternsJa(): LanguagePattern[] {
|
|
14
|
-
return [
|
|
15
|
-
{
|
|
16
|
-
id: 'set-ja-full',
|
|
17
|
-
language: 'ja',
|
|
18
|
-
command: 'set',
|
|
19
|
-
priority: 100,
|
|
20
|
-
template: {
|
|
21
|
-
format: '{destination} を {patient} に 設定',
|
|
22
|
-
tokens: [
|
|
23
|
-
{
|
|
24
|
-
type: 'role',
|
|
25
|
-
role: 'destination',
|
|
26
|
-
expectedTypes: ['property-path', 'selector', 'reference', 'expression'],
|
|
27
|
-
},
|
|
28
|
-
{ type: 'literal', value: 'を' },
|
|
29
|
-
{ type: 'role', role: 'patient', expectedTypes: ['literal', 'expression', 'reference'] },
|
|
30
|
-
{ type: 'literal', value: 'に' },
|
|
31
|
-
{ type: 'literal', value: '設定', alternatives: ['設定する', 'セット', 'セットする'] },
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
extraction: {
|
|
35
|
-
destination: { position: 0 },
|
|
36
|
-
patient: { position: 2 },
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: 'set-ja-simple',
|
|
41
|
-
language: 'ja',
|
|
42
|
-
command: 'set',
|
|
43
|
-
priority: 90,
|
|
44
|
-
template: {
|
|
45
|
-
format: '{destination} に {patient} を 設定',
|
|
46
|
-
tokens: [
|
|
47
|
-
{
|
|
48
|
-
type: 'role',
|
|
49
|
-
role: 'destination',
|
|
50
|
-
expectedTypes: ['property-path', 'selector', 'reference', 'expression'],
|
|
51
|
-
},
|
|
52
|
-
{ type: 'literal', value: 'に' },
|
|
53
|
-
{ type: 'role', role: 'patient', expectedTypes: ['literal', 'expression', 'reference'] },
|
|
54
|
-
{ type: 'literal', value: 'を' },
|
|
55
|
-
{ type: 'literal', value: '設定', alternatives: ['設定する'] },
|
|
56
|
-
],
|
|
57
|
-
},
|
|
58
|
-
extraction: {
|
|
59
|
-
destination: { position: 0 },
|
|
60
|
-
patient: { marker: 'を' },
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
id: 'set-ja-equals',
|
|
65
|
-
language: 'ja',
|
|
66
|
-
command: 'set',
|
|
67
|
-
priority: 95,
|
|
68
|
-
template: {
|
|
69
|
-
format: '{destination} は {patient}',
|
|
70
|
-
tokens: [
|
|
71
|
-
{
|
|
72
|
-
type: 'role',
|
|
73
|
-
role: 'destination',
|
|
74
|
-
expectedTypes: ['property-path', 'selector', 'reference', 'expression'],
|
|
75
|
-
},
|
|
76
|
-
{ type: 'literal', value: 'は' },
|
|
77
|
-
{ type: 'role', role: 'patient', expectedTypes: ['literal', 'expression', 'reference'] },
|
|
78
|
-
],
|
|
79
|
-
},
|
|
80
|
-
extraction: {
|
|
81
|
-
destination: { position: 0 },
|
|
82
|
-
patient: { position: 2 },
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
];
|
|
14
|
+
return [];
|
|
86
15
|
}
|
package/src/patterns/set/ko.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Korean Set 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,75 +11,5 @@ import type { LanguagePattern } from '../../types';
|
|
|
11
11
|
* Get Korean set patterns.
|
|
12
12
|
*/
|
|
13
13
|
export function getSetPatternsKo(): LanguagePattern[] {
|
|
14
|
-
return [
|
|
15
|
-
{
|
|
16
|
-
id: 'set-ko-full',
|
|
17
|
-
language: 'ko',
|
|
18
|
-
command: 'set',
|
|
19
|
-
priority: 100,
|
|
20
|
-
template: {
|
|
21
|
-
format: '{destination} 를 {patient} 로 설정',
|
|
22
|
-
tokens: [
|
|
23
|
-
{
|
|
24
|
-
type: 'role',
|
|
25
|
-
role: 'destination',
|
|
26
|
-
expectedTypes: ['property-path', 'selector', 'reference', 'expression'],
|
|
27
|
-
},
|
|
28
|
-
{ type: 'literal', value: '를', alternatives: ['을'] },
|
|
29
|
-
{ type: 'role', role: 'patient', expectedTypes: ['literal', 'expression', 'reference'] },
|
|
30
|
-
{ type: 'literal', value: '로', alternatives: ['으로'] },
|
|
31
|
-
{ type: 'literal', value: '설정', alternatives: ['설정하다', '설정해', '세트'] },
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
extraction: {
|
|
35
|
-
destination: { position: 0 },
|
|
36
|
-
patient: { position: 2 },
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: 'set-ko-simple',
|
|
41
|
-
language: 'ko',
|
|
42
|
-
command: 'set',
|
|
43
|
-
priority: 90,
|
|
44
|
-
template: {
|
|
45
|
-
format: '{destination} 에 {patient} 설정',
|
|
46
|
-
tokens: [
|
|
47
|
-
{
|
|
48
|
-
type: 'role',
|
|
49
|
-
role: 'destination',
|
|
50
|
-
expectedTypes: ['property-path', 'selector', 'reference', 'expression'],
|
|
51
|
-
},
|
|
52
|
-
{ type: 'literal', value: '에' },
|
|
53
|
-
{ type: 'role', role: 'patient', expectedTypes: ['literal', 'expression', 'reference'] },
|
|
54
|
-
{ type: 'literal', value: '설정', alternatives: ['설정하다'] },
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
extraction: {
|
|
58
|
-
destination: { position: 0 },
|
|
59
|
-
patient: { position: 2 },
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
id: 'set-ko-equals',
|
|
64
|
-
language: 'ko',
|
|
65
|
-
command: 'set',
|
|
66
|
-
priority: 95,
|
|
67
|
-
template: {
|
|
68
|
-
format: '{destination} 는 {patient}',
|
|
69
|
-
tokens: [
|
|
70
|
-
{
|
|
71
|
-
type: 'role',
|
|
72
|
-
role: 'destination',
|
|
73
|
-
expectedTypes: ['property-path', 'selector', 'reference', 'expression'],
|
|
74
|
-
},
|
|
75
|
-
{ type: 'literal', value: '는', alternatives: ['은'] },
|
|
76
|
-
{ type: 'role', role: 'patient', expectedTypes: ['literal', 'expression', 'reference'] },
|
|
77
|
-
],
|
|
78
|
-
},
|
|
79
|
-
extraction: {
|
|
80
|
-
destination: { position: 0 },
|
|
81
|
-
patient: { position: 2 },
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
];
|
|
14
|
+
return [];
|
|
85
15
|
}
|