Describe the bug
Currently when an ingredient string uses the descriptive phrase ... clove garlic, the product in the ingredient is identified as clove instead of the expected result garlic.
This is due to the two products both ranking equally as single-term matches for the input string, without any tie-breaker to distinguish a 'winner' between the two terms.
We should use the term frequency for each product as a tie-breaker in situations like this; garlic has a much higher term frequency than clove, and in the case of ambiguity it is more likely to be the intended result.
To Reproduce
Steps to reproduce the behavior:
Perform an ingredient parsing query for the string 1 clove garlic
Describe the bug Currently when an ingredient string uses the descriptive phrase
... clove garlic
, the product in the ingredient is identified asclove
instead of the expected resultgarlic
.This is due to the two products both ranking equally as single-term matches for the input string, without any tie-breaker to distinguish a 'winner' between the two terms.
We should use the term frequency for each product as a tie-breaker in situations like this;
garlic
has a much higher term frequency thanclove
, and in the case of ambiguity it is more likely to be the intended result.To Reproduce Steps to reproduce the behavior:
1 clove garlic
clove
Expected behavior After parsing, the product
garlic
should be identified.