Skip to content

Normalize apostrophe names before casing all-capital input - #108

Open
Aschenbath wants to merge 1 commit into
ppannuto:mainfrom
Aschenbath:fix/oss20next-20261125-3592-titlecase-apostrophe-caps
Open

Aschenbath wants to merge 1 commit into
ppannuto:mainfrom
Aschenbath:fix/oss20next-20261125-3592-titlecase-apostrophe-caps

Conversation

@Aschenbath

Copy link
Copy Markdown

An all-capital line such as O'BRIEN AND D'ARCY currently becomes O'BRIEN and d'ARCY, because the apostrophe-name branch runs before the normal all-caps conversion. Lowercase that word when the line is all caps, then apply the existing name-prefix rules. The result is O'Brien and d'Arcy.

Closes #105 and follows the earlier proposal in the now-closed #101. Thanks to @afonsojanu for documenting the examples and cause. Tests cover vowel/consonant prefixes, possessives, both currently supported apostrophe characters, mixed-case input, and the original input supplied to callbacks.

Validation on Windows/Python 3.12.12: five regression subtests fail on the original code; the full suite passes with both regex and the standard-library re fallback (14 tests, one existing skip per backend). Source/wheel builds and git diff --check pass. Other Python versions were not run.

AI assistance: implementation and tests were developed with OpenAI Codex; all reported checks were executed.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

All-caps input: apostrophe-second names come out as d'ARTEMIS / O'BRIEN instead of d'Artemis / O'Brien

1 participant