-
Notifications
You must be signed in to change notification settings - Fork 137
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
problem parsing two-word ingredients that begin with lower-case 'a' #931
Comments
Environment: Steps to reproduce:
Expected Results:
Actual Results:
Analysis:
Conclusion:
|
There are multiple problems here:
A simple workaround is this in gourmet/convert.py: @@ -644,7 +648,7 @@ all_number_words.sort( -NUMBER_WORD_REGEXP = '|'.join(all_number_words).replace(' ','\s+') I believe the NUMBER_FINDER.finditer(timestring) in timestring_to_seconds should not blindly look for the next num-like match, but only after the non-num words after the last match have been consumed. "12 Minuten" is currently parsed as [12 Minu] [ten] |
@martinp26 Thank you for investigating the issue and the simple workaround. |
Unit detection was not considering localization in two places. Fix the simple issue in find_errors_in_progress() by translating units to compare against. The second error is more complex, details are in thinkle#931. Disable broken parsing of number words for now. Signed-off-by: Martin Pohlack <[email protected]>
All_number_words is not working perfectly here. The number words need to go through localization and also need word boundaries, otherwise they match other partial ingredients or time words in other languages. E.g., "ten" match the tail of the German word for minutes (Minuten). Disable broken parsing of number words for now. Fixes thinkle#931. Signed-off-by: Martin Pohlack <[email protected]>
When entering a two-word ingredient where the first word begins with lower-case 'a', the parser strips the leading 'a' and treats it like a quantity. For example, 'apple juice' becomes 'pple juice' with a quantity of of '1'. Further detail discussed at https://answers.launchpad.net/gourmet/+question/678095
The text was updated successfully, but these errors were encountered: