armsnyder / cheese-whiz Goto Github PK
View Code? Open in Web Editor NEWRecipe reinterpreter
Recipe reinterpreter
Write the make_recipe function in app.parser that will take as input the output of parse_html, and output a Recipe object. Use the various ingredient matching functions in kb.py to achieve this.
Write transform_style function to take a recipe and a target style as inputs and output another recipe object (in the desired style).
Loop through the ingredients in the recipe. For each ingredient, check if it exists in the knowledge base style transform list for the desired style. If it does, make the exchange.
The tricky bit will be finding the correct Food object to substitute in from the USDA database.
Feel free to think up helper functions, write stubs, and make new issues for them.
Make text file for transforming ingredients to Italian style.
Acceptable formats:
ing1 = ing2
ing1, ing2 = ing3, ing4
ing1 = ing1, ing2
Design an approach for handling style transformationsby Friday meeting.
Write to_vegan function to take Recipe input and output vegan Recipe.
First, run the to_vegetarian function.
Loop through ingredients, checking food group (look in enums.py) for no-no groups. If the ingredient is of a no-no-group, check for a substitution in kb.vegan_substitutions (not yet written). If no suitable substitution can be found, replace with a quantity of TVP of equal weight.
Write a function that takes HTML text as input and outputs a very basic parsing that uses regular expressions to strip away all HTML tags. Return something like a list of (ingredient_name, quantity) tuples for ingredients and a list of strings for the steps. Nothing too fancy.
Add more preparation terms to this text file.
Suggestion: use re and urllib2 to parse online content into acceptable format
Make text file for transforming ingredients to South Asian style.
Acceptable formats:
ing1 = ing2
ing1, ing2 = ing3, ing4
ing1 = ing1, ing2
Add more style tags to this text file.
Suggestion: use re and urllib2 to parse online content into acceptable format.
Format is: food_name = +style1, +style2, -style3
Make a GUI that loads the knowledge base and offers a text field for the user to specify a recipe.
It would be good to start on that ReadMe now, updating it with the progress we have so far, so we don't forget right before deadline.
Design approach for handling healthy transformation by Friday meeting.
Write transform_availability function to take an Ingredient argument and return a list of Ingredient objects that are possible substitutions, complete with quantity info.
First check our knowledge base for common substitutions, then move on to using nutritional data / food group to find suitable alternatives.
Make new issues for any useful helper functions.
Write a function that takes an Ingredient input and outputs a healthier Ingredient, using simple search terms like "low fat," if it finds one in the USDA. If no result is found, return None.
Add more cooking wares to this text file.
Suggestion: use re and urllib2 to parse online content into acceptable format
Never done it before, but I hear pip has a really simple way to install a project's dependencies.
Add more measurements to this text file.
Suggestion: use re and urllib2 to parse online content into acceptable format.
Format is: long_measurement_name = abbrv1, abbrv2, abbrv3
Following a similar format to other txt files, write some vegan substitutions.
Complete the method add_styles (defined in kb.py's Food class) to add the positive and negative styles to the object.
Make a style_substitutions.txt file that equates foods of different styles
Make sure everything is still working. Text representations should be loaded into global fields. Text file parser methods should still be working.
Write a function that searches each recipe step, as returned from the basic html parser #13, and returns a list of cooking methods discovered.
Complete the function lookup_ingredient (defined in kb.py class KnowledgeBase) to return a list of Food objects that match the lookup query.
Design approach for handling availability transformation by Friday meeting.
Write make_healthy function to take a Recipe input and output a healthier Recipe.
Loop through Ingredients in Recipe, and apply USDA lookup function from #62.
Think of other ways also.
Make text file for transforming ingredients to Mexican style.
Acceptable formats:
ing1 = ing2
ing1, ing2 = ing3, ing4
ing1 = ing1, ing2
You know what to do
Write a function that searches each recipe step, as returned from the basic html parser #13, and returns a list of cooking tools discovered. Reminder - we have a list of cooking wares in kb.Knowledgebase.cooking_wares
Write a function that takes an Ingredient object (with an empty food_type field) and uses its information to query the KnowledgeBase.foods list for the correct food, then sets the Ingredient object's food_type field to that food.
This is difficult because many variations of foods are in the database.
Found in app.parser, mix n match all our functions to make something the autograder will grade
Write a function that takes a url and returns some HTML
Add more substitutions to this text file.
Suggestion: use re and urllib2 to parse online content into acceptable format
Take a Recipe input, and return a Recipe that has been made unhealthy.
For each Ingredient in the Recipe, query the USDA database for similar foods, and choose the least healthy alternative.
If no changes can be found, add Cheese Whiz.
Following a similar format to other txt files, write some vegetarian substitutions.
Add cooking terms to the file, same as the others.
Add the autograder code to the tests folder, then modify the functions parsed_recipe_similarity and assertSimilarRecipe inside test_parser.py to interface with the autograder.
Write a function that takes a quantity string (e.g. "1 pound") and converts it into a Quantity object (defined in kb.py). Use the KnowledgeBase.measurements list as a reference for distinguishing between the number and the unit.
Do this before doing #5
Write to_vegetarian function to take Recipe input and output vegetarian Recipe.
Loop through ingredients, checking food group (look in enums.py) for no-no groups. If the ingredient is of a no-no-group, check for a substitution in kb.vegetarian_substitutions (not yet written). If no suitable substitution can be found, replace with a quantity of TVP of equal weight.
Write some JSON files in the format of the autograder for some online recipes. These can later be added to the testing suite.
Write a function that takes a raw ingredient name string from the basic html parser #13 output and processes it to divide it into a name, descriptor, preparation, and prep descriptor.
Make the recipe GUI to have all the basic buttons and such to call the recipe transformations.
Design approach for handling vegetarian/vegan transformation by Friday meeting.
Add more descriptors to this text file.
Suggestion: use re and urllib2 to parse online content into acceptable format
Write lookup_alternative_recipe function to take args: Recipe, list of unavailable Ingredients (returned from transform_availability #60)
It should query allrecipes.com using the advanced search to specify the recipe title and missing ingredients.
If helper functions are needed, write them as stubs and make new issues for them.
Build the necessary files and objects to hold the data in the knowledge base, including -
In kb.py there's a function stub for __format_raw_sub(raw_food_in, raw_food_out)
Finish this function to make it return a complete CommonSubstitution object.
The input parameters are completely unparsed, meaning you will need to separate quantity and measurement information, as well as parse the raw_food_out string for commas, 'and's, and 'or's.
Write the quantity/measurement parser as a separate function. It will be useful elsewhere in the project.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.