FA-80787 / Bidirectional text layout / Member archive
Isolating run sequences: eos level comparison · case 02
Sequence end types follow the next character only.
Case contract
Input [classes, levels, paragraph level]. Split into maximal level runs; chain a run ending in a matched isolate initiator (LRI/RLI/FSI) with the run starting at its matching PDI (stack matching; unmatched PDI ignored). For each sequence sos = parity of max(level of first char, level of preceding char or paragraph level); eos = parity of max(level of last char, level of following char or paragraph level), using the paragraph level when the last char is an isolate initiator. Return [[indices, sos, eos]].
Why this case matters
Mixed right-to-left and left-to-right text must resolve levels and visual order exactly, or words, numbers and carets land in the wrong place.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: eos level comparison | [[[0], "L", "R"], [[1], "R", "L"], [[2, 4, 5, 6, 7, 8, 9, 10], "R", "L"], [[3], "L", "L"]] | [[[0], "L", "R"], [[1], "R", "R"], [[2, 4, 5, 6, 7, 8, 9, 10], "R", "L"], [[3], "L", "L"]] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗