added more units
This commit is contained in:
parent
39e13a3454
commit
3092f67899
|
|
@ -11,9 +11,11 @@ import logging
|
|||
from argparse import ArgumentParser
|
||||
|
||||
def parse_ingredient(ingredient_text):
|
||||
units = ['teaspoon', 'tablespoon', 'gram', 'once', 'jar', 'cup', 'pinch',
|
||||
units = ['teaspoon', 'tablespoon', 'gram', 'ounce', 'jar', 'cup', 'pinch',
|
||||
'container', 'slice', 'package', 'pound', 'can', 'dash', 'spear',
|
||||
'bunch', 'quart', 'cube', 'envelope', 'square', 'sprig']
|
||||
'bunch', 'quart', 'cube', 'envelope', 'square', 'sprig', 'bags',
|
||||
'box', 'drop', 'fluid ounce', 'gallon', 'head', 'link', 'loaf',
|
||||
'pint', 'pod', 'sheet', 'stalk', 'whole', 'bar']
|
||||
number_regex = '((?:[\d\\./\\u00BC-\\u00BE\\u2150-\\u215E]*\s?(?:\(.+\))?)*)'
|
||||
ingredient_regex = '([a-zA-Z \'\-]+)'
|
||||
supplement_regex = ',?(.*)'
|
||||
|
|
|
|||
Loading…
Reference in New Issue