-
Notifications
You must be signed in to change notification settings - Fork 472
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
parse_expression
fails on units with spaces in the name
#799
Comments
units with spaces are not supported as there is no robust wat to distinguish the user intention and would make the parser much more complex |
Can you provide an non-robust example? "Fluid ounce" and "survey mile" both appear unambiguous. I'm glad to check out the code, but how would a token with a space in it would make the parsing much more difficult? I'm glad to make a pull request. |
A space is now interpreted as product. That is why you can write And then there are examples like the one you gave, it might be an unusual interpretation but is legal. In this cases we tend to follow a simple rule: do not guess the user intentions. |
I see, thank you for explaining. It looks like a space for multiplication is currently handled in |
That is completely correct. There has been discussions in the past about making the I think that would be a nice addition. |
I can take a go at this probably. My thinking is to use However, this wouldn't work for the given example |
I think is better to create a new attribute for this (maybe |
Gonna close this, preprocessors can be used as a work around. |
For example,
both raise
UndefinedUnitError
. Others instances fail to recognize a unit name with spaces and gives unusual interpretations:returns
1 femtoliter ounce
.The text was updated successfully, but these errors were encountered: