Add Smart Quotes canonicizer#143
Open
taserz wants to merge 1 commit into
Open
Conversation
Closes evllabs#112. Adds a canonicizer that replaces Unicode smart/curly quotes with plain ASCII equivalents. Word processors automatically substitute typographic quotes for straight ones, so the same phrase can tokenize differently depending on where the text came from. This normalizes that before feature extraction. Characters handled: - U+2018, U+2019, U+201B (curly single quotes, high-reversed-9) -> ' - U+201C, U+201D, U+201E, U+201F (curly double quotes, low/high-9) -> " - U+00AB, U+00BB (double angle quotation marks) -> " - U+2039, U+203A (single angle quotation marks) -> ' - U+2032, U+2033 (prime, double prime) -> ', " Shows up in the GUI. Unit tests included. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
16dc594 to
fe1ec51
Compare
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 #112
Adds a canonicizer that replaces Unicode smart/curly quotes with plain ASCII equivalents. Word processors automatically substitute typographic quotes for straight ones, so the same phrase can tokenize differently depending on where the text came from. This normalizes that before feature extraction.
Characters covered: curly single and double quotes (U+2018, U+2019, U+201B, U+201C, U+201D, U+201E, U+201F), double angle quotation marks (U+00AB, U+00BB), single angle quotation marks (U+2039, U+203A), and prime/double prime (U+2032, U+2033). Shows up in the GUI. Unit tests included.