Repository navigation
Separate words at the invisible separator, U+2063 - #1018
Merged
Merged
Conversation
U+2063 INVISIBLE SEPARATOR now separates under every policy as the zero-width space and byte-order mark do (#851), so JohnSmith reads given John, family Smith where 1.4.0 through 2.8.0 read one given name. Every shape #851 settled for the zero-width space holds for it. The invisible math operators U+2061, U+2062, U+2064 and the Mongolian vowel separator U+180E stay inside the word, recorded as excluded in decisions/T1 with a test row each. No real name in the committed or local corpora holds any of the five characters. Found comparing the tokenizer with name_tamer's zero-width filter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
parse("JohnSmith")now gives givenJohn, familySmith. 1.4.0 through 2.8.0 gave a single given name,JohnSmith(checked against the 1.4.0, 2.0.0 and 2.8.0 wheels).What changes
U+2063, INVISIBLE SEPARATOR, joins the unconditional separators. It is added to
_tokenize._INVISIBLE_SEPARATORS, beside U+200B and U+FEFF (Should a zero-width space separate words, so 王小明 reads as 王小明 does? #851). No policy reaches it, as none reaches those two. Unicode intends it as the invisible comma between indices in mathematical text.It behaves exactly as the zero-width space does in every shape Should a zero-width space separate words, so 王小明 reads as 王小明 does? #851 settled. Beside the interpunct it reads as whitespace. It doesn't count as a space where a quote or maiden marker is recognized, so
Jane (néeJones) Smithreads nicknamenée Jones. After a hyphen it divides the name.Excluded, each with a test row:
name_tamer strips U+180E; doing that here would change how a Mongolian name is written.
Evidence
No real name holds any of the five characters: none of the 13 local corpora's
raw.jsonldoes, and in the committed corpora the only occurrence is rules/T1's new example. So no measured name moves; this is robustness against text pasted from documents. Found while comparing the tokenizer with dominicsayers/name_tamer's zero-width filter.Docs
_tokenize.pycomments that described the old two-member set.Checks
_tokenize.pycomments;🤖 Generated with Claude Code