Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Title casing is not proper #935

Open
petro2050 opened this issue May 19, 2020 · 3 comments · May be fixed by #987
Open

Title casing is not proper #935

petro2050 opened this issue May 19, 2020 · 3 comments · May be fixed by #987

Comments

@petro2050
Copy link

I changed the current culture to German and tested a title.

Thread.CurrentThread.CurrentUICulture = new CultureInfo("de");
Console.WriteLine(StringHumanizeExtensions.Humanize("Per anhalter durch die Galaxis", LetterCasing.Title));

The result seems to be Per Anhalter Durch Die Galaxis, but the expected result should be Per Anhalter durch die Galaxis.

Can you tell me if your title casing works in the same way as .NET's ToTitleCase (i.e. always caps the first letter of each determiner, preposition, etc.)?

@softwareliberationarmy
Copy link

Same problem in English. Humanizer does not appear to conform to standard title capitalization rules about small, non-essential words. https://capitalizemytitle.com/#capitalizationrules

@cmpalmer66
Copy link

Should LetterCasing.Title (or Titleize) user the "proper" language rules or should it be an option or an entirely new command?

For example:

"romeo and juliet".Humanize(LetterCasing.Title) should be "Romeo and Juliet"
"the old man and the sea".Humanize(LetterCasing.Title) should be "The Old Man and the Sea"

I would propose a different method, but I don't know what to call it. LetterCasing.ProperTitle? BookTitle? FormalTitle?

The other problem is that those rules aren't firm between different style guides, even in English: https://capitalizemytitle.com/

For example, "The War Between the States" is "The War between the States" in the Chicago Manual of Style.

I would take a go at working on this (for English at least), but it seems like a big can of worms for the different styles.

@jcasteele
Copy link

I'd like to have a go at this, even taking into account the differences among style guides mentioned above. While there is no standard for title casing, the majority of style guides follow pretty close to AP rules on title casing (capitalize first and last words, all major words, and any minor words that are four letters or longer) and I would propose something along that style be the default for LetterCasing.Title. A second method could be added for CMS-like title case to cover instances where that would be preferable (I say "CMS-like" because a full implementation would prove difficult due to specific rules about things like species names that even reference sites like CapitalizeMyTitle ignore.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants