jaraco / inflect

Correctly generate plurals, ordinals, indefinite articles; convert numbers to words
https://pypi.org/project/inflect
MIT License
971 stars 106 forks source link

possible dash/whitespace issue in _plnoun() #126

Closed picobyte closed 2 years ago

picobyte commented 3 years ago

In function _plnoun(), on this line you split on dashes - the variable name isn't well chosen https://github.com/jaraco/inflect/blob/00c44792896300d2fa39e63f1a185d3fd37704cb/inflect.py#L2672

Later on, you start using this variable again, but it seems like the code is intended for whitespace split lowerd words, not dash split: https://github.com/jaraco/inflect/blob/00c44792896300d2fa39e63f1a185d3fd37704cb/inflect.py#L2717

Unless I am mistaken the code should rename the variable to lowered_dash_split, for the first lines, and create a second variable (could be the existing name) that is whitespace split, to be used in the second set of lines

127 contains my suggested fix

picobyte commented 3 years ago

also graffiti is both listed as uninflected and ast the plural of graffito.

jaraco commented 2 years ago

In #153, I've done some work to refactor the handling of prepositional phrases (dash- and space-separated). This new code avoids conflating the purposes of these two blocks, which may make it easier to resolve the issue.

Can you provide an example of what unexpected result you get based on the current implementation?