Commit Graph

10 Commits

Author SHA1 Message Date
vabene1111
9856857c51 updated openeats importer 2021-06-11 15:28:11 +02:00
vabene1111
f04a51c1ad fixed empty units/foods (again) 2021-03-19 00:19:29 +01:00
Aaron
87d6ca0200
Fix ingredient parsing for fractions using '/'
Even though ingredients like '1 1/2 something' already worked fine and got converted to 1.5 something
I just came across a recipe using '1/2' as the whole amount without any whole number before that.
Apparently I overlooked that case before so I now also fixed that.
2021-02-14 18:43:38 +01:00
Tobias Lindenberg
b59c7288b1 helper/ingredient_parser 2021-01-10 13:44:55 +01:00
vabene1111
e9f2b875b9 formatting 2021-01-07 22:47:53 +01:00
Jakob Wenzel
29903af085 catch error when trying to parse into ingredient/note 2021-01-07 19:49:02 +01:00
Jakob Wenzel
8ed2562454 allow plural-suffixes in ingredient parser 2021-01-07 19:30:07 +01:00
Aaron
79396cec9e
switch from double to single quotes 2020-12-21 22:42:27 +01:00
Aaron
5e07c6130f
Switch to 4-space indentation 2020-12-21 20:14:32 +01:00
Aaron
94e1fdfbff
Improve text to ingredient parsing
The previous implementation of parsing ingredients was very simple. I now wrote a parser
that I would consider good. It takes care of several edge cases and notations.

- Supports fraction unicode (½, ¼, ⅜, ...)
- Supports notations like `1½` and `1 1/2`
- Supports unit directly after the amount without space inbetween (`2g`, `2½g`)
- Supports notes (`5g onion (cubed)` -> amount: 5, unit: g, ingredient: onion, note: cubed)
- Supports notes (`5g onion, cubed` -> amount: 5, unit: g, ingredient: onion, note: cubed)
- Does not break when both commas and brackets exist
2020-12-21 20:00:46 +01:00