|
| 1 | += ISC-WF-1: workflow extension (rulesets, overrides, language variants) |
| 2 | + |
| 3 | +The Interscript Configuration Syntax (ISC) describes each transliteration |
| 4 | +system as a self-contained map. *ISC-WF-1* extends the language with three |
| 5 | +additive constructs for reuse and specialization: named rulesets, use-time |
| 6 | +overrides, and language conditioning. The constructs are defined by the |
| 7 | +normative specification |
| 8 | +https://github.com/interscript/maps/blob/main/docs/isc-wf-1.md[ISC-WF-1] |
| 9 | +and are additive: any map that does not use them transliterates |
| 10 | +byte-identically under runtimes with and without the extension. |
| 11 | + |
| 12 | +== W1 — named rulesets |
| 13 | + |
| 14 | +A `ruleset` is a named block of rules that never runs on its own. A stage |
| 15 | +pulls it in with `use`, which expands the ruleset's items at that position: |
| 16 | + |
| 17 | +[source,ruby] |
| 18 | +---- |
| 19 | +ruleset romanize_descenders { |
| 20 | + parallel { |
| 21 | + sub "җ" "ž̧" |
| 22 | + sub "қ" "ķ" |
| 23 | + sub "ҫ" "ş" |
| 24 | + } |
| 25 | +} |
| 26 | +
|
| 27 | +stage main { |
| 28 | + use romanize_descenders |
| 29 | + parallel { |
| 30 | + sub "а" "a" |
| 31 | + } |
| 32 | +} |
| 33 | +---- |
| 34 | + |
| 35 | +Rulesets compose with dependencies: after `dependency "id" as alias`, a |
| 36 | +ruleset from that map is referenced as `use alias.<name>`. Expansion is |
| 37 | +recursive; a reference cycle is a load error. |
| 38 | + |
| 39 | +== W2 — use with override |
| 40 | + |
| 41 | +A `use` directive may carry an `override` block. Rows whose source string |
| 42 | +matches an override row exactly are replaced by it; all other rows pass |
| 43 | +through; new rows are added. The whole expansion still applies as one |
| 44 | +longest-match pass: |
| 45 | + |
| 46 | +[source,ruby] |
| 47 | +---- |
| 48 | +stage main { |
| 49 | + use romanize_descenders override { |
| 50 | + sub "қ" "k̦" # this map's tradition uses the comma-below form |
| 51 | + } |
| 52 | + parallel { |
| 53 | + sub "а" "a" |
| 54 | + } |
| 55 | +} |
| 56 | +---- |
| 57 | + |
| 58 | +An override row is complete: it replaces the imported row's output and any |
| 59 | +constraints, and it may carry its own language guard. |
| 60 | + |
| 61 | +== W3 — language conditioning |
| 62 | + |
| 63 | +A map can declare the languages it serves, and individual rows can be |
| 64 | +guarded by a language selected at call time: |
| 65 | + |
| 66 | +[source,ruby] |
| 67 | +---- |
| 68 | +system "ISO:rus-Cyrl:Latn:9-1995" { |
| 69 | + languages kur ckv |
| 70 | +} |
| 71 | +stage main { |
| 72 | + parallel { |
| 73 | + sub "қ" "ķ" # generic |
| 74 | + sub "қ" "k̦" when kur # Kurdish tradition |
| 75 | + } |
| 76 | +} |
| 77 | +---- |
| 78 | + |
| 79 | +Rules whose guard lists the selected language apply; guard-applicable rows |
| 80 | +take precedence over an unguarded row with the same source string; with no |
| 81 | +language selected every guard is inert and the map behaves as if the guarded |
| 82 | +rows were absent. |
| 83 | + |
| 84 | +== Availability |
| 85 | + |
| 86 | +The construct semantics are specified in ISC-WF-1. Runtime support is |
| 87 | +landing across the Interscript runtimes (Ruby reference implementation |
| 88 | +first, then TypeScript, Python and Rust); each landing is gated by the |
| 89 | +corpus additivity proof, so maps that do not use these constructs are never |
| 90 | +affected. |
0 commit comments