Repository navigation
Conversation
Name spellings in the wild use sh/ch/ts where the previous fold emitted bare s/c/t: Kašerininov/Kasherininov, Шевченко/Shevchenko, Хрущёв/Hrushchev, Цой/Tsoj. The Latin letters are mapped after the per-script pass and before the NFKD mark strip; щ and ц are substituted before the ICU4X Cyrillic pass, since their ISO-9 output (ŝ, c) can't be recovered afterwards. ž and ţ keep the bare-letter fold. Fixes #292 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #292.
maybe_asciifoldedš/č/şto bares/c, but name spellings in the wild mostly usesh/ch. The corpus measurement in #292 shows a net gain of +5,214 agreeing spellings for the six Latin characters.Change
š/ş/ș → sh,č/ĉ → ch,ț → ts. This runs after the per-script pass and before the NFKD mark strip, which otherwise removes the diacritic. The input is NFC-composed first, so decomposed input (s+ U+030C) is covered too.щ → shch,ц → ts, substituted before the ICU4X Cyrillic transliterator. The transliterator's output for these (ŝ,c) can't be told apart from other letters afterwards.žandţkeep folding to the bare letter: foržthe corpus is a coin flip, and forţthe current fold is better.Š → Sh), following the existingÞ → Th.Metaphone runs on the ASCII form, so its codes now agree with the common spellings (
KašerininovandKasherininovboth giveKXRNNF).Downstream impact
This changes the output of
maybe_ascii, and thereforeNamePart.ascii,comparableand metaphone, plus address tokens (шоссе → shosse, whichforms.ymlalready lists). Anything that stores folded forms, such as yente indexes, should be rebuilt after upgrading. This needs a changelog note and a version bump.Not covered here:
х → h(vskh) andй → j(vsi/y).Tests
cargo test: 273 passedpytest: 548 passedmypy --strict: clean--features python): cleancargo fmt --check: clean🤖 Generated with Claude Code