README
- Generate JSON data for each recipe. Data will be in
finished
cd src && python3 parseHTML.py /location/to/data
- Tag recipes. Make sure to have ingredientTagging setup in another directory (see source)
cd src && python3 ingredientTagging.py
- Generate the models and then generate the markov files
cd src && python3 markovRecipe.py
Todo
- Recipe extractors
- Ingredient parser (using NYTimes phrase-tagger)
- Unit converter
Unit converter notes
Give the parsed recipe,
{
"quantity":"1.5",
"measurement":"cups",
"ingredient":"green pepper",
"sr28":"1239810"
}
it will make the conversion to grams:
{
"quantity":"300",
"measurement":"gram",
"ingredient":"green pepper",
"sr28":"1239810"
}
How to do this?
-
Look up ingredient in
sr28
. If found, and the weight associated with it is the same as the current weight, use that conversion, if not make a conversion to a weight associated with thesr28
. -
(optional) To convert the measurement, use an array of increasing measurement types:
[milliliter, teaspoon, tablespoon, ounce, cup, pint, quart, gallon, liter]
and the associated transformation array (left to right):
[4, 3, 2, 8, 2, 2, 4, 0.2642]
.
For example, 4 millilter = 1 teaspoon
and 0.26452 gallon = 1 liter
. Any conversion can be made by simply traversing the array.
- Use the
sr28
weight to convert to grams.
Data
data/FoodPricesDatabase0304.tab
from here which contains prices per 100 g.
data/sr28/*
are from the sr28 USDA database.
Documentation is available.
Relevant
http://opensourcecook.com/recipes-copyright-law https://news.ycombinator.com/item?id=11711467