str.title() fails with words containing apostrophes
Marko Rauhamaa
marko at pacujo.net
Mon Mar 6 20:03:56 EST 2017
Steve D'Aprano <steve+python at pearwood.info>:
> On Tue, 7 Mar 2017 01:03 am, Marko Rauhamaa wrote:
> If you read "title case" as *literally* as being only for titles (of
> books, for instance) then of course you are right. Finnish book titles
> are normally written in sentence case (initial capital, followed by
> all lowercase).
Yes.
> But if you consider title case more widely, Finnish includes it too.
> Names are written in title case ("Marko Rauhamaa" rather than "Marko
> rauhamaa"). I imagine countries get the same treatment when needed.
> How do you write Saudi Arabia, United Kingdom, and North Korea?
The rules are a bit complicated. Sentence case is the basic rule.
However, if the latter part of a compound name is a proper noun, both
parts are capitalized and connected with a hyphen:
Saudi-Arabia
Pohjois-Korea
Iso-Britannia
As for the UK:
Yhdistynyt kuningaskunta
or:
Ison-Britannian ja Pohjois-Irlannin yhdistynyt kuningaskunta
Similarly, the University of Helsinki is:
Helsingin yliopisto
> I came across this book title:
>
> Täällä Pohjantähden alla (‘Here beneath the North Star’)
>
> http://www.booksfromfinland.fi/1980/12/the-strike/
>
> which is partly title case, but I'm not sure what rule is being
> applied there. My guess is that "Täällä Pohjantähden" means "North
> Star" and it counts as a proper noun, like countries and people's
> names, and so takes initial caps for each word. Am I close?
Correct.
The sentence case rule is sometimes violated for historical or marketing
reasons:
Helsingin Sanomat (a newspaper)
Suomen Kuvalehti (a magazine)
Sutelan Kello ja Kulta (a jeweler)
Helsingin Hautaustoimisto (an undertaker)
Marko
More information about the Python-list
mailing list