-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
engine.plural
raises unexpected IndexError
#172
Comments
That seems like invalid input to me. What would you expect when pluralizing a phrase? |
@jaraco, I wouldn't expect it to break and could you please explain why it's is not raising the error in the first run and raising in the second run, there is no much difference in the input except spaces |
I'm not familiar enough with the implementation to know what's expected here. I would need to trace the inputs through the code and try to infer what the code is trying to do. Harmon has determined that sometimes the length of the words being processed is a mismatch before and after postprocess. There may be a bug there, but I'm not confident that this use case should be supported at all.
I think I would expect it to break, if it can't provide a reasonable response. Perhaps there should be a check and if the input is something unexpected (like pipes or long phrases), it should just raise a ValueError early. Regardless, this project is community-supported, so I'll leave this one for someone to investigate and propose a solution. |
This might be considered invalid input, but
engine.plural
accepts multiple words.When doing so, it can raise an unexpected
IndexError
:This seems to be because
engine.postprocess
expects theinflected
it's passed to be the same number of words as theorig
it's passed, but that's not necessarily the case.The text was updated successfully, but these errors were encountered: