Repository navigation
Add opt-in Unicode mark-preserving processor - #518
Open
jamesyshd19-cmyk wants to merge 1 commit into
Open
jamesyshd19-cmyk wants to merge 1 commit into
jamesyshd19-cmyk wants to merge 1 commit into
Conversation
Member
|
Why does the native preprocessor implementation need to call the python implementation? I feel like this could just be done in C++ by regenerating our unicode lookup tables |
This branch has not been deployed
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.
Closes #515.
Add
utils.default_process_with_marksfor text where vowel signs and other Unicode marks affect matching. It keeps alphanumeric characters and marks, as well as zero-width joiners and non-joiners between letters or marks. It replaces other characters with spaces, trims the ends, and lowercases the result. The existingdefault_processis unchanged.The Sinhala and Tamil comparisons from #515 both scored 85.5 with the existing processor. With the opt-in processor they score 36.0 and approximately 51.4, leaving only the exact matches above the cutoff of 80. The tests also cover Sinhala conjuncts and Persian non-joiners.
Both backends use the same Python callable and the interpreter’s Unicode database to preprocess
strinputs. Callers can apply Unicode normalization separately. Variation selectors are marks, so two emoji-only strings carrying the same selector can reduce to the same processed string.Verification on Apple Silicon with Python 3.14
e5ba595, with identical failing test IDs.