Skip to content
Snippets Groups Projects
Commit b69a77c3 authored by Esteban Prince, Liam (UG - Computer Science)'s avatar Esteban Prince, Liam (UG - Computer Science)
Browse files

Update preprocessor.py

parent 1c74460c
No related branches found
No related tags found
No related merge requests found
......@@ -3,9 +3,11 @@ import json
with open('recipes/vegancupcakes.json', 'r') as f:
recipes = json.load(f)
# Add a space before and after every unit if there isn't one already
# Add a space before and after the character if there isn't one already
# all ubits
# -
# For example, converts "10g" to "10 g"
def separateUnits():
def surround():
# parse JSON for each Unit in Ingredients
for ingredient in recipes['Ingredients']:
# unit is any value of key Unit or Alternative in units.json
......@@ -26,8 +28,8 @@ def disambiguateUnits():
# Use heuristics such as "bake" refers to temperatures within the baking range (say 160 to 250)
# Defaults to manual intervention unless confidence is very high
def addMissingUnits():
# Replace certain characters with space to ease tokenization
# Characters to be replaced by " "
# "-"
def separateTokens():
\ No newline at end of file
pass
# Check that everything in the database conforms to the schema
def conform():
pass
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment