Skip to content

fix: primitive space results; stdlib alpha/digit/word/any_character - #15

Merged
ronaldtse merged 1 commit into
mainfrom
fix/pads-and-stdlib-aliases
Oct 1, 2026
Merged

ronaldtse merged 1 commit into
mainfrom
fix/pads-and-stdlib-aliases

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Two conformance gaps, both measured against the Ruby interpreter:

Primitive space in results. moct-kor pads its working string with sub line_start space / sub line_end space before the liaison rules and strips the pads at the end. The subst renderer had no branch for primitive results, so under on_unsupported=skip the pads were silently dropped — the before space guards on initial consonants never fired and 불국사 came out ᄇulguksa (all 13 of the map's examples). A primitive space now renders as " ".

Stdlib aliases. alpha, digit, word, any_character are Ruby Stdlib::ALIASES built-ins, resolved before doc-local aliases (the interpreter's lookup order). The Python engine now knows them as expression keywords with Onigmo's ASCII-exact definitions — Python's \w/\d are unicode-wide where Onigmo's are not, so word = [a-zA-Z0-9_] and digit = [0-9]. These are the only stdlib names the corpus uses in guards (19/20/21/1 occurrences).

Direct corpus sweep: 137 failures / 30 maps → 98 / 27 — moct-kor, bgnpcgn-kor-Hang-Latn-rok-2011 and bgnpcgn-kor-Kore-Latn-rok-2011 fully healed. Suite 43 passed / 1 xpassed. Bridge sweep (Compiler::Python over the full corpus): 425 → 201.

moct-kor pads its working string with 'sub line_start space' and
'sub line_end space' before the liaison rules, and strips the pads at
the end. The subst renderer had no branch for primitive results, so
with on_unsupported=skip the pads were silently dropped — the
before-space guards on initial consonants never fired and 불국사 came
out ᄇulguksa. A primitive space in a result now renders as " ".

alpha, digit, word and any_character are Ruby Stdlib built-in
aliases, resolved before doc-local aliases (the interpreter's lookup
order). The Python engine now knows them as expression keywords with
Onigmo's ASCII-exact definitions — Python's \w and \d are unicode-
wide where Onigmo's are not, so word is [a-zA-Z0-9_] and digit is
[0-9] rather than \w/\d.

Direct corpus sweep: 137 failures / 30 maps -> 98 / 27 (moct-kor,
bgnpcgn-kor rok-2011 x2 fully healed).
@ronaldtse
ronaldtse merged commit acc7d13 into main Oct 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant