fix dediac_hsb stripping the alef-wasla letter#170
Open
CodingSelim wants to merge 1 commit into
Open
Conversation
HSB_DIAC_CHARSET had Ä (U+00C4) in it, but that's the HSB encoding of alef-wasla (U+0671) which is a letter, not a diacritic. dediac_hsb deletes every char in the diac set so it was silently dropping alef-wasla from valid hsb text. derived the real diac set from the ar2hsb charmap to confirm, it's exactly the current set minus Ä. added test_dediac.py (there wasn't one), the hsb cases fail before and pass after.
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.
dediac_hsb was silently dropping alef-wasla from valid hsb text. the cause is in HSB_DIAC_CHARSET, it lists Ä (U+00C4) as a diacritic, but Ä is the hsb encoding of alef-wasla (U+0671) which is a letter. dediac deletes every char in the diac set so the letter went with it.
quick repro from the ar side to show intent, the arabic path keeps it but hsb doesn't:
to be sure about the right set i rebuilt the hsb diac charset straight from the ar2hsb charmap (mapping every char in AR_DIAC_CHARSET) and it comes out to exactly the current set minus Ä, so the fix is just removing that one char. Ä stays in HSB_LETTERS_CHARSET where it belongs.
there was no test_dediac.py so i added one covering ar/bw/hsb, the two hsb cases fail before this change and pass after. ran the charmap/transliterate/stringutils suites too, all green (test_meta fails to collect on a pre-existing unrelated import, not touched here).