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

possible dash/whitespace issue in _plnoun() #126

Closed
picobyte opened this issue Mar 16, 2021 · 2 comments
Closed

possible dash/whitespace issue in _plnoun() #126

picobyte opened this issue Mar 16, 2021 · 2 comments
Labels

Comments

@picobyte
Copy link
Contributor

picobyte commented Mar 16, 2021

In function _plnoun(), on this line you split on dashes - the variable name isn't well chosen

lowered_split = word.lower.split("-")

Later on, you start using this variable again, but it seems like the code is intended for whitespace split lowerd words, not dash split:

if (" ".join(lowered_split[-2:])).lower() in pl_sb_irregular_compound:

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 picobyte changed the title possible issue possible dash/whitespace issue in _plnoun() Mar 16, 2021
@picobyte

This comment was marked as off-topic.

@jaraco
Copy link
Owner

jaraco commented May 1, 2022

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?

@jaraco jaraco closed this as completed Jul 9, 2022
@jaraco jaraco added the stale label Jul 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants