filtered automations to tokens present

This commit is contained in:
smilerz 2023-04-25 12:38:14 -05:00
parent 132815496c
commit fde4ea8c4c
No known key found for this signature in database
GPG Key ID: 39444C7606D47126

View File

@ -274,10 +274,6 @@ class IngredientParser:
return: new ingredient string
"""
####################################################
####################################################
####################################################
####################################################
if self.ignore_rules:
return ingredient
@ -313,8 +309,6 @@ class IngredientParser:
if len(ingredient) == 0:
raise ValueError('string to parse cannot be empty')
ingredient = self.apply_transpose_words_automations(ingredient)
# some people/languages put amount and unit at the end of the ingredient string
# if something like this is detected move it to the beginning so the parser can handle it
if len(ingredient) < 1000 and re.search(r'^([^\W\d_])+(.)*[1-9](\d)*\s*([^\W\d_])+', ingredient):