FIX BrailleConverter: semicolon mapped to the wrong braille cell - #2278
Merged
Conversation
The semicolon was mapped to U+2830 (dots 5,6), which is the letter-sign /
grade-1 indicator cell, not a semicolon. English Braille (and UEB, and the
French and German codes) all encode the semicolon as dots 2,3 = U+2806. Every
other punctuation mark in the map already follows that standard (comma dot 2,
colon dots 2,5, period dots 2,5,6, etc.), so this was an isolated
transcription error rather than a code-variant choice.
Effect: any ';' in a prompt was converted to the wrong braille character.
The existing braille tests only assert the output is non-empty, so the wrong
cell passed unnoticed. Added test_braille_converter_punctuation_cells, which
pins the exact cell for each punctuation mark; it fails on the old value
(';' -> U+2830) and passes on U+2806.
Contributor
@WatchTree-19 you need to accept the CLA if you want the contribution to get merged. Please check the terms to see if you agree. |
Contributor
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
BrailleConvertercharacter map encodes the semicolon as⠰(dots 5,6). That cell is the letter-sign / grade-1 indicator, not a semicolon. English Braille — and UEB, and the French and German codes — all encode the semicolon as dots 2,3 =⠆(⠆).Every other punctuation mark in the same map already follows the standard:
,⠂:⠒.⠲!⠖?⠦;⠰⠆)So this is an isolated transcription error, not a code-variant choice. Effect: any
;in a prompt was converted to the wrong braille character (the reader sees a grade-1 indicator instead of a semicolon).Fix
One-character map correction,
;→⠆.Tests
The existing braille tests only assert the output is non-empty, so the wrong cell passed unnoticed. Added
test_braille_converter_punctuation_cells, which pins the exact braille cell for each punctuation mark. It fails on the old value:and passes after the fix. Full braille suite: 10 passed.
ruff checkandruff format --checkclean.