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

string.title() doesn't understand apostrophes #38798

Closed
vmole mannequin opened this issue Jul 6, 2003 · 5 comments
Closed

string.title() doesn't understand apostrophes #38798

vmole mannequin opened this issue Jul 6, 2003 · 5 comments
Labels
stdlib Python modules in the Lib dir

Comments

@vmole
Copy link
Mannequin

vmole mannequin commented Jul 6, 2003

BPO 766541
Nosy @loewis, @rhettinger, @terryjreedy

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2003-07-08.06:59:10.000>
created_at = <Date 2003-07-06.00:17:57.000>
labels = ['library']
title = "string.title() doesn't understand apostrophes"
updated_at = <Date 2003-07-08.06:59:10.000>
user = 'https://bugs.python.org/vmole'

bugs.python.org fields:

activity = <Date 2003-07-08.06:59:10.000>
actor = 'loewis'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2003-07-06.00:17:57.000>
creator = 'vmole'
dependencies = []
files = []
hgrepos = []
issue_num = 766541
keywords = []
message_count = 5.0
messages = ['16890', '16891', '16892', '16893', '16894']
nosy_count = 4.0
nosy_names = ['loewis', 'rhettinger', 'terry.reedy', 'vmole']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue766541'
versions = []

@vmole
Copy link
Mannequin Author

vmole mannequin commented Jul 6, 2003

Consider the following:

steveg@speedy:~/jbox$ python 
Python 2.2.3 (#1, Jun  4 2003, 02:54:59) 
[GCC 3.3 (Debian)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> "I've fallen and i can't get up".title()
"I'Ve Fallen And I Can'T Get Up"
>>> 

That looks fairly non-standard to me. Apparently, the
title()
method treats apostrophes as whitespace/word
seperators/something.

Thanks,
Steve

@vmole vmole mannequin closed this as completed Jul 6, 2003
@vmole vmole mannequin added the stdlib Python modules in the Lib dir label Jul 6, 2003
@vmole vmole mannequin closed this as completed Jul 6, 2003
@vmole vmole mannequin added the stdlib Python modules in the Lib dir label Jul 6, 2003
@loewis
Copy link
Mannequin

loewis mannequin commented Jul 6, 2003

Logged In: YES
user_id=21627

Unfortunately, this usage of the apostrophe is specific to
the English language. Martin says, 'if the apostrophe is
used for indirect speech, upper-casing after it is correct'.

@terryjreedy
Copy link
Member

Logged In: YES
user_id=593130

If the ' directly follows a letter, then it is being used for a
contraction and not for indirect speech, and the following
letter should not be uppercased.

@rhettinger
Copy link
Contributor

Logged In: YES
user_id=80475

The determination of what actually constitutes a word is
language-dependent. For instance, in French, l'arbre is
considered two words. See:
http://www.unicode.org/reports/tr21/tr21-5d3.html

Also, I tried the VB and MS-Excel implementations (they call
it "proper" instead of "title") and they match the current
Python behavior. I found no equivalent string method in
Java.

@loewis
Copy link
Mannequin

loewis mannequin commented Jul 8, 2003

Logged In: YES
user_id=21627

Thanks, Raymond, for this investigation.

Closing it as wont-fix - if you want an algorithm that
follows the English language rules, you have to implement
that yourself.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

2 participants