Coder Social home page Coder Social logo

cheese-whiz's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cheese-whiz's Issues

Write make_recipe function

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

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 italian_style.txt

Make text file for transforming ingredients to Italian style.

Acceptable formats:
ing1 = ing2
ing1, ing2 = ing3, ing4
ing1 = ing1, ing2

Write to_vegan function

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 primary cooking method retriever

Return the primary cooking method. Possibly reference basic html parser #13 and/or cooking method retriever #27.

Suggestion - find the method that corresponds to the main ingredient, that takes the most time, or that involves the greatest number of ingredients.

Make basic recipe HTML parser

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.

Extend preparation_terms.txt

Add more preparation terms to this text file.

Suggestion: use re and urllib2 to parse online content into acceptable format

Make south_asian_style.txt

Make text file for transforming ingredients to South Asian style.

Acceptable formats:
ing1 = ing2
ing1, ing2 = ing3, ing4
ing1 = ing1, ing2

Extend style_tags.txt

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

Start on the GUI

Make a GUI that loads the knowledge base and offers a text field for the user to specify a recipe.

Start ReadMe

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.

Write transform_availability function

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.

Extend cooking_wares.txt

Add more cooking wares to this text file.

Suggestion: use re and urllib2 to parse online content into acceptable format

Extend measurements.txt

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

Write cooking method retriever

Write a function that searches each recipe step, as returned from the basic html parser #13, and returns a list of cooking methods discovered.

Write food lookup function

Complete the function lookup_ingredient (defined in kb.py class KnowledgeBase) to return a list of Food objects that match the lookup query.

Write make_healthy function

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 mexican_style.txt

Make text file for transforming ingredients to Mexican style.

Acceptable formats:
ing1 = ing2
ing1, ing2 = ing3, ing4
ing1 = ing1, ing2

Write cooking tools retriever

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 ingredient to food matcher

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.

Write function to make recipe less healthy

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.

Integrate autograder into recipe test cases

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 quantity interpreter

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

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 ingredient name parser

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.

Write lookup_alternative_recipe function

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.

Create framework for knowledge base

Build the necessary files and objects to hold the data in the knowledge base, including -

  • KnowledgeBase class with accessor and loading methods
  • Food class
  • PreparationName class
  • CookingWare class
  • CommonSubstitution class

  • preparation_names.txt data file
  • cooking_wares.txt data file
  • common_substitutions data file

Write common substitution parser

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.