homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients ezio.melotti, markon, nickd, r.david.murray, rhettinger, twb
Date 2009年09月28日.21:02:22
SpamBayes Score 3.13618e-05
Marked as misclassified No
Message-id <1254171744.57.0.855191107022.issue7008@psf.upfronthosting.co.za>
In-reply-to
Content
I'm still researching what other languages do. MS-Excel matches what
Python currently does. Django uses the python version and then fixes-up
apostrophe errors: 
 title=lambda value: re.sub("([a-z])'([A-Z])", lambda m:
m.group(0).lower(), value.title()). 
It would also be nice to handle hyphenates like "xray" --> "X-ray". 
Am thinking that it would be nice if the user could pass-in an optional
argument to list all desired characters to prevent transitions (such as
apostrophes and hyphens).
A broader solution would be to replace string.capwords() with a more
sophisticated set of rules that generally match what people are really
trying to accomplish with title casing: 
 http://aitech.ac.jp/~ckelly/midi/help/caps.html
 http://search.cpan.org/dist/Text-Capitalize/Capitalize.pm
 "Headline Style" in the Chicago Manual of Style or 
 Associate Pressd Stylebook: 
 
http://grammar.about.com/b/2008/04/11/rules-for-capitalizing-the-words-in-a-title.htm
Any such attempt at a broad solution needs to provide ways for users to
modify the list of exception words and options for quoted text.
History
Date User Action Args
2009年09月28日 21:02:24rhettingersetrecipients: + rhettinger, ezio.melotti, r.david.murray, markon, twb, nickd
2009年09月28日 21:02:24rhettingersetmessageid: <1254171744.57.0.855191107022.issue7008@psf.upfronthosting.co.za>
2009年09月28日 21:02:23rhettingerlinkissue7008 messages
2009年09月28日 21:02:22rhettingercreate

AltStyle によって変換されたページ (->オリジナル) /