Skip to content

Title-case a word-initial Armenian ligature, and step the scan by code point [patch] - #152

Merged
matt-edmondson merged 1 commit into
mainfrom
fix/armenian-ligature-titlecase
Nov 4, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
fix/armenian-ligature-titlecase

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #150

What changed

  • FullTitlecaseWithNoSimpleTitlecase now maps U+0587 և → Եւ and U+FB13–FB17 (ﬓ ﬔ ﬕ ﬖ ﬗ → Մն Մե Մի Վն Մխ), the remaining SpecialCasing.txt letters that are lowercase, have no simple title case, and start words in real text. "Ես և դու".ToPascalCase() is now ԵսԵւԴու, the same as the եւ spelling, and snakes back to ես_եւ_դու.
  • TitleCaseWordStartsWithNoSimpleTitlecase steps by CodePointLength, as the other loops in the file already do. previousStart is now the start of the previous code point rather than a low surrogate, so "Hello 𝐀file".ToTitleCase() leaves the fi alone and its Pascal → snake form keeps 𝐀file as one word.

Tests

  • AWordStartingWithAnArmenianLigatureShouldBeTitleCased (6 rows: և and each of U+FB13–FB17) checks the title case, Pascal idempotence, and the word count after Pascal → snake.
  • ArmenianAndShouldConvertLikeItsTwoLetterSpelling checks that Pascal/camel agree with the եւ spelling and that Pascal → snake gives ես_եւ_դու.
  • ALigatureAfterALetterOutsideTheBmpShouldNotStartAWord covers the surrogate-stepping defect.
  • With the fix reverted, all 8 new cases fail. With it, the full suite passes on net10.0.

Expect possible textual conflicts with open PRs #141, #143, #146 and #147, which edit nearby code. None of them changes this function.


Generated by Claude Code

…e point [patch]

TitleCaseWordStartsWithNoSimpleTitlecase now maps U+0587 "և" (the Armenian
word for "and") and U+FB13-FB17 to their full title case from
SpecialCasing.txt, so "Ես և դու".ToPascalCase() keeps the boundary before
"և" and converts the same as the two-letter spelling "եւ".

The scan also steps by code point instead of UTF-16 code unit, so a
ligature after a letter outside the BMP is no longer taken to start a word.

Fixes #150

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW6QSBbC4yjv9GxYCN1
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants