@lokascript/semantic 1.0.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/LICENSE +21 -0
- package/README.md +686 -0
- package/dist/browser-ar.ar.global.js +2 -0
- package/dist/browser-core.core.global.js +2 -0
- package/dist/browser-de.de.global.js +2 -0
- package/dist/browser-east-asian.east-asian.global.js +2 -0
- package/dist/browser-en-tr.en-tr.global.js +2 -0
- package/dist/browser-en.en.global.js +2 -0
- package/dist/browser-es-en.es-en.global.js +2 -0
- package/dist/browser-es.es.global.js +2 -0
- package/dist/browser-fr.fr.global.js +2 -0
- package/dist/browser-id.id.global.js +2 -0
- package/dist/browser-ja.ja.global.js +2 -0
- package/dist/browser-ko.ko.global.js +2 -0
- package/dist/browser-lazy.lazy.global.js +2 -0
- package/dist/browser-priority.priority.global.js +2 -0
- package/dist/browser-pt.pt.global.js +2 -0
- package/dist/browser-qu.qu.global.js +2 -0
- package/dist/browser-sw.sw.global.js +2 -0
- package/dist/browser-tr.tr.global.js +2 -0
- package/dist/browser-western.western.global.js +2 -0
- package/dist/browser-zh.zh.global.js +2 -0
- package/dist/browser.global.js +3 -0
- package/dist/browser.global.js.map +1 -0
- package/dist/index.cjs +35051 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3426 -0
- package/dist/index.d.ts +3426 -0
- package/dist/index.js +34890 -0
- package/dist/index.js.map +1 -0
- package/dist/languages/ar.d.ts +78 -0
- package/dist/languages/ar.js +1622 -0
- package/dist/languages/ar.js.map +1 -0
- package/dist/languages/de.d.ts +38 -0
- package/dist/languages/de.js +1168 -0
- package/dist/languages/de.js.map +1 -0
- package/dist/languages/en.d.ts +44 -0
- package/dist/languages/en.js +3491 -0
- package/dist/languages/en.js.map +1 -0
- package/dist/languages/es.d.ts +52 -0
- package/dist/languages/es.js +1493 -0
- package/dist/languages/es.js.map +1 -0
- package/dist/languages/fr.d.ts +37 -0
- package/dist/languages/fr.js +1159 -0
- package/dist/languages/fr.js.map +1 -0
- package/dist/languages/id.d.ts +35 -0
- package/dist/languages/id.js +1152 -0
- package/dist/languages/id.js.map +1 -0
- package/dist/languages/ja.d.ts +53 -0
- package/dist/languages/ja.js +1430 -0
- package/dist/languages/ja.js.map +1 -0
- package/dist/languages/ko.d.ts +51 -0
- package/dist/languages/ko.js +1729 -0
- package/dist/languages/ko.js.map +1 -0
- package/dist/languages/pt.d.ts +37 -0
- package/dist/languages/pt.js +1127 -0
- package/dist/languages/pt.js.map +1 -0
- package/dist/languages/qu.d.ts +36 -0
- package/dist/languages/qu.js +1143 -0
- package/dist/languages/qu.js.map +1 -0
- package/dist/languages/sw.d.ts +35 -0
- package/dist/languages/sw.js +1147 -0
- package/dist/languages/sw.js.map +1 -0
- package/dist/languages/tr.d.ts +45 -0
- package/dist/languages/tr.js +1529 -0
- package/dist/languages/tr.js.map +1 -0
- package/dist/languages/zh.d.ts +58 -0
- package/dist/languages/zh.js +1257 -0
- package/dist/languages/zh.js.map +1 -0
- package/dist/types-C4dcj53L.d.ts +600 -0
- package/package.json +202 -0
- package/src/__test-utils__/index.ts +7 -0
- package/src/__test-utils__/test-helpers.ts +8 -0
- package/src/__types__/test-helpers.ts +122 -0
- package/src/analysis/index.ts +479 -0
- package/src/ast-builder/command-mappers.ts +1133 -0
- package/src/ast-builder/expression-parser/index.ts +41 -0
- package/src/ast-builder/expression-parser/parser.ts +563 -0
- package/src/ast-builder/expression-parser/tokenizer.ts +394 -0
- package/src/ast-builder/expression-parser/types.ts +208 -0
- package/src/ast-builder/index.ts +536 -0
- package/src/ast-builder/value-converters.ts +172 -0
- package/src/bridge.ts +275 -0
- package/src/browser-ar.ts +162 -0
- package/src/browser-core.ts +231 -0
- package/src/browser-de.ts +162 -0
- package/src/browser-east-asian.ts +173 -0
- package/src/browser-en-tr.ts +165 -0
- package/src/browser-en.ts +157 -0
- package/src/browser-es-en.ts +200 -0
- package/src/browser-es.ts +170 -0
- package/src/browser-fr.ts +162 -0
- package/src/browser-id.ts +162 -0
- package/src/browser-ja.ts +162 -0
- package/src/browser-ko.ts +162 -0
- package/src/browser-lazy.ts +189 -0
- package/src/browser-priority.ts +214 -0
- package/src/browser-pt.ts +162 -0
- package/src/browser-qu.ts +162 -0
- package/src/browser-sw.ts +162 -0
- package/src/browser-tr.ts +162 -0
- package/src/browser-western.ts +181 -0
- package/src/browser-zh.ts +162 -0
- package/src/browser.ts +268 -0
- package/src/cache/index.ts +14 -0
- package/src/cache/semantic-cache.ts +344 -0
- package/src/core-bridge.ts +372 -0
- package/src/explicit/converter.ts +258 -0
- package/src/explicit/index.ts +18 -0
- package/src/explicit/parser.ts +236 -0
- package/src/explicit/renderer.ts +424 -0
- package/src/generators/command-schemas.ts +1636 -0
- package/src/generators/event-handler-generator.ts +109 -0
- package/src/generators/index.ts +117 -0
- package/src/generators/language-profiles.ts +139 -0
- package/src/generators/pattern-generator.ts +537 -0
- package/src/generators/profiles/arabic.ts +131 -0
- package/src/generators/profiles/bengali.ts +132 -0
- package/src/generators/profiles/chinese.ts +124 -0
- package/src/generators/profiles/english.ts +113 -0
- package/src/generators/profiles/french.ts +125 -0
- package/src/generators/profiles/german.ts +126 -0
- package/src/generators/profiles/hindi.ts +146 -0
- package/src/generators/profiles/index.ts +46 -0
- package/src/generators/profiles/indonesian.ts +125 -0
- package/src/generators/profiles/italian.ts +139 -0
- package/src/generators/profiles/japanese.ts +149 -0
- package/src/generators/profiles/korean.ts +127 -0
- package/src/generators/profiles/marker-templates.ts +288 -0
- package/src/generators/profiles/ms.ts +130 -0
- package/src/generators/profiles/polish.ts +249 -0
- package/src/generators/profiles/portuguese.ts +115 -0
- package/src/generators/profiles/quechua.ts +113 -0
- package/src/generators/profiles/russian.ts +260 -0
- package/src/generators/profiles/spanish.ts +130 -0
- package/src/generators/profiles/swahili.ts +129 -0
- package/src/generators/profiles/thai.ts +132 -0
- package/src/generators/profiles/tl.ts +128 -0
- package/src/generators/profiles/turkish.ts +124 -0
- package/src/generators/profiles/types.ts +165 -0
- package/src/generators/profiles/ukrainian.ts +270 -0
- package/src/generators/profiles/vietnamese.ts +133 -0
- package/src/generators/schema-error-codes.ts +160 -0
- package/src/generators/schema-validator.ts +391 -0
- package/src/index.ts +429 -0
- package/src/language-building-schema.ts +3170 -0
- package/src/language-loader.ts +394 -0
- package/src/languages/_all.ts +65 -0
- package/src/languages/ar.ts +15 -0
- package/src/languages/bn.ts +16 -0
- package/src/languages/de.ts +15 -0
- package/src/languages/en.ts +29 -0
- package/src/languages/es.ts +15 -0
- package/src/languages/fr.ts +15 -0
- package/src/languages/hi.ts +26 -0
- package/src/languages/id.ts +15 -0
- package/src/languages/index.ts +18 -0
- package/src/languages/it.ts +15 -0
- package/src/languages/ja.ts +15 -0
- package/src/languages/ko.ts +15 -0
- package/src/languages/ms.ts +16 -0
- package/src/languages/pl.ts +18 -0
- package/src/languages/pt.ts +15 -0
- package/src/languages/qu.ts +15 -0
- package/src/languages/ru.ts +26 -0
- package/src/languages/sw.ts +15 -0
- package/src/languages/th.ts +16 -0
- package/src/languages/tl.ts +16 -0
- package/src/languages/tr.ts +15 -0
- package/src/languages/uk.ts +26 -0
- package/src/languages/vi.ts +16 -0
- package/src/languages/zh.ts +15 -0
- package/src/parser/index.ts +15 -0
- package/src/parser/pattern-matcher.ts +1181 -0
- package/src/parser/semantic-parser.ts +573 -0
- package/src/parser/utils/index.ts +35 -0
- package/src/parser/utils/marker-resolution.ts +111 -0
- package/src/parser/utils/possessive-keywords.ts +43 -0
- package/src/parser/utils/role-positioning.ts +70 -0
- package/src/parser/utils/type-validation.ts +134 -0
- package/src/patterns/add/ar.ts +71 -0
- package/src/patterns/add/bn.ts +70 -0
- package/src/patterns/add/hi.ts +69 -0
- package/src/patterns/add/index.ts +87 -0
- package/src/patterns/add/it.ts +61 -0
- package/src/patterns/add/ja.ts +93 -0
- package/src/patterns/add/ko.ts +74 -0
- package/src/patterns/add/ms.ts +30 -0
- package/src/patterns/add/pl.ts +62 -0
- package/src/patterns/add/ru.ts +62 -0
- package/src/patterns/add/th.ts +49 -0
- package/src/patterns/add/tl.ts +30 -0
- package/src/patterns/add/tr.ts +71 -0
- package/src/patterns/add/uk.ts +62 -0
- package/src/patterns/add/vi.ts +61 -0
- package/src/patterns/add/zh.ts +71 -0
- package/src/patterns/builders.ts +207 -0
- package/src/patterns/decrement/bn.ts +70 -0
- package/src/patterns/decrement/de.ts +42 -0
- package/src/patterns/decrement/hi.ts +68 -0
- package/src/patterns/decrement/index.ts +79 -0
- package/src/patterns/decrement/it.ts +69 -0
- package/src/patterns/decrement/ms.ts +30 -0
- package/src/patterns/decrement/pl.ts +58 -0
- package/src/patterns/decrement/ru.ts +58 -0
- package/src/patterns/decrement/th.ts +49 -0
- package/src/patterns/decrement/tl.ts +30 -0
- package/src/patterns/decrement/tr.ts +48 -0
- package/src/patterns/decrement/uk.ts +58 -0
- package/src/patterns/decrement/vi.ts +61 -0
- package/src/patterns/decrement/zh.ts +32 -0
- package/src/patterns/en.ts +302 -0
- package/src/patterns/event-handler/ar.ts +151 -0
- package/src/patterns/event-handler/bn.ts +72 -0
- package/src/patterns/event-handler/de.ts +117 -0
- package/src/patterns/event-handler/en.ts +117 -0
- package/src/patterns/event-handler/es.ts +136 -0
- package/src/patterns/event-handler/fr.ts +117 -0
- package/src/patterns/event-handler/hi.ts +64 -0
- package/src/patterns/event-handler/id.ts +117 -0
- package/src/patterns/event-handler/index.ts +119 -0
- package/src/patterns/event-handler/it.ts +54 -0
- package/src/patterns/event-handler/ja.ts +118 -0
- package/src/patterns/event-handler/ko.ts +133 -0
- package/src/patterns/event-handler/ms.ts +30 -0
- package/src/patterns/event-handler/pl.ts +62 -0
- package/src/patterns/event-handler/pt.ts +117 -0
- package/src/patterns/event-handler/qu.ts +66 -0
- package/src/patterns/event-handler/ru.ts +62 -0
- package/src/patterns/event-handler/shared.ts +270 -0
- package/src/patterns/event-handler/sw.ts +117 -0
- package/src/patterns/event-handler/th.ts +53 -0
- package/src/patterns/event-handler/tl.ts +30 -0
- package/src/patterns/event-handler/tr.ts +170 -0
- package/src/patterns/event-handler/uk.ts +62 -0
- package/src/patterns/event-handler/vi.ts +61 -0
- package/src/patterns/event-handler/zh.ts +150 -0
- package/src/patterns/get/ar.ts +49 -0
- package/src/patterns/get/bn.ts +47 -0
- package/src/patterns/get/de.ts +32 -0
- package/src/patterns/get/hi.ts +52 -0
- package/src/patterns/get/index.ts +83 -0
- package/src/patterns/get/it.ts +56 -0
- package/src/patterns/get/ja.ts +53 -0
- package/src/patterns/get/ko.ts +53 -0
- package/src/patterns/get/ms.ts +30 -0
- package/src/patterns/get/pl.ts +57 -0
- package/src/patterns/get/ru.ts +57 -0
- package/src/patterns/get/th.ts +29 -0
- package/src/patterns/get/tl.ts +30 -0
- package/src/patterns/get/uk.ts +57 -0
- package/src/patterns/get/vi.ts +48 -0
- package/src/patterns/grammar-transformed/index.ts +39 -0
- package/src/patterns/grammar-transformed/ja.ts +1713 -0
- package/src/patterns/grammar-transformed/ko.ts +1311 -0
- package/src/patterns/grammar-transformed/tr.ts +1067 -0
- package/src/patterns/hide/ar.ts +67 -0
- package/src/patterns/hide/bn.ts +47 -0
- package/src/patterns/hide/de.ts +36 -0
- package/src/patterns/hide/hi.ts +61 -0
- package/src/patterns/hide/index.ts +91 -0
- package/src/patterns/hide/it.ts +56 -0
- package/src/patterns/hide/ja.ts +69 -0
- package/src/patterns/hide/ko.ts +69 -0
- package/src/patterns/hide/ms.ts +30 -0
- package/src/patterns/hide/pl.ts +57 -0
- package/src/patterns/hide/ru.ts +57 -0
- package/src/patterns/hide/th.ts +29 -0
- package/src/patterns/hide/tl.ts +30 -0
- package/src/patterns/hide/tr.ts +65 -0
- package/src/patterns/hide/uk.ts +57 -0
- package/src/patterns/hide/vi.ts +56 -0
- package/src/patterns/hide/zh.ts +68 -0
- package/src/patterns/increment/bn.ts +70 -0
- package/src/patterns/increment/de.ts +36 -0
- package/src/patterns/increment/hi.ts +68 -0
- package/src/patterns/increment/index.ts +79 -0
- package/src/patterns/increment/it.ts +69 -0
- package/src/patterns/increment/ms.ts +30 -0
- package/src/patterns/increment/pl.ts +58 -0
- package/src/patterns/increment/ru.ts +58 -0
- package/src/patterns/increment/th.ts +49 -0
- package/src/patterns/increment/tl.ts +30 -0
- package/src/patterns/increment/tr.ts +52 -0
- package/src/patterns/increment/uk.ts +58 -0
- package/src/patterns/increment/vi.ts +61 -0
- package/src/patterns/increment/zh.ts +32 -0
- package/src/patterns/index.ts +84 -0
- package/src/patterns/languages/en/control-flow.ts +93 -0
- package/src/patterns/languages/en/fetch.ts +62 -0
- package/src/patterns/languages/en/index.ts +42 -0
- package/src/patterns/languages/en/repeat.ts +67 -0
- package/src/patterns/languages/en/set.ts +48 -0
- package/src/patterns/languages/en/swap.ts +38 -0
- package/src/patterns/languages/en/temporal.ts +57 -0
- package/src/patterns/put/ar.ts +74 -0
- package/src/patterns/put/bn.ts +53 -0
- package/src/patterns/put/en.ts +74 -0
- package/src/patterns/put/es.ts +74 -0
- package/src/patterns/put/hi.ts +69 -0
- package/src/patterns/put/id.ts +96 -0
- package/src/patterns/put/index.ts +99 -0
- package/src/patterns/put/it.ts +56 -0
- package/src/patterns/put/ja.ts +75 -0
- package/src/patterns/put/ko.ts +67 -0
- package/src/patterns/put/ms.ts +30 -0
- package/src/patterns/put/pl.ts +81 -0
- package/src/patterns/put/ru.ts +85 -0
- package/src/patterns/put/th.ts +32 -0
- package/src/patterns/put/tl.ts +30 -0
- package/src/patterns/put/tr.ts +67 -0
- package/src/patterns/put/uk.ts +85 -0
- package/src/patterns/put/vi.ts +72 -0
- package/src/patterns/put/zh.ts +62 -0
- package/src/patterns/registry.ts +163 -0
- package/src/patterns/remove/ar.ts +71 -0
- package/src/patterns/remove/bn.ts +68 -0
- package/src/patterns/remove/hi.ts +69 -0
- package/src/patterns/remove/index.ts +87 -0
- package/src/patterns/remove/it.ts +69 -0
- package/src/patterns/remove/ja.ts +74 -0
- package/src/patterns/remove/ko.ts +78 -0
- package/src/patterns/remove/ms.ts +30 -0
- package/src/patterns/remove/pl.ts +62 -0
- package/src/patterns/remove/ru.ts +62 -0
- package/src/patterns/remove/th.ts +49 -0
- package/src/patterns/remove/tl.ts +30 -0
- package/src/patterns/remove/tr.ts +78 -0
- package/src/patterns/remove/uk.ts +62 -0
- package/src/patterns/remove/vi.ts +61 -0
- package/src/patterns/remove/zh.ts +72 -0
- package/src/patterns/set/ar.ts +84 -0
- package/src/patterns/set/bn.ts +53 -0
- package/src/patterns/set/de.ts +84 -0
- package/src/patterns/set/es.ts +92 -0
- package/src/patterns/set/fr.ts +88 -0
- package/src/patterns/set/hi.ts +56 -0
- package/src/patterns/set/id.ts +84 -0
- package/src/patterns/set/index.ts +107 -0
- package/src/patterns/set/it.ts +56 -0
- package/src/patterns/set/ja.ts +86 -0
- package/src/patterns/set/ko.ts +85 -0
- package/src/patterns/set/ms.ts +30 -0
- package/src/patterns/set/pl.ts +57 -0
- package/src/patterns/set/pt.ts +84 -0
- package/src/patterns/set/ru.ts +57 -0
- package/src/patterns/set/th.ts +31 -0
- package/src/patterns/set/tl.ts +30 -0
- package/src/patterns/set/tr.ts +107 -0
- package/src/patterns/set/uk.ts +57 -0
- package/src/patterns/set/vi.ts +53 -0
- package/src/patterns/set/zh.ts +84 -0
- package/src/patterns/show/ar.ts +67 -0
- package/src/patterns/show/bn.ts +47 -0
- package/src/patterns/show/de.ts +32 -0
- package/src/patterns/show/fr.ts +32 -0
- package/src/patterns/show/hi.ts +61 -0
- package/src/patterns/show/index.ts +95 -0
- package/src/patterns/show/it.ts +56 -0
- package/src/patterns/show/ja.ts +69 -0
- package/src/patterns/show/ko.ts +73 -0
- package/src/patterns/show/ms.ts +30 -0
- package/src/patterns/show/pl.ts +57 -0
- package/src/patterns/show/ru.ts +57 -0
- package/src/patterns/show/th.ts +29 -0
- package/src/patterns/show/tl.ts +30 -0
- package/src/patterns/show/tr.ts +65 -0
- package/src/patterns/show/uk.ts +57 -0
- package/src/patterns/show/vi.ts +56 -0
- package/src/patterns/show/zh.ts +68 -0
- package/src/patterns/take/ar.ts +51 -0
- package/src/patterns/take/index.ts +31 -0
- package/src/patterns/toggle/ar.ts +61 -0
- package/src/patterns/toggle/bn.ts +70 -0
- package/src/patterns/toggle/en.ts +61 -0
- package/src/patterns/toggle/es.ts +61 -0
- package/src/patterns/toggle/hi.ts +80 -0
- package/src/patterns/toggle/index.ts +95 -0
- package/src/patterns/toggle/it.ts +69 -0
- package/src/patterns/toggle/ja.ts +156 -0
- package/src/patterns/toggle/ko.ts +113 -0
- package/src/patterns/toggle/ms.ts +30 -0
- package/src/patterns/toggle/pl.ts +62 -0
- package/src/patterns/toggle/ru.ts +62 -0
- package/src/patterns/toggle/th.ts +50 -0
- package/src/patterns/toggle/tl.ts +30 -0
- package/src/patterns/toggle/tr.ts +88 -0
- package/src/patterns/toggle/uk.ts +62 -0
- package/src/patterns/toggle/vi.ts +61 -0
- package/src/patterns/toggle/zh.ts +99 -0
- package/src/public-api.ts +286 -0
- package/src/registry.ts +441 -0
- package/src/tokenizers/arabic.ts +723 -0
- package/src/tokenizers/base.ts +1300 -0
- package/src/tokenizers/bengali.ts +289 -0
- package/src/tokenizers/chinese.ts +481 -0
- package/src/tokenizers/english.ts +416 -0
- package/src/tokenizers/french.ts +326 -0
- package/src/tokenizers/german.ts +324 -0
- package/src/tokenizers/hindi.ts +319 -0
- package/src/tokenizers/index.ts +127 -0
- package/src/tokenizers/indonesian.ts +306 -0
- package/src/tokenizers/italian.ts +458 -0
- package/src/tokenizers/japanese.ts +447 -0
- package/src/tokenizers/korean.ts +642 -0
- package/src/tokenizers/morphology/arabic-normalizer.ts +242 -0
- package/src/tokenizers/morphology/french-normalizer.ts +268 -0
- package/src/tokenizers/morphology/german-normalizer.ts +256 -0
- package/src/tokenizers/morphology/index.ts +46 -0
- package/src/tokenizers/morphology/italian-normalizer.ts +329 -0
- package/src/tokenizers/morphology/japanese-normalizer.ts +288 -0
- package/src/tokenizers/morphology/korean-normalizer.ts +428 -0
- package/src/tokenizers/morphology/polish-normalizer.ts +264 -0
- package/src/tokenizers/morphology/portuguese-normalizer.ts +310 -0
- package/src/tokenizers/morphology/spanish-normalizer.ts +327 -0
- package/src/tokenizers/morphology/turkish-normalizer.ts +412 -0
- package/src/tokenizers/morphology/types.ts +211 -0
- package/src/tokenizers/ms.ts +198 -0
- package/src/tokenizers/polish.ts +354 -0
- package/src/tokenizers/portuguese.ts +304 -0
- package/src/tokenizers/quechua.ts +339 -0
- package/src/tokenizers/russian.ts +375 -0
- package/src/tokenizers/spanish.ts +403 -0
- package/src/tokenizers/swahili.ts +303 -0
- package/src/tokenizers/thai.ts +236 -0
- package/src/tokenizers/tl.ts +198 -0
- package/src/tokenizers/turkish.ts +411 -0
- package/src/tokenizers/ukrainian.ts +369 -0
- package/src/tokenizers/vietnamese.ts +410 -0
- package/src/types/grammar-types.ts +617 -0
- package/src/types/unified-profile.ts +267 -0
- package/src/types.ts +709 -0
- package/src/utils/confidence-calculator.ts +147 -0
- package/src/validators/command-validator.ts +380 -0
- package/src/validators/index.ts +15 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* English Set Patterns
|
|
3
|
+
*
|
|
4
|
+
* Hand-crafted patterns for set command with possessive syntax support.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { LanguagePattern } from '../../../types';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* English: "set {target} to {value}"
|
|
11
|
+
* Handles all set command variants including possessive syntax.
|
|
12
|
+
* Higher priority than generated setSchema to capture property-path types.
|
|
13
|
+
*
|
|
14
|
+
* Examples:
|
|
15
|
+
* - set x to 5 (simple variable)
|
|
16
|
+
* - set :localVar to 'hello' (local scope)
|
|
17
|
+
* - set #el's *opacity to 0.5 (possessive CSS property)
|
|
18
|
+
* - set my innerHTML to 'content' (possessive reference)
|
|
19
|
+
*/
|
|
20
|
+
export const setPossessiveEnglish: LanguagePattern = {
|
|
21
|
+
id: 'set-en-possessive',
|
|
22
|
+
language: 'en',
|
|
23
|
+
command: 'set',
|
|
24
|
+
priority: 100, // Higher than generated setSchema (80)
|
|
25
|
+
template: {
|
|
26
|
+
format: 'set {destination} to {patient}',
|
|
27
|
+
tokens: [
|
|
28
|
+
{ type: 'literal', value: 'set' },
|
|
29
|
+
// Role token with property-path support for possessive syntax
|
|
30
|
+
{
|
|
31
|
+
type: 'role',
|
|
32
|
+
role: 'destination',
|
|
33
|
+
expectedTypes: ['property-path', 'selector', 'reference', 'expression'],
|
|
34
|
+
},
|
|
35
|
+
{ type: 'literal', value: 'to' },
|
|
36
|
+
{ type: 'role', role: 'patient', expectedTypes: ['literal', 'expression', 'reference'] },
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
extraction: {
|
|
40
|
+
destination: { position: 1 },
|
|
41
|
+
patient: { marker: 'to' },
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* All English set patterns.
|
|
47
|
+
*/
|
|
48
|
+
export const setPatternsEn: LanguagePattern[] = [setPossessiveEnglish];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* English Swap Patterns
|
|
3
|
+
*
|
|
4
|
+
* Hand-crafted patterns for swap command without prepositions.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { LanguagePattern } from '../../../types';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* English: "swap <strategy> <target>" without prepositions.
|
|
11
|
+
* Examples:
|
|
12
|
+
* - swap delete #item
|
|
13
|
+
* - swap innerHTML #target
|
|
14
|
+
* - swap outerHTML me
|
|
15
|
+
*/
|
|
16
|
+
export const swapSimpleEnglish: LanguagePattern = {
|
|
17
|
+
id: 'swap-en-handcrafted',
|
|
18
|
+
language: 'en',
|
|
19
|
+
command: 'swap',
|
|
20
|
+
priority: 110, // Higher than generated patterns
|
|
21
|
+
template: {
|
|
22
|
+
format: 'swap {method} {destination}',
|
|
23
|
+
tokens: [
|
|
24
|
+
{ type: 'literal', value: 'swap' },
|
|
25
|
+
{ type: 'role', role: 'method' },
|
|
26
|
+
{ type: 'role', role: 'destination' },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
extraction: {
|
|
30
|
+
method: { position: 1 },
|
|
31
|
+
destination: { position: 2 },
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* All English swap patterns.
|
|
37
|
+
*/
|
|
38
|
+
export const swapPatternsEn: LanguagePattern[] = [swapSimpleEnglish];
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* English Temporal Expression Patterns
|
|
3
|
+
*
|
|
4
|
+
* Hand-crafted patterns for natural temporal delay idioms.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { LanguagePattern } from '../../../types';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* English: "in 2s toggle .active" - Natural temporal delay
|
|
11
|
+
* Transforms to: wait 2s then toggle .active
|
|
12
|
+
*
|
|
13
|
+
* This is a beginner-friendly idiom for delayed execution.
|
|
14
|
+
* Supports: 2s, 500ms, 2 seconds, 500 milliseconds
|
|
15
|
+
*/
|
|
16
|
+
export const temporalInEnglish: LanguagePattern = {
|
|
17
|
+
id: 'temporal-en-in',
|
|
18
|
+
language: 'en',
|
|
19
|
+
command: 'wait',
|
|
20
|
+
priority: 95, // Lower than standard wait patterns
|
|
21
|
+
template: {
|
|
22
|
+
format: 'in {duration}',
|
|
23
|
+
tokens: [
|
|
24
|
+
{ type: 'literal', value: 'in' },
|
|
25
|
+
{ type: 'role', role: 'duration', expectedTypes: ['literal', 'expression'] },
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
extraction: {
|
|
29
|
+
duration: { position: 1 },
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* English: "after 2s show #tooltip" - Natural temporal delay (alternative)
|
|
35
|
+
* Transforms to: wait 2s then show #tooltip
|
|
36
|
+
*/
|
|
37
|
+
export const temporalAfterEnglish: LanguagePattern = {
|
|
38
|
+
id: 'temporal-en-after',
|
|
39
|
+
language: 'en',
|
|
40
|
+
command: 'wait',
|
|
41
|
+
priority: 95, // Lower than standard wait patterns
|
|
42
|
+
template: {
|
|
43
|
+
format: 'after {duration}',
|
|
44
|
+
tokens: [
|
|
45
|
+
{ type: 'literal', value: 'after' },
|
|
46
|
+
{ type: 'role', role: 'duration', expectedTypes: ['literal', 'expression'] },
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
extraction: {
|
|
50
|
+
duration: { position: 1 },
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* All English temporal patterns.
|
|
56
|
+
*/
|
|
57
|
+
export const temporalPatternsEn: LanguagePattern[] = [temporalInEnglish, temporalAfterEnglish];
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arabic Put Patterns
|
|
3
|
+
*
|
|
4
|
+
* Tree-shakeable: Only included when Arabic is imported.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { LanguagePattern } from '../../types';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Get Arabic put patterns.
|
|
11
|
+
*/
|
|
12
|
+
export function getPutPatternsAr(): LanguagePattern[] {
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
id: 'put-ar-full',
|
|
16
|
+
language: 'ar',
|
|
17
|
+
command: 'put',
|
|
18
|
+
priority: 100,
|
|
19
|
+
template: {
|
|
20
|
+
format: 'ضع {patient} في {destination}',
|
|
21
|
+
tokens: [
|
|
22
|
+
{ type: 'literal', value: 'ضع', alternatives: ['اضع', 'يضع'] },
|
|
23
|
+
{ type: 'role', role: 'patient' },
|
|
24
|
+
{ type: 'literal', value: 'في', alternatives: ['إلى', 'الى'] },
|
|
25
|
+
{ type: 'role', role: 'destination' },
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
extraction: {
|
|
29
|
+
patient: { position: 1 },
|
|
30
|
+
destination: { marker: 'في', markerAlternatives: ['إلى', 'الى'] },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'put-ar-before',
|
|
35
|
+
language: 'ar',
|
|
36
|
+
command: 'put',
|
|
37
|
+
priority: 95,
|
|
38
|
+
template: {
|
|
39
|
+
format: 'ضع {patient} قبل {destination}',
|
|
40
|
+
tokens: [
|
|
41
|
+
{ type: 'literal', value: 'ضع' },
|
|
42
|
+
{ type: 'role', role: 'patient' },
|
|
43
|
+
{ type: 'literal', value: 'قبل' },
|
|
44
|
+
{ type: 'role', role: 'destination' },
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
extraction: {
|
|
48
|
+
patient: { position: 1 },
|
|
49
|
+
destination: { marker: 'قبل' },
|
|
50
|
+
manner: { default: { type: 'literal', value: 'before' } },
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'put-ar-after',
|
|
55
|
+
language: 'ar',
|
|
56
|
+
command: 'put',
|
|
57
|
+
priority: 95,
|
|
58
|
+
template: {
|
|
59
|
+
format: 'ضع {patient} بعد {destination}',
|
|
60
|
+
tokens: [
|
|
61
|
+
{ type: 'literal', value: 'ضع' },
|
|
62
|
+
{ type: 'role', role: 'patient' },
|
|
63
|
+
{ type: 'literal', value: 'بعد' },
|
|
64
|
+
{ type: 'role', role: 'destination' },
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
extraction: {
|
|
68
|
+
patient: { position: 1 },
|
|
69
|
+
destination: { marker: 'بعد' },
|
|
70
|
+
manner: { default: { type: 'literal', value: 'after' } },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bengali Put Patterns
|
|
3
|
+
*
|
|
4
|
+
* Patterns for parsing "put" command in Bengali.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { LanguagePattern } from '../../types';
|
|
8
|
+
|
|
9
|
+
export function getPutPatternsBn(): LanguagePattern[] {
|
|
10
|
+
return [
|
|
11
|
+
// Full pattern: 'hello' কে #output এ রাখুন
|
|
12
|
+
{
|
|
13
|
+
id: 'put-bn-full',
|
|
14
|
+
language: 'bn',
|
|
15
|
+
command: 'put',
|
|
16
|
+
priority: 100,
|
|
17
|
+
template: {
|
|
18
|
+
format: '{patient} কে {destination} এ রাখুন',
|
|
19
|
+
tokens: [
|
|
20
|
+
{ type: 'role', role: 'patient' },
|
|
21
|
+
{ type: 'literal', value: 'কে' },
|
|
22
|
+
{ type: 'role', role: 'destination' },
|
|
23
|
+
{ type: 'literal', value: 'এ', alternatives: ['তে'] },
|
|
24
|
+
{ type: 'literal', value: 'রাখুন', alternatives: ['রাখ'] },
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
extraction: {
|
|
28
|
+
patient: { position: 0 },
|
|
29
|
+
destination: { marker: 'এ', position: 2 },
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
// Simple pattern: রাখুন 'hello' #output এ
|
|
33
|
+
{
|
|
34
|
+
id: 'put-bn-simple',
|
|
35
|
+
language: 'bn',
|
|
36
|
+
command: 'put',
|
|
37
|
+
priority: 90,
|
|
38
|
+
template: {
|
|
39
|
+
format: 'রাখুন {patient} {destination} এ',
|
|
40
|
+
tokens: [
|
|
41
|
+
{ type: 'literal', value: 'রাখুন', alternatives: ['রাখ'] },
|
|
42
|
+
{ type: 'role', role: 'patient' },
|
|
43
|
+
{ type: 'role', role: 'destination' },
|
|
44
|
+
{ type: 'literal', value: 'এ', alternatives: ['তে'] },
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
extraction: {
|
|
48
|
+
patient: { position: 1 },
|
|
49
|
+
destination: { position: 2 },
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* English Put Patterns
|
|
3
|
+
*
|
|
4
|
+
* Tree-shakeable: Only included when English is imported.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { LanguagePattern } from '../../types';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Get English put patterns.
|
|
11
|
+
*/
|
|
12
|
+
export function getPutPatternsEn(): LanguagePattern[] {
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
id: 'put-en-into',
|
|
16
|
+
language: 'en',
|
|
17
|
+
command: 'put',
|
|
18
|
+
priority: 100,
|
|
19
|
+
template: {
|
|
20
|
+
format: 'put {patient} into {destination}',
|
|
21
|
+
tokens: [
|
|
22
|
+
{ type: 'literal', value: 'put' },
|
|
23
|
+
{ type: 'role', role: 'patient' },
|
|
24
|
+
{ type: 'literal', value: 'into', alternatives: ['in', 'to'] },
|
|
25
|
+
{ type: 'role', role: 'destination' },
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
extraction: {
|
|
29
|
+
patient: { position: 1 },
|
|
30
|
+
destination: { marker: 'into', markerAlternatives: ['in', 'to'] },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'put-en-before',
|
|
35
|
+
language: 'en',
|
|
36
|
+
command: 'put',
|
|
37
|
+
priority: 95,
|
|
38
|
+
template: {
|
|
39
|
+
format: 'put {patient} before {destination}',
|
|
40
|
+
tokens: [
|
|
41
|
+
{ type: 'literal', value: 'put' },
|
|
42
|
+
{ type: 'role', role: 'patient' },
|
|
43
|
+
{ type: 'literal', value: 'before' },
|
|
44
|
+
{ type: 'role', role: 'destination' },
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
extraction: {
|
|
48
|
+
patient: { position: 1 },
|
|
49
|
+
destination: { marker: 'before' },
|
|
50
|
+
manner: { default: { type: 'literal', value: 'before' } },
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'put-en-after',
|
|
55
|
+
language: 'en',
|
|
56
|
+
command: 'put',
|
|
57
|
+
priority: 95,
|
|
58
|
+
template: {
|
|
59
|
+
format: 'put {patient} after {destination}',
|
|
60
|
+
tokens: [
|
|
61
|
+
{ type: 'literal', value: 'put' },
|
|
62
|
+
{ type: 'role', role: 'patient' },
|
|
63
|
+
{ type: 'literal', value: 'after' },
|
|
64
|
+
{ type: 'role', role: 'destination' },
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
extraction: {
|
|
68
|
+
patient: { position: 1 },
|
|
69
|
+
destination: { marker: 'after' },
|
|
70
|
+
manner: { default: { type: 'literal', value: 'after' } },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spanish Put Patterns
|
|
3
|
+
*
|
|
4
|
+
* Tree-shakeable: Only included when Spanish is imported.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { LanguagePattern } from '../../types';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Get Spanish put patterns.
|
|
11
|
+
*/
|
|
12
|
+
export function getPutPatternsEs(): LanguagePattern[] {
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
id: 'put-es-full',
|
|
16
|
+
language: 'es',
|
|
17
|
+
command: 'put',
|
|
18
|
+
priority: 100,
|
|
19
|
+
template: {
|
|
20
|
+
format: 'poner {patient} en {destination}',
|
|
21
|
+
tokens: [
|
|
22
|
+
{ type: 'literal', value: 'poner', alternatives: ['pon', 'colocar', 'put'] },
|
|
23
|
+
{ type: 'role', role: 'patient' },
|
|
24
|
+
{ type: 'literal', value: 'en', alternatives: ['dentro de', 'a'] },
|
|
25
|
+
{ type: 'role', role: 'destination' },
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
extraction: {
|
|
29
|
+
patient: { position: 1 },
|
|
30
|
+
destination: { marker: 'en', markerAlternatives: ['dentro de', 'a'] },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'put-es-before',
|
|
35
|
+
language: 'es',
|
|
36
|
+
command: 'put',
|
|
37
|
+
priority: 95,
|
|
38
|
+
template: {
|
|
39
|
+
format: 'poner {patient} antes de {destination}',
|
|
40
|
+
tokens: [
|
|
41
|
+
{ type: 'literal', value: 'poner', alternatives: ['pon', 'colocar'] },
|
|
42
|
+
{ type: 'role', role: 'patient' },
|
|
43
|
+
{ type: 'literal', value: 'antes de', alternatives: ['antes'] },
|
|
44
|
+
{ type: 'role', role: 'destination' },
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
extraction: {
|
|
48
|
+
patient: { position: 1 },
|
|
49
|
+
destination: { marker: 'antes de', markerAlternatives: ['antes'] },
|
|
50
|
+
manner: { default: { type: 'literal', value: 'before' } },
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'put-es-after',
|
|
55
|
+
language: 'es',
|
|
56
|
+
command: 'put',
|
|
57
|
+
priority: 95,
|
|
58
|
+
template: {
|
|
59
|
+
format: 'poner {patient} después de {destination}',
|
|
60
|
+
tokens: [
|
|
61
|
+
{ type: 'literal', value: 'poner', alternatives: ['pon', 'colocar'] },
|
|
62
|
+
{ type: 'role', role: 'patient' },
|
|
63
|
+
{ type: 'literal', value: 'después de', alternatives: ['despues de', 'después'] },
|
|
64
|
+
{ type: 'role', role: 'destination' },
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
extraction: {
|
|
68
|
+
patient: { position: 1 },
|
|
69
|
+
destination: { marker: 'después de', markerAlternatives: ['despues de', 'después'] },
|
|
70
|
+
manner: { default: { type: 'literal', value: 'after' } },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hindi Put Patterns
|
|
3
|
+
*
|
|
4
|
+
* Patterns for parsing "put" command in Hindi.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { LanguagePattern } from '../../types';
|
|
8
|
+
|
|
9
|
+
export function getPutPatternsHi(): LanguagePattern[] {
|
|
10
|
+
return [
|
|
11
|
+
// Full pattern: "text" को #element में रखें
|
|
12
|
+
{
|
|
13
|
+
id: 'put-hi-full',
|
|
14
|
+
language: 'hi',
|
|
15
|
+
command: 'put',
|
|
16
|
+
priority: 100,
|
|
17
|
+
template: {
|
|
18
|
+
format: '{patient} को {destination} में रखें',
|
|
19
|
+
tokens: [
|
|
20
|
+
{ type: 'role', role: 'patient' },
|
|
21
|
+
{ type: 'literal', value: 'को' },
|
|
22
|
+
{ type: 'role', role: 'destination' },
|
|
23
|
+
{ type: 'literal', value: 'में' },
|
|
24
|
+
{ type: 'literal', value: 'रखें', alternatives: ['रख', 'डालें', 'डाल'] },
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
extraction: {
|
|
28
|
+
patient: { position: 0 },
|
|
29
|
+
destination: { marker: 'में', position: 3 },
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
// Simple pattern: "text" रखें
|
|
33
|
+
{
|
|
34
|
+
id: 'put-hi-simple',
|
|
35
|
+
language: 'hi',
|
|
36
|
+
command: 'put',
|
|
37
|
+
priority: 90,
|
|
38
|
+
template: {
|
|
39
|
+
format: '{patient} रखें',
|
|
40
|
+
tokens: [
|
|
41
|
+
{ type: 'role', role: 'patient' },
|
|
42
|
+
{ type: 'literal', value: 'रखें', alternatives: ['रख', 'डालें', 'डाल'] },
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
extraction: {
|
|
46
|
+
patient: { position: 0 },
|
|
47
|
+
destination: { default: { type: 'reference', value: 'me' } },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
// Bare pattern: रखें "text"
|
|
51
|
+
{
|
|
52
|
+
id: 'put-hi-bare',
|
|
53
|
+
language: 'hi',
|
|
54
|
+
command: 'put',
|
|
55
|
+
priority: 80,
|
|
56
|
+
template: {
|
|
57
|
+
format: 'रखें {patient}',
|
|
58
|
+
tokens: [
|
|
59
|
+
{ type: 'literal', value: 'रखें', alternatives: ['रख', 'डालें', 'डाल'] },
|
|
60
|
+
{ type: 'role', role: 'patient' },
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
extraction: {
|
|
64
|
+
patient: { position: 1 },
|
|
65
|
+
destination: { default: { type: 'reference', value: 'me' } },
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Indonesian Put Patterns
|
|
3
|
+
*
|
|
4
|
+
* Hand-crafted patterns for "put" command.
|
|
5
|
+
* Indonesian: taruh "halo" ke dalam #output
|
|
6
|
+
*
|
|
7
|
+
* Note: Indonesian uses two-word preposition "ke dalam" (into)
|
|
8
|
+
* We support both the full form and simplified forms.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { LanguagePattern } from '../../types';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Get Indonesian put patterns.
|
|
15
|
+
*/
|
|
16
|
+
export function getPutPatternsId(): LanguagePattern[] {
|
|
17
|
+
return [
|
|
18
|
+
{
|
|
19
|
+
id: 'put-id-full',
|
|
20
|
+
language: 'id',
|
|
21
|
+
command: 'put',
|
|
22
|
+
priority: 100,
|
|
23
|
+
template: {
|
|
24
|
+
// Two-word preposition: "ke dalam"
|
|
25
|
+
format: 'taruh {patient} ke dalam {destination}',
|
|
26
|
+
tokens: [
|
|
27
|
+
{
|
|
28
|
+
type: 'literal',
|
|
29
|
+
value: 'taruh',
|
|
30
|
+
alternatives: ['letakkan', 'masukkan', 'tempatkan', 'put'],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: 'role',
|
|
34
|
+
role: 'patient',
|
|
35
|
+
expectedTypes: ['literal', 'selector', 'reference', 'expression'],
|
|
36
|
+
},
|
|
37
|
+
{ type: 'literal', value: 'ke' },
|
|
38
|
+
{ type: 'literal', value: 'dalam', alternatives: ['di'] },
|
|
39
|
+
{ type: 'role', role: 'destination', expectedTypes: ['selector', 'reference'] },
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
extraction: {
|
|
43
|
+
patient: { position: 1 },
|
|
44
|
+
destination: { position: 4 },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'put-id-simple-ke',
|
|
49
|
+
language: 'id',
|
|
50
|
+
command: 'put',
|
|
51
|
+
priority: 95,
|
|
52
|
+
template: {
|
|
53
|
+
// Simplified: just "ke" without "dalam"
|
|
54
|
+
format: 'taruh {patient} ke {destination}',
|
|
55
|
+
tokens: [
|
|
56
|
+
{ type: 'literal', value: 'taruh', alternatives: ['letakkan', 'masukkan', 'tempatkan'] },
|
|
57
|
+
{
|
|
58
|
+
type: 'role',
|
|
59
|
+
role: 'patient',
|
|
60
|
+
expectedTypes: ['literal', 'selector', 'reference', 'expression'],
|
|
61
|
+
},
|
|
62
|
+
{ type: 'literal', value: 'ke', alternatives: ['di', 'pada'] },
|
|
63
|
+
{ type: 'role', role: 'destination', expectedTypes: ['selector', 'reference'] },
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
extraction: {
|
|
67
|
+
patient: { position: 1 },
|
|
68
|
+
destination: { position: 3 },
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: 'put-id-di',
|
|
73
|
+
language: 'id',
|
|
74
|
+
command: 'put',
|
|
75
|
+
priority: 90,
|
|
76
|
+
template: {
|
|
77
|
+
// Alternative with "di"
|
|
78
|
+
format: 'taruh {patient} di {destination}',
|
|
79
|
+
tokens: [
|
|
80
|
+
{ type: 'literal', value: 'taruh', alternatives: ['letakkan', 'masukkan'] },
|
|
81
|
+
{
|
|
82
|
+
type: 'role',
|
|
83
|
+
role: 'patient',
|
|
84
|
+
expectedTypes: ['literal', 'selector', 'reference', 'expression'],
|
|
85
|
+
},
|
|
86
|
+
{ type: 'literal', value: 'di' },
|
|
87
|
+
{ type: 'role', role: 'destination', expectedTypes: ['selector', 'reference'] },
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
extraction: {
|
|
91
|
+
patient: { position: 1 },
|
|
92
|
+
destination: { position: 3 },
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
];
|
|
96
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Put Command Patterns
|
|
3
|
+
*
|
|
4
|
+
* Hand-crafted patterns for "put" command across languages.
|
|
5
|
+
*
|
|
6
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { LanguagePattern } from '../../types';
|
|
10
|
+
|
|
11
|
+
import { getPutPatternsAr } from './ar';
|
|
12
|
+
import { getPutPatternsBn } from './bn';
|
|
13
|
+
import { getPutPatternsEn } from './en';
|
|
14
|
+
import { getPutPatternsEs } from './es';
|
|
15
|
+
import { getPutPatternsHi } from './hi';
|
|
16
|
+
import { getPutPatternsId } from './id';
|
|
17
|
+
import { getPutPatternsIt } from './it';
|
|
18
|
+
import { getPutPatternsJa } from './ja';
|
|
19
|
+
import { getPutPatternsKo } from './ko';
|
|
20
|
+
import { getPutPatternsMs } from './ms';
|
|
21
|
+
import { getPutPatternsPl } from './pl';
|
|
22
|
+
import { getPutPatternsRu } from './ru';
|
|
23
|
+
import { getPutPatternsTh } from './th';
|
|
24
|
+
import { getPutPatternsTl } from './tl';
|
|
25
|
+
import { getPutPatternsTr } from './tr';
|
|
26
|
+
import { getPutPatternsUk } from './uk';
|
|
27
|
+
import { getPutPatternsVi } from './vi';
|
|
28
|
+
import { getPutPatternsZh } from './zh';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get put patterns for a specific language.
|
|
32
|
+
*/
|
|
33
|
+
export function getPutPatternsForLanguage(language: string): LanguagePattern[] {
|
|
34
|
+
switch (language) {
|
|
35
|
+
case 'ar':
|
|
36
|
+
return getPutPatternsAr();
|
|
37
|
+
case 'bn':
|
|
38
|
+
return getPutPatternsBn();
|
|
39
|
+
case 'en':
|
|
40
|
+
return getPutPatternsEn();
|
|
41
|
+
case 'es':
|
|
42
|
+
return getPutPatternsEs();
|
|
43
|
+
case 'hi':
|
|
44
|
+
return getPutPatternsHi();
|
|
45
|
+
case 'id':
|
|
46
|
+
return getPutPatternsId();
|
|
47
|
+
case 'it':
|
|
48
|
+
return getPutPatternsIt();
|
|
49
|
+
case 'ja':
|
|
50
|
+
return getPutPatternsJa();
|
|
51
|
+
case 'ko':
|
|
52
|
+
return getPutPatternsKo();
|
|
53
|
+
case 'ms':
|
|
54
|
+
return getPutPatternsMs();
|
|
55
|
+
case 'pl':
|
|
56
|
+
return getPutPatternsPl();
|
|
57
|
+
case 'ru':
|
|
58
|
+
return getPutPatternsRu();
|
|
59
|
+
case 'th':
|
|
60
|
+
return getPutPatternsTh();
|
|
61
|
+
case 'tl':
|
|
62
|
+
return getPutPatternsTl();
|
|
63
|
+
case 'tr':
|
|
64
|
+
return getPutPatternsTr();
|
|
65
|
+
case 'uk':
|
|
66
|
+
return getPutPatternsUk();
|
|
67
|
+
case 'vi':
|
|
68
|
+
return getPutPatternsVi();
|
|
69
|
+
case 'zh':
|
|
70
|
+
return getPutPatternsZh();
|
|
71
|
+
default:
|
|
72
|
+
return [];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Re-export language-specific getters for tree-shaking
|
|
77
|
+
export { getPutPatternsAr } from './ar';
|
|
78
|
+
export { getPutPatternsBn } from './bn';
|
|
79
|
+
export { getPutPatternsEn } from './en';
|
|
80
|
+
export { getPutPatternsEs } from './es';
|
|
81
|
+
export { getPutPatternsHi } from './hi';
|
|
82
|
+
export { getPutPatternsId } from './id';
|
|
83
|
+
export { getPutPatternsIt } from './it';
|
|
84
|
+
export { getPutPatternsJa } from './ja';
|
|
85
|
+
export { getPutPatternsKo } from './ko';
|
|
86
|
+
export { getPutPatternsMs } from './ms';
|
|
87
|
+
export { getPutPatternsPl } from './pl';
|
|
88
|
+
export { getPutPatternsRu } from './ru';
|
|
89
|
+
export { getPutPatternsTh } from './th';
|
|
90
|
+
export { getPutPatternsTl } from './tl';
|
|
91
|
+
export { getPutPatternsTr } from './tr';
|
|
92
|
+
export { getPutPatternsUk } from './uk';
|
|
93
|
+
export { getPutPatternsVi } from './vi';
|
|
94
|
+
export { getPutPatternsZh } from './zh';
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Languages that have hand-crafted put patterns.
|
|
98
|
+
*/
|
|
99
|
+
export const putPatternLanguages = ['ar', 'bn', 'en', 'es', 'hi', 'id', 'it', 'ja', 'ko', 'ms', 'pl', 'ru', 'th', 'tl', 'tr', 'uk', 'vi', 'zh'];
|