Fix: unparsed ingredients poorly formatted when fed to NLP parser#7086
Fix: unparsed ingredients poorly formatted when fed to NLP parser#7086gabrielclimb wants to merge 4 commits intomealie-recipes:mealie-nextfrom
Conversation
|
Apologies that I can't just contribute this directly right now, but I recommend also adding tests for items that are less ambiguous. The "1/2 cup apples" was my go-to because you could get a fraction you wouldn't expect, but another example was "2 tbsp olive oil" being reconstructed as "1 2 tbsp olive oil" and then being parsed as "1 tbsp olive oil" |
Ok, I will add this |
|
@alexxxxxxxxxxandria , could you take another look? |
Summary
1and the full text in thenotefield (e.g."1/2 cup apples") were being reconstructed as"1 1/2 cup apples", causing the NLP parser to misinterpret the quantityingredientToParserString()that prefersoriginalText, falls back to just thenotefor unparsed ingredients (no unit/food), and only uses the full reconstruction for properly parsed ingredientsTest plan
ingredientToParserStringcovering unparsed, originalText, parsed, and empty cases