You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the user is allowed to enter quantities along with their ingredients. The idea was to be able to detect missing ingredients more accurately by also taking into account quantities. However, this turns out to be difficult in practice.
First, quantities would have to be converted to different units to be able to compare them to the required quantities the API returns. This is may not seem too bad since there's a JS library to handle conversions. However, some units are vague, like counts (1 apple, 2 bananas). I've seen some recipes specify cups of apples (presumably chopped). If someone specified 1 of some ingredient, there's no way to know if that'd be enough to fit into 0.5 cups when chopped up. If someone specified a gram of something, then we'd need the conversion rate for each type of item, since mass and volume measure different things.
The motivation for using the parseIngredients endpoint was to be able to parse these quantities. Because quantities will no longer be of use, we can instead use autocomplete. This provides a nicer user experience while still letting us ensure inputs are valid. If autocomplete does not show a result for the input, then the user will not be able to submit that input.
The autocomplete endpoint takes 0.01 quota points per call. For simplicity, call the endpoint every time a character is entered or removed. Of course, this can quickly eat into our quota limit; 100 characters = 1 point. A decent rate limit might be 200 characters per minute.
The text was updated successfully, but these errors were encountered:
Currently, the user is allowed to enter quantities along with their ingredients. The idea was to be able to detect missing ingredients more accurately by also taking into account quantities. However, this turns out to be difficult in practice.
First, quantities would have to be converted to different units to be able to compare them to the required quantities the API returns. This is may not seem too bad since there's a JS library to handle conversions. However, some units are vague, like counts (1 apple, 2 bananas). I've seen some recipes specify cups of apples (presumably chopped). If someone specified 1 of some ingredient, there's no way to know if that'd be enough to fit into 0.5 cups when chopped up. If someone specified a gram of something, then we'd need the conversion rate for each type of item, since mass and volume measure different things.
The motivation for using the parseIngredients endpoint was to be able to parse these quantities. Because quantities will no longer be of use, we can instead use autocomplete. This provides a nicer user experience while still letting us ensure inputs are valid. If autocomplete does not show a result for the input, then the user will not be able to submit that input.
The autocomplete endpoint takes 0.01 quota points per call. For simplicity, call the endpoint every time a character is entered or removed. Of course, this can quickly eat into our quota limit; 100 characters = 1 point. A decent rate limit might be 200 characters per minute.
The text was updated successfully, but these errors were encountered: