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

Capitalized words are not inflected #201

Open
mmlange opened this issue Sep 7, 2023 · 1 comment
Open

Capitalized words are not inflected #201

mmlange opened this issue Sep 7, 2023 · 1 comment

Comments

@mmlange
Copy link

mmlange commented Sep 7, 2023

Found a strange issue when trying to retrieve the plural of property, using either plural() or plural_noun():

Python 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] on win32

>>> import inflect
>>> p = inflect.engine()

>>> p.plural('property')
'properties'

>>> p.plural('Property')
'Propertys'

I looked through the documentation, but didn't see any notes about why this would be.

I think the plural of property, whether capitalized or not, should be properties.

@jaraco jaraco changed the title The plural of "property" works, but the plural of "Property" doesn't Capitalized words are not inflected Mar 31, 2024
@jaraco
Copy link
Owner

jaraco commented Mar 31, 2024

It's not obvious to me whether the behavior you expect is desirable or not. I can definitely see how in some cases you would want to inflect a capitalized word. Other times, the word might be part of a title or proper name and shouldn't be pluralized.

I thought I'd check, and it seems the library does seem to treat title case differently:

>>> p.singular_noun('Nine Inch Nails')
'Nine Inch Nail'
>>> p.plural('Nine Inch Nail')
'Nine Inch Nails'

My guess is that inflect would need to do some case-insensitive matching if it were to implement handling words in title case. I don't know what other assumptions might be violated.

I welcome contributions on this issue.

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

No branches or pull requests

2 participants