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

singular_noun on word ending in "s" removes s. #159

Open
eykamp opened this issue May 18, 2022 · 5 comments
Open

singular_noun on word ending in "s" removes s. #159

eykamp opened this issue May 18, 2022 · 5 comments

Comments

@eykamp
Copy link

eykamp commented May 18, 2022


import inflect as Inflect
inflect = Inflect.engine()
inflect.singular_noun("car")           # get False, as expected
inflect.singular_noun("mass")          # get "mas", expected False

Is this behavior a bug? singular_noun() is supposed to return False when the word is already singular, and I can find no reference to suggest "mass" is the plural of "mas", which is itself the plural of "ma".

@jaraco
Copy link
Owner

jaraco commented Jul 9, 2022

This issue is related to #161. It seems inflect is naïve when it comes to many words and simply adds or subtracts a trailing s for plural/singular transforms. Probably there are many such edge cases.

I'd be open to a special-case fix for "mass" or a more general solution to words ending in "s".

@jaraco jaraco changed the title Incorrect singular_noun behavior? singular_noun on word ending in "s" removes s. Jul 9, 2022
@george-gca
Copy link
Contributor

I got the same error with two other words: loss (gave los) and analysis (gave analysi). For the first word its easy (and the same case as mass), don't remove the last s when word ends with double s, but the other one is more tricky.

@george-gca
Copy link
Contributor

@jaraco I can only think of a solution that involves a dictionary (like a list of valid words). That would be cumbersome, but I can't think of it in another way. One solution would be creating another repo with only a list of words (maybe only singulars?) like this one and then offer a version of the functions that loads this list (for people that don't mind loading a set of words in memory for the sake of correctness).

This would be helpful also when using specific terms, so it could have for example a set of words for specific scenarios, like machine learning, biology, etc.

@KnisSukparangsee
Copy link

@jaraco I'm pretty sure all words that end with ss are singular. If you think this is the right solution, can I correct this issue and submit a pull request?

@eykamp
Copy link
Author

eykamp commented Nov 1, 2023 via email

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

Successfully merging a pull request may close this issue.

4 participants