Closed eliotw closed 6 years ago
I wonder if the scope of this should be limited to a single line/sentence. There maybe a case where a recipe will reference oz for something like a steak. But then reference a liquid later on. For example:
- 8 oz steak
- 2 tbsp olive oil
I can work on this.
Great, thanks for volunteering! You can find the relevant part of the code in this file. Feel free to reach out if you need any assistance :)
Can you clarify what you mean about limiting the scope to a line or sentence? In the above example you mentioned, the 8 oz should be considered a weight unit, and not volume.
Yes. So with the previous exmaple, the original logic would require two conditions to be true.
Even limiting the scope of the match to a single line/sentence could be an issue if someone posted "8 oz steak and 1 tbsp olive oil"
Oh, I see what you mean (my mind didn't register that oil was a liquid - in my defence, it's late here, haha)... Yes, that's an excellent idea to limit it per line or sentence! Great catch :)
Hmm, you're right, there are definitely limitations to the approach. I think we should try it out, and we can always iterate if it doesn't work. I'm guessing/hoping the "8 oz steak and 1 tbsp olive oil" problem will be a super edge case
Given a post contains the unit "oz" but NOT "fl oz" unit If the post text also contains the keywords:
The "oz" should be converted to "fl oz" This can be done in a pre-processing step in the fl oz conversion object