@lokascript/domain-voice 2.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/generators/voice-generator.d.ts +8 -0
- package/dist/generators/voice-renderer.d.ts +14 -0
- package/dist/index.cjs +1864 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +152 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +1803 -0
- package/dist/index.js.map +1 -0
- package/dist/profiles/index.d.ts +20 -0
- package/dist/schemas/index.d.ts +16 -0
- package/dist/tokenizers/index.d.ts +16 -0
- package/dist/types.d.ts +23 -0
- package/package.json +48 -0
- package/src/__test__/voice-domain.test.ts +1232 -0
- package/src/generators/voice-generator.ts +313 -0
- package/src/generators/voice-renderer.ts +420 -0
- package/src/index.ts +190 -0
- package/src/profiles/index.ts +235 -0
- package/src/schemas/index.ts +515 -0
- package/src/tokenizers/index.ts +644 -0
- package/src/types.ts +36 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Voice/Accessibility Language Profiles
|
|
3
|
+
*
|
|
4
|
+
* Pattern generation profiles for each supported language (8 total).
|
|
5
|
+
* These define keyword translations and word order for pattern generation.
|
|
6
|
+
*
|
|
7
|
+
* Role markers are specified via `markerOverride` on each schema role
|
|
8
|
+
* (in schemas/index.ts). Profile-level roleMarkers are only needed
|
|
9
|
+
* when the default position (SOV=after, else=before) is wrong.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type { PatternGenLanguageProfile } from '@lokascript/framework';
|
|
13
|
+
|
|
14
|
+
// =============================================================================
|
|
15
|
+
// English (SVO)
|
|
16
|
+
// =============================================================================
|
|
17
|
+
|
|
18
|
+
export const enProfile: PatternGenLanguageProfile = {
|
|
19
|
+
code: 'en',
|
|
20
|
+
wordOrder: 'SVO',
|
|
21
|
+
keywords: {
|
|
22
|
+
navigate: { primary: 'navigate', alternatives: ['go'] },
|
|
23
|
+
click: { primary: 'click', alternatives: ['press', 'tap'] },
|
|
24
|
+
type: { primary: 'type', alternatives: ['enter'] },
|
|
25
|
+
scroll: { primary: 'scroll' },
|
|
26
|
+
read: { primary: 'read', alternatives: ['say'] },
|
|
27
|
+
zoom: { primary: 'zoom' },
|
|
28
|
+
select: { primary: 'select' },
|
|
29
|
+
back: { primary: 'back' },
|
|
30
|
+
forward: { primary: 'forward' },
|
|
31
|
+
focus: { primary: 'focus' },
|
|
32
|
+
close: { primary: 'close' },
|
|
33
|
+
open: { primary: 'open' },
|
|
34
|
+
search: { primary: 'search', alternatives: ['find'] },
|
|
35
|
+
help: { primary: 'help' },
|
|
36
|
+
},
|
|
37
|
+
roleMarkers: {},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// =============================================================================
|
|
41
|
+
// Spanish (SVO)
|
|
42
|
+
// =============================================================================
|
|
43
|
+
|
|
44
|
+
export const esProfile: PatternGenLanguageProfile = {
|
|
45
|
+
code: 'es',
|
|
46
|
+
wordOrder: 'SVO',
|
|
47
|
+
keywords: {
|
|
48
|
+
navigate: { primary: 'navegar', alternatives: ['ir'] },
|
|
49
|
+
click: { primary: 'clic', alternatives: ['pulsar'] },
|
|
50
|
+
type: { primary: 'escribir' },
|
|
51
|
+
scroll: { primary: 'desplazar' },
|
|
52
|
+
read: { primary: 'leer' },
|
|
53
|
+
zoom: { primary: 'zoom' },
|
|
54
|
+
select: { primary: 'seleccionar' },
|
|
55
|
+
back: { primary: 'atrás', alternatives: ['volver'] },
|
|
56
|
+
forward: { primary: 'adelante' },
|
|
57
|
+
focus: { primary: 'enfocar' },
|
|
58
|
+
close: { primary: 'cerrar' },
|
|
59
|
+
open: { primary: 'abrir' },
|
|
60
|
+
search: { primary: 'buscar' },
|
|
61
|
+
help: { primary: 'ayuda' },
|
|
62
|
+
},
|
|
63
|
+
roleMarkers: {},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// =============================================================================
|
|
67
|
+
// Japanese (SOV)
|
|
68
|
+
// =============================================================================
|
|
69
|
+
|
|
70
|
+
export const jaProfile: PatternGenLanguageProfile = {
|
|
71
|
+
code: 'ja',
|
|
72
|
+
wordOrder: 'SOV',
|
|
73
|
+
keywords: {
|
|
74
|
+
navigate: { primary: '移動' },
|
|
75
|
+
click: { primary: 'クリック' },
|
|
76
|
+
type: { primary: '入力' },
|
|
77
|
+
scroll: { primary: 'スクロール' },
|
|
78
|
+
read: { primary: '読む' },
|
|
79
|
+
zoom: { primary: 'ズーム' },
|
|
80
|
+
select: { primary: '選択' },
|
|
81
|
+
back: { primary: '戻る' },
|
|
82
|
+
forward: { primary: '進む' },
|
|
83
|
+
focus: { primary: 'フォーカス' },
|
|
84
|
+
close: { primary: '閉じる' },
|
|
85
|
+
open: { primary: '開く' },
|
|
86
|
+
search: { primary: '検索' },
|
|
87
|
+
help: { primary: 'ヘルプ' },
|
|
88
|
+
},
|
|
89
|
+
roleMarkers: {},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// =============================================================================
|
|
93
|
+
// Arabic (VSO)
|
|
94
|
+
// =============================================================================
|
|
95
|
+
|
|
96
|
+
export const arProfile: PatternGenLanguageProfile = {
|
|
97
|
+
code: 'ar',
|
|
98
|
+
wordOrder: 'VSO',
|
|
99
|
+
keywords: {
|
|
100
|
+
navigate: { primary: 'انتقل' },
|
|
101
|
+
click: { primary: 'انقر' },
|
|
102
|
+
type: { primary: 'اكتب' },
|
|
103
|
+
scroll: { primary: 'تمرير' },
|
|
104
|
+
read: { primary: 'اقرأ' },
|
|
105
|
+
zoom: { primary: 'تكبير' },
|
|
106
|
+
select: { primary: 'اختر' },
|
|
107
|
+
back: { primary: 'رجوع' },
|
|
108
|
+
forward: { primary: 'تقدم' },
|
|
109
|
+
focus: { primary: 'ركز' },
|
|
110
|
+
close: { primary: 'أغلق' },
|
|
111
|
+
open: { primary: 'افتح' },
|
|
112
|
+
search: { primary: 'ابحث' },
|
|
113
|
+
help: { primary: 'مساعدة' },
|
|
114
|
+
},
|
|
115
|
+
roleMarkers: {},
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// =============================================================================
|
|
119
|
+
// Korean (SOV)
|
|
120
|
+
// =============================================================================
|
|
121
|
+
|
|
122
|
+
export const koProfile: PatternGenLanguageProfile = {
|
|
123
|
+
code: 'ko',
|
|
124
|
+
wordOrder: 'SOV',
|
|
125
|
+
keywords: {
|
|
126
|
+
navigate: { primary: '이동' },
|
|
127
|
+
click: { primary: '클릭' },
|
|
128
|
+
type: { primary: '입력' },
|
|
129
|
+
scroll: { primary: '스크롤' },
|
|
130
|
+
read: { primary: '읽기' },
|
|
131
|
+
zoom: { primary: '확대' },
|
|
132
|
+
select: { primary: '선택' },
|
|
133
|
+
back: { primary: '뒤로' },
|
|
134
|
+
forward: { primary: '앞으로' },
|
|
135
|
+
focus: { primary: '포커스' },
|
|
136
|
+
close: { primary: '닫기' },
|
|
137
|
+
open: { primary: '열기' },
|
|
138
|
+
search: { primary: '검색' },
|
|
139
|
+
help: { primary: '도움말' },
|
|
140
|
+
},
|
|
141
|
+
roleMarkers: {},
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
// =============================================================================
|
|
145
|
+
// Chinese (SVO)
|
|
146
|
+
// =============================================================================
|
|
147
|
+
|
|
148
|
+
export const zhProfile: PatternGenLanguageProfile = {
|
|
149
|
+
code: 'zh',
|
|
150
|
+
wordOrder: 'SVO',
|
|
151
|
+
keywords: {
|
|
152
|
+
navigate: { primary: '导航' },
|
|
153
|
+
click: { primary: '点击' },
|
|
154
|
+
type: { primary: '输入' },
|
|
155
|
+
scroll: { primary: '滚动' },
|
|
156
|
+
read: { primary: '朗读' },
|
|
157
|
+
zoom: { primary: '缩放' },
|
|
158
|
+
select: { primary: '选择' },
|
|
159
|
+
back: { primary: '返回' },
|
|
160
|
+
forward: { primary: '前进' },
|
|
161
|
+
focus: { primary: '聚焦' },
|
|
162
|
+
close: { primary: '关闭' },
|
|
163
|
+
open: { primary: '打开' },
|
|
164
|
+
search: { primary: '搜索' },
|
|
165
|
+
help: { primary: '帮助' },
|
|
166
|
+
},
|
|
167
|
+
roleMarkers: {},
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
// =============================================================================
|
|
171
|
+
// Turkish (SOV)
|
|
172
|
+
// =============================================================================
|
|
173
|
+
|
|
174
|
+
export const trProfile: PatternGenLanguageProfile = {
|
|
175
|
+
code: 'tr',
|
|
176
|
+
wordOrder: 'SOV',
|
|
177
|
+
keywords: {
|
|
178
|
+
navigate: { primary: 'git' },
|
|
179
|
+
click: { primary: 'tıkla' },
|
|
180
|
+
type: { primary: 'yaz' },
|
|
181
|
+
scroll: { primary: 'kaydır' },
|
|
182
|
+
read: { primary: 'oku' },
|
|
183
|
+
zoom: { primary: 'yakınlaş' },
|
|
184
|
+
select: { primary: 'seç' },
|
|
185
|
+
back: { primary: 'geri' },
|
|
186
|
+
forward: { primary: 'ileri' },
|
|
187
|
+
focus: { primary: 'odakla' },
|
|
188
|
+
close: { primary: 'kapat' },
|
|
189
|
+
open: { primary: 'aç' },
|
|
190
|
+
search: { primary: 'ara' },
|
|
191
|
+
help: { primary: 'yardım' },
|
|
192
|
+
},
|
|
193
|
+
roleMarkers: {},
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
// =============================================================================
|
|
197
|
+
// French (SVO)
|
|
198
|
+
// =============================================================================
|
|
199
|
+
|
|
200
|
+
export const frProfile: PatternGenLanguageProfile = {
|
|
201
|
+
code: 'fr',
|
|
202
|
+
wordOrder: 'SVO',
|
|
203
|
+
keywords: {
|
|
204
|
+
navigate: { primary: 'naviguer', alternatives: ['aller'] },
|
|
205
|
+
click: { primary: 'cliquer' },
|
|
206
|
+
type: { primary: 'taper', alternatives: ['écrire'] },
|
|
207
|
+
scroll: { primary: 'défiler' },
|
|
208
|
+
read: { primary: 'lire' },
|
|
209
|
+
zoom: { primary: 'zoomer' },
|
|
210
|
+
select: { primary: 'sélectionner' },
|
|
211
|
+
back: { primary: 'retour' },
|
|
212
|
+
forward: { primary: 'avancer' },
|
|
213
|
+
focus: { primary: 'focaliser' },
|
|
214
|
+
close: { primary: 'fermer' },
|
|
215
|
+
open: { primary: 'ouvrir' },
|
|
216
|
+
search: { primary: 'chercher', alternatives: ['rechercher'] },
|
|
217
|
+
help: { primary: 'aide' },
|
|
218
|
+
},
|
|
219
|
+
roleMarkers: {},
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
// =============================================================================
|
|
223
|
+
// All Profiles
|
|
224
|
+
// =============================================================================
|
|
225
|
+
|
|
226
|
+
export const allProfiles = [
|
|
227
|
+
enProfile,
|
|
228
|
+
esProfile,
|
|
229
|
+
jaProfile,
|
|
230
|
+
arProfile,
|
|
231
|
+
koProfile,
|
|
232
|
+
zhProfile,
|
|
233
|
+
trProfile,
|
|
234
|
+
frProfile,
|
|
235
|
+
];
|