@lokascript/compilation-service 2.11.1 → 3.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/CHANGELOG.md +301 -1
- package/dist/{chunk-HRUSP6F2.js → chunk-5CZBYL6A.js} +2 -2
- package/dist/{chunk-BDISUJ32.js → chunk-TVK2OFIB.js} +14 -5
- package/dist/chunk-TVK2OFIB.js.map +1 -0
- package/dist/{core-parser-adapter-VCJB52SO-W3GDT5C6.js → core-parser-adapter-W5UPZR4X-AIVYD5RA.js} +2 -2
- package/dist/dist-GFKFJKU6.js +27074 -0
- package/dist/dist-GFKFJKU6.js.map +1 -0
- package/dist/{dist-4JWIJVFR.js → dist-HDVJKXUX.js} +17 -8
- package/dist/dist-HDVJKXUX.js.map +1 -0
- package/dist/http.cjs +19459 -78384
- package/dist/http.cjs.map +1 -1
- package/dist/http.js +1 -1
- package/dist/index.cjs +19510 -78435
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/multilingual-VYI3FTN7.js +485 -0
- package/dist/multilingual-VYI3FTN7.js.map +1 -0
- package/package.json +5 -5
- package/dist/chunk-BDISUJ32.js.map +0 -1
- package/dist/dist-4JWIJVFR.js.map +0 -1
- package/dist/dist-MGUUIWYB.js +0 -86915
- package/dist/dist-MGUUIWYB.js.map +0 -1
- /package/dist/{chunk-HRUSP6F2.js.map → chunk-5CZBYL6A.js.map} +0 -0
- /package/dist/{core-parser-adapter-VCJB52SO-W3GDT5C6.js.map → core-parser-adapter-W5UPZR4X-AIVYD5RA.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
import "./chunk-GBPMR66W.js";
|
|
2
|
+
|
|
3
|
+
// ../core/dist/multilingual/index.mjs
|
|
4
|
+
import { getSchema } from "@lokascript/semantic";
|
|
5
|
+
|
|
6
|
+
// ../intent/dist/index.js
|
|
7
|
+
function inferRolesFromSchema(schema, args, modifiers, target, adapter) {
|
|
8
|
+
const roles = {};
|
|
9
|
+
const skipTokens = new Set(schema.argSkipTokens ?? []);
|
|
10
|
+
const usedArgIndices = /* @__PURE__ */ new Set();
|
|
11
|
+
for (const role of schema.roles) {
|
|
12
|
+
const markers = englishMarkers(role);
|
|
13
|
+
if (markers.length === 0) continue;
|
|
14
|
+
let matched = tryModifierMarkers(role, markers, modifiers, adapter);
|
|
15
|
+
if (!matched) {
|
|
16
|
+
matched = tryArgMarkers(role, markers, args, skipTokens, usedArgIndices, adapter);
|
|
17
|
+
}
|
|
18
|
+
if (matched) {
|
|
19
|
+
roles[role.role] = matched.value;
|
|
20
|
+
if (role.methodCarrier) {
|
|
21
|
+
roles[role.methodCarrier] = adapter.createLiteralValue(matched.matchedMarker);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target !== void 0) {
|
|
26
|
+
const tgtRole = schema.targetRole ?? "destination";
|
|
27
|
+
if (roles[tgtRole] === void 0) {
|
|
28
|
+
roles[tgtRole] = adapter.convertValue(target);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const positionalRoles = schema.roles.filter((r) => englishMarkers(r).length === 0 && roles[r.role] === void 0).sort((a, b) => (a.svoPosition ?? 99) - (b.svoPosition ?? 99));
|
|
32
|
+
let cursor = 0;
|
|
33
|
+
for (const role of positionalRoles) {
|
|
34
|
+
while (cursor < args.length) {
|
|
35
|
+
if (usedArgIndices.has(cursor)) {
|
|
36
|
+
cursor++;
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const name = adapter.getIdentifierName(args[cursor]);
|
|
40
|
+
if (name !== void 0 && skipTokens.has(name)) {
|
|
41
|
+
cursor++;
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
roles[role.role] = adapter.convertValue(args[cursor]);
|
|
45
|
+
usedArgIndices.add(cursor);
|
|
46
|
+
cursor++;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return roles;
|
|
51
|
+
}
|
|
52
|
+
function englishMarkers(role) {
|
|
53
|
+
const primary = role.markerOverride?.en;
|
|
54
|
+
const variants = role.markerVariants?.en ?? [];
|
|
55
|
+
const out = [];
|
|
56
|
+
if (typeof primary === "string" && primary !== "") out.push(primary);
|
|
57
|
+
for (const v of variants) if (v !== "") out.push(v);
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
function tryModifierMarkers(_role, markers, modifiers, adapter) {
|
|
61
|
+
if (!modifiers) return void 0;
|
|
62
|
+
for (const m of markers) {
|
|
63
|
+
if (!(m in modifiers)) continue;
|
|
64
|
+
const raw = modifiers[m];
|
|
65
|
+
if (raw === void 0 || raw === null) continue;
|
|
66
|
+
if (typeof raw === "string") {
|
|
67
|
+
return { value: adapter.createLiteralValue(raw), matchedMarker: m };
|
|
68
|
+
}
|
|
69
|
+
if (typeof raw === "object" && "type" in raw) {
|
|
70
|
+
return { value: adapter.convertValue(raw), matchedMarker: m };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return void 0;
|
|
74
|
+
}
|
|
75
|
+
function tryArgMarkers(_role, markers, args, skipTokens, usedArgIndices, adapter) {
|
|
76
|
+
const sorted = [...markers].sort((a, b) => b.split(/\s+/).length - a.split(/\s+/).length);
|
|
77
|
+
for (const marker of sorted) {
|
|
78
|
+
const words = marker.split(/\s+/).filter((w) => w.length > 0);
|
|
79
|
+
if (words.length === 0) continue;
|
|
80
|
+
for (let i = 0; i + words.length <= args.length; i++) {
|
|
81
|
+
let allMatch = true;
|
|
82
|
+
for (let w = 0; w < words.length; w++) {
|
|
83
|
+
if (usedArgIndices.has(i + w)) {
|
|
84
|
+
allMatch = false;
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
const name = adapter.getIdentifierName(args[i + w]);
|
|
88
|
+
if (name !== words[w]) {
|
|
89
|
+
allMatch = false;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (!allMatch) continue;
|
|
94
|
+
for (let v = i + words.length; v < args.length; v++) {
|
|
95
|
+
if (usedArgIndices.has(v)) continue;
|
|
96
|
+
const name = adapter.getIdentifierName(args[v]);
|
|
97
|
+
if (name !== void 0 && skipTokens.has(name)) continue;
|
|
98
|
+
for (let w = 0; w < words.length; w++) usedArgIndices.add(i + w);
|
|
99
|
+
usedArgIndices.add(v);
|
|
100
|
+
return { value: adapter.convertValue(args[v]), matchedMarker: marker };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return void 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// ../core/dist/multilingual/index.mjs
|
|
108
|
+
var DEFAULT_CONFIDENCE_THRESHOLD = 0.5;
|
|
109
|
+
function checkDebugEnabled() {
|
|
110
|
+
if (typeof localStorage !== "undefined") {
|
|
111
|
+
try {
|
|
112
|
+
const ls = localStorage;
|
|
113
|
+
const setting = ls.getItem("hyperfixi:debug") || ls.getItem("lokascript:debug");
|
|
114
|
+
if (setting === "*" || setting === "true")
|
|
115
|
+
return true;
|
|
116
|
+
} catch {
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (typeof window !== "undefined" && window.__HYPERFIXI_DEBUG__) {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
if (typeof process !== "undefined" && process.env?.HYPERFIXI_DEBUG === "true") {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
var isDebugEnabled = checkDebugEnabled();
|
|
128
|
+
var DEBUG = {
|
|
129
|
+
commands: isDebugEnabled,
|
|
130
|
+
events: isDebugEnabled,
|
|
131
|
+
parsing: isDebugEnabled,
|
|
132
|
+
expressions: isDebugEnabled,
|
|
133
|
+
styles: isDebugEnabled,
|
|
134
|
+
runtime: isDebugEnabled,
|
|
135
|
+
loops: isDebugEnabled,
|
|
136
|
+
async: isDebugEnabled
|
|
137
|
+
};
|
|
138
|
+
var debug = {
|
|
139
|
+
command: (...args) => {
|
|
140
|
+
if (DEBUG.commands)
|
|
141
|
+
console.log("\u{1F527}", ...args);
|
|
142
|
+
},
|
|
143
|
+
event: (...args) => {
|
|
144
|
+
if (DEBUG.events)
|
|
145
|
+
console.log("\u{1F3AF}", ...args);
|
|
146
|
+
},
|
|
147
|
+
parse: (...args) => {
|
|
148
|
+
if (DEBUG.parsing)
|
|
149
|
+
console.log("\u{1F4DD}", ...args);
|
|
150
|
+
},
|
|
151
|
+
expr: (...args) => {
|
|
152
|
+
if (DEBUG.expressions)
|
|
153
|
+
console.log("\u{1F50D}", ...args);
|
|
154
|
+
},
|
|
155
|
+
expressions: (...args) => {
|
|
156
|
+
if (DEBUG.expressions)
|
|
157
|
+
console.log("\u{1F50D}", ...args);
|
|
158
|
+
},
|
|
159
|
+
style: (...args) => {
|
|
160
|
+
if (DEBUG.styles)
|
|
161
|
+
console.log("\u{1F3A8}", ...args);
|
|
162
|
+
},
|
|
163
|
+
runtime: (...args) => {
|
|
164
|
+
if (DEBUG.runtime)
|
|
165
|
+
console.log("\u{1F680}", ...args);
|
|
166
|
+
},
|
|
167
|
+
loop: (...args) => {
|
|
168
|
+
if (DEBUG.loops)
|
|
169
|
+
console.log("\u{1F501}", ...args);
|
|
170
|
+
},
|
|
171
|
+
async: (...args) => {
|
|
172
|
+
if (DEBUG.async)
|
|
173
|
+
console.log("\u23F3", ...args);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
function unconsumedInputWarnings(node) {
|
|
177
|
+
const diagnostics = node.diagnostics;
|
|
178
|
+
if (!diagnostics?.length)
|
|
179
|
+
return [];
|
|
180
|
+
return diagnostics.filter((d) => d.code === "unconsumed-input").map((d) => d.message);
|
|
181
|
+
}
|
|
182
|
+
var _semanticModule = null;
|
|
183
|
+
async function getSemanticModule() {
|
|
184
|
+
if (!_semanticModule) {
|
|
185
|
+
_semanticModule = await import("@lokascript/semantic");
|
|
186
|
+
}
|
|
187
|
+
return _semanticModule;
|
|
188
|
+
}
|
|
189
|
+
var SemanticGrammarBridge = class {
|
|
190
|
+
constructor(config = {}) {
|
|
191
|
+
this._initialized = false;
|
|
192
|
+
this.config = {
|
|
193
|
+
confidenceThreshold: config.confidenceThreshold ?? DEFAULT_CONFIDENCE_THRESHOLD,
|
|
194
|
+
fallbackOnLowConfidence: config.fallbackOnLowConfidence ?? true
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
async initialize() {
|
|
198
|
+
await getSemanticModule();
|
|
199
|
+
this._initialized = true;
|
|
200
|
+
}
|
|
201
|
+
isInitialized() {
|
|
202
|
+
return this._initialized;
|
|
203
|
+
}
|
|
204
|
+
async transform(input, sourceLang, targetLang) {
|
|
205
|
+
if (!this.isInitialized()) {
|
|
206
|
+
await this.initialize();
|
|
207
|
+
}
|
|
208
|
+
if (sourceLang === targetLang) {
|
|
209
|
+
return {
|
|
210
|
+
output: input,
|
|
211
|
+
usedSemantic: false,
|
|
212
|
+
confidence: 1,
|
|
213
|
+
sourceLang,
|
|
214
|
+
targetLang
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
const semantic = await getSemanticModule();
|
|
218
|
+
try {
|
|
219
|
+
const output = semantic.translate(input, sourceLang, targetLang);
|
|
220
|
+
if (output !== input) {
|
|
221
|
+
return {
|
|
222
|
+
output,
|
|
223
|
+
usedSemantic: true,
|
|
224
|
+
confidence: 0.9,
|
|
225
|
+
sourceLang,
|
|
226
|
+
targetLang
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
} catch {
|
|
230
|
+
}
|
|
231
|
+
return {
|
|
232
|
+
output: input,
|
|
233
|
+
usedSemantic: false,
|
|
234
|
+
confidence: 0,
|
|
235
|
+
sourceLang,
|
|
236
|
+
targetLang
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
async parse(input, lang) {
|
|
240
|
+
if (!this.isInitialized()) {
|
|
241
|
+
await this.initialize();
|
|
242
|
+
}
|
|
243
|
+
const semantic = await getSemanticModule();
|
|
244
|
+
const result = semantic.parseSemantic(input, lang);
|
|
245
|
+
return result.node ?? null;
|
|
246
|
+
}
|
|
247
|
+
async render(node, targetLang) {
|
|
248
|
+
const semantic = await getSemanticModule();
|
|
249
|
+
return semantic.render(node, targetLang);
|
|
250
|
+
}
|
|
251
|
+
async parseToAST(input, lang) {
|
|
252
|
+
if (!this.isInitialized()) {
|
|
253
|
+
await this.initialize();
|
|
254
|
+
}
|
|
255
|
+
const semantic = await getSemanticModule();
|
|
256
|
+
const result = semantic.parseSemantic(input, lang);
|
|
257
|
+
if (result.confidence >= this.config.confidenceThreshold && result.node) {
|
|
258
|
+
try {
|
|
259
|
+
const buildResult = semantic.buildAST(result.node);
|
|
260
|
+
return buildResult.ast;
|
|
261
|
+
} catch (error) {
|
|
262
|
+
debug.runtime("[SemanticGrammarBridge] AST build failed, using fallback:", error);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return null;
|
|
266
|
+
}
|
|
267
|
+
async parseToASTWithDetails(input, lang) {
|
|
268
|
+
if (!this.isInitialized()) {
|
|
269
|
+
await this.initialize();
|
|
270
|
+
}
|
|
271
|
+
const semantic = await getSemanticModule();
|
|
272
|
+
const result = semantic.parseSemantic(input, lang);
|
|
273
|
+
if (result.confidence >= this.config.confidenceThreshold && result.node) {
|
|
274
|
+
try {
|
|
275
|
+
const buildResult = semantic.buildAST(result.node);
|
|
276
|
+
return {
|
|
277
|
+
ast: buildResult.ast,
|
|
278
|
+
usedDirectPath: true,
|
|
279
|
+
confidence: result.confidence,
|
|
280
|
+
lang,
|
|
281
|
+
fallbackText: null,
|
|
282
|
+
warnings: [...buildResult.warnings ?? [], ...unconsumedInputWarnings(result.node)]
|
|
283
|
+
};
|
|
284
|
+
} catch {
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
if (result.node && this.config.fallbackOnLowConfidence) {
|
|
288
|
+
const englishText = semantic.render(result.node, "en");
|
|
289
|
+
return {
|
|
290
|
+
ast: null,
|
|
291
|
+
usedDirectPath: false,
|
|
292
|
+
confidence: result.confidence,
|
|
293
|
+
lang,
|
|
294
|
+
fallbackText: englishText
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
return {
|
|
298
|
+
ast: null,
|
|
299
|
+
usedDirectPath: false,
|
|
300
|
+
confidence: result.confidence,
|
|
301
|
+
lang,
|
|
302
|
+
fallbackText: null
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
async getAllTranslations(input, sourceLang) {
|
|
306
|
+
const semantic = await getSemanticModule();
|
|
307
|
+
const languages = semantic.getSupportedLanguages();
|
|
308
|
+
const results = {};
|
|
309
|
+
for (const lang of languages) {
|
|
310
|
+
results[lang] = await this.transform(input, sourceLang, lang);
|
|
311
|
+
}
|
|
312
|
+
return results;
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
var _defaultBridge = null;
|
|
316
|
+
async function getDefaultBridge() {
|
|
317
|
+
if (!_defaultBridge) {
|
|
318
|
+
_defaultBridge = new SemanticGrammarBridge();
|
|
319
|
+
await _defaultBridge.initialize();
|
|
320
|
+
}
|
|
321
|
+
return _defaultBridge;
|
|
322
|
+
}
|
|
323
|
+
async function translate(input, sourceLang, targetLang) {
|
|
324
|
+
const bridge = await getDefaultBridge();
|
|
325
|
+
const result = await bridge.transform(input, sourceLang, targetLang);
|
|
326
|
+
return result.output;
|
|
327
|
+
}
|
|
328
|
+
var INTERCHANGE_ADAPTER = {
|
|
329
|
+
getIdentifierName(node) {
|
|
330
|
+
if (node.type !== "identifier")
|
|
331
|
+
return void 0;
|
|
332
|
+
const ident = node;
|
|
333
|
+
if (typeof ident.name === "string" && ident.name !== "")
|
|
334
|
+
return ident.name;
|
|
335
|
+
if (typeof ident.value === "string")
|
|
336
|
+
return ident.value;
|
|
337
|
+
return void 0;
|
|
338
|
+
},
|
|
339
|
+
convertValue(node) {
|
|
340
|
+
return node;
|
|
341
|
+
},
|
|
342
|
+
createLiteralValue(text) {
|
|
343
|
+
return { type: "literal", value: text };
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
var schemaRoleInferrer = (name, args, modifiers, target) => {
|
|
347
|
+
const schema = getSchema(name);
|
|
348
|
+
if (!schema)
|
|
349
|
+
return null;
|
|
350
|
+
const inferred = inferRolesFromSchema(schema, args, modifiers, target, INTERCHANGE_ADAPTER);
|
|
351
|
+
const declared = schema.ast?.modifiers;
|
|
352
|
+
if (declared && modifiers) {
|
|
353
|
+
for (const [key, role] of Object.entries(declared)) {
|
|
354
|
+
const value = modifiers[key];
|
|
355
|
+
const isNode = !!value && typeof value === "object" && "type" in value;
|
|
356
|
+
if (isNode && inferred[role] === void 0) {
|
|
357
|
+
inferred[role] = value;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
return Object.keys(inferred).length > 0 ? inferred : null;
|
|
362
|
+
};
|
|
363
|
+
var MultilingualHyperscript = class {
|
|
364
|
+
constructor(config = {}) {
|
|
365
|
+
this.initialized = false;
|
|
366
|
+
this.bridge = new SemanticGrammarBridge(config);
|
|
367
|
+
}
|
|
368
|
+
async initialize() {
|
|
369
|
+
if (this.initialized)
|
|
370
|
+
return;
|
|
371
|
+
await this.bridge.initialize();
|
|
372
|
+
this.initialized = true;
|
|
373
|
+
}
|
|
374
|
+
isInitialized() {
|
|
375
|
+
return this.initialized;
|
|
376
|
+
}
|
|
377
|
+
async ensureInitialized() {
|
|
378
|
+
if (!this.initialized) {
|
|
379
|
+
await this.initialize();
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
async parse(input, lang = "en") {
|
|
383
|
+
await this.ensureInitialized();
|
|
384
|
+
return this.bridge.parse(input, lang);
|
|
385
|
+
}
|
|
386
|
+
async parseToAST(input, lang = "en") {
|
|
387
|
+
await this.ensureInitialized();
|
|
388
|
+
return this.bridge.parseToAST(input, lang);
|
|
389
|
+
}
|
|
390
|
+
async parseToASTWithDetails(input, lang = "en") {
|
|
391
|
+
await this.ensureInitialized();
|
|
392
|
+
return this.bridge.parseToASTWithDetails(input, lang);
|
|
393
|
+
}
|
|
394
|
+
async translate(input, from, to) {
|
|
395
|
+
await this.ensureInitialized();
|
|
396
|
+
const result = await this.bridge.transform(input, from, to);
|
|
397
|
+
return result.output;
|
|
398
|
+
}
|
|
399
|
+
async translateWithDetails(input, from, to) {
|
|
400
|
+
await this.ensureInitialized();
|
|
401
|
+
return this.bridge.transform(input, from, to);
|
|
402
|
+
}
|
|
403
|
+
async render(node, lang) {
|
|
404
|
+
await this.ensureInitialized();
|
|
405
|
+
return this.bridge.render(node, lang);
|
|
406
|
+
}
|
|
407
|
+
async getAllTranslations(input, from) {
|
|
408
|
+
await this.ensureInitialized();
|
|
409
|
+
const all = await this.bridge.getAllTranslations(input, from);
|
|
410
|
+
const supported = new Set(this.getSupportedLanguages());
|
|
411
|
+
return Object.fromEntries(Object.entries(all).filter(([lang]) => supported.has(lang)));
|
|
412
|
+
}
|
|
413
|
+
getSupportedLanguages() {
|
|
414
|
+
return [
|
|
415
|
+
"en",
|
|
416
|
+
"ja",
|
|
417
|
+
"ar",
|
|
418
|
+
"es",
|
|
419
|
+
"ko",
|
|
420
|
+
"zh",
|
|
421
|
+
"tr",
|
|
422
|
+
"pt",
|
|
423
|
+
"fr",
|
|
424
|
+
"de",
|
|
425
|
+
"id",
|
|
426
|
+
"qu",
|
|
427
|
+
"sw"
|
|
428
|
+
];
|
|
429
|
+
}
|
|
430
|
+
isLanguageSupported(lang) {
|
|
431
|
+
return this.getSupportedLanguages().includes(lang);
|
|
432
|
+
}
|
|
433
|
+
getLanguageInfo(lang) {
|
|
434
|
+
return LANGUAGE_INFO[lang];
|
|
435
|
+
}
|
|
436
|
+
getAllLanguageInfo() {
|
|
437
|
+
return { ...LANGUAGE_INFO };
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
var LANGUAGE_INFO = {
|
|
441
|
+
en: { code: "en", name: "English", nativeName: "English", direction: "ltr", wordOrder: "SVO" },
|
|
442
|
+
ja: { code: "ja", name: "Japanese", nativeName: "\u65E5\u672C\u8A9E", direction: "ltr", wordOrder: "SOV" },
|
|
443
|
+
ar: { code: "ar", name: "Arabic", nativeName: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629", direction: "rtl", wordOrder: "VSO" },
|
|
444
|
+
es: { code: "es", name: "Spanish", nativeName: "Espa\xF1ol", direction: "ltr", wordOrder: "SVO" },
|
|
445
|
+
ko: { code: "ko", name: "Korean", nativeName: "\uD55C\uAD6D\uC5B4", direction: "ltr", wordOrder: "SOV" },
|
|
446
|
+
zh: { code: "zh", name: "Chinese", nativeName: "\u4E2D\u6587", direction: "ltr", wordOrder: "SVO" },
|
|
447
|
+
tr: { code: "tr", name: "Turkish", nativeName: "T\xFCrk\xE7e", direction: "ltr", wordOrder: "SOV" },
|
|
448
|
+
pt: {
|
|
449
|
+
code: "pt",
|
|
450
|
+
name: "Portuguese",
|
|
451
|
+
nativeName: "Portugu\xEAs",
|
|
452
|
+
direction: "ltr",
|
|
453
|
+
wordOrder: "SVO"
|
|
454
|
+
},
|
|
455
|
+
fr: { code: "fr", name: "French", nativeName: "Fran\xE7ais", direction: "ltr", wordOrder: "SVO" },
|
|
456
|
+
de: { code: "de", name: "German", nativeName: "Deutsch", direction: "ltr", wordOrder: "SVO" },
|
|
457
|
+
id: {
|
|
458
|
+
code: "id",
|
|
459
|
+
name: "Indonesian",
|
|
460
|
+
nativeName: "Bahasa Indonesia",
|
|
461
|
+
direction: "ltr",
|
|
462
|
+
wordOrder: "SVO"
|
|
463
|
+
},
|
|
464
|
+
qu: { code: "qu", name: "Quechua", nativeName: "Runasimi", direction: "ltr", wordOrder: "SOV" },
|
|
465
|
+
sw: { code: "sw", name: "Swahili", nativeName: "Kiswahili", direction: "ltr", wordOrder: "SVO" }
|
|
466
|
+
};
|
|
467
|
+
var _defaultInstance = null;
|
|
468
|
+
async function getMultilingual() {
|
|
469
|
+
if (!_defaultInstance) {
|
|
470
|
+
_defaultInstance = new MultilingualHyperscript();
|
|
471
|
+
await _defaultInstance.initialize();
|
|
472
|
+
}
|
|
473
|
+
return _defaultInstance;
|
|
474
|
+
}
|
|
475
|
+
var multilingual = new MultilingualHyperscript();
|
|
476
|
+
export {
|
|
477
|
+
MultilingualHyperscript,
|
|
478
|
+
SemanticGrammarBridge,
|
|
479
|
+
getDefaultBridge,
|
|
480
|
+
getMultilingual,
|
|
481
|
+
multilingual,
|
|
482
|
+
schemaRoleInferrer,
|
|
483
|
+
translate
|
|
484
|
+
};
|
|
485
|
+
//# sourceMappingURL=multilingual-VYI3FTN7.js.map
|