What's wrong
Since the #83 fix (5c15077), ReplaceNonAlphaNumericWithSpace drops an apostrophe that sits inside a word, so "CEO's" becomes "CEOs" before SplitOnCaseChange runs. IsWordBoundary has an acronym-tail rule (upper, upper, lower), and it now breaks before the last capital, which gives "CE Os".
Observed on main (1c1c555):
| Input |
Method |
Actual |
Expected |
CEO's office |
ToSnakeCase |
ce_os_office |
ceos_office |
the CEO's office |
ToPascalCase |
TheCeOsOffice |
TheCeosOffice |
API's |
ToPascalCase / ToCamelCase |
ApIs / apIs |
Apis / apis |
API's |
ToSnakeCase / ToMacroCase |
ap_is / AP_IS |
apis / APIS |
NASA's mission |
ToSnakeCase |
nas_as_mission |
nasas_mission |
The typographic apostrophe U+2019 behaves the same way. Lowercase input works: "ceo's" gives ceos. Before 5c15077 the output was ceo_s, which was less damaging, so this is a regression on a very common input: possessive acronyms. Confirmed with a temporary MSTest and a console probe.
Suggested fix
Take either approach:
- Run the case-change split while the apostrophe is still in the text, then drop the apostrophe.
IsWordBoundary already refuses to break at don'T.
- Or lowercase an all-caps run that is followed by an in-word apostrophe and letters, so
CEO's is handled like ceo's.
Acceptance: add regression rows for API's, CEO's office and NASA's mission across Pascal, Camel, Snake, Kebab and Macro.
What's wrong
Since the #83 fix (5c15077),
ReplaceNonAlphaNumericWithSpacedrops an apostrophe that sits inside a word, so"CEO's"becomes"CEOs"beforeSplitOnCaseChangeruns.IsWordBoundaryhas an acronym-tail rule (upper, upper, lower), and it now breaks before the last capital, which gives"CE Os".Observed on
main(1c1c555):CEO's officece_os_officeceos_officethe CEO's officeTheCeOsOfficeTheCeosOfficeAPI'sApIs/apIsApis/apisAPI'sap_is/AP_ISapis/APISNASA's missionnas_as_missionnasas_missionThe typographic apostrophe U+2019 behaves the same way. Lowercase input works:
"ceo's"givesceos. Before 5c15077 the output wasceo_s, which was less damaging, so this is a regression on a very common input: possessive acronyms. Confirmed with a temporary MSTest and a console probe.Suggested fix
Take either approach:
IsWordBoundaryalready refuses to break atdon'T.CEO'sis handled likeceo's.Acceptance: add regression rows for
API's,CEO's officeandNASA's missionacross Pascal, Camel, Snake, Kebab and Macro.