4

I'm build a recipe app/website, and I'm interested in how to properly classify the sections of an ingredient (as you would find in a cookbook or on a website) with regards to the terminology. Let me give an example of what I mean. Let's say an ingredient reads:

3 cups Ore-Ida southern-style hash browns

My best guess at terminology for the parts of this sentence fragment would be:

  • 3 = quantity
  • cups = unit
  • Ore-Ida = brand
  • southern-style = variation
  • hash browns = ingredient

I'm not sure if this is correct, or if there's a more precise descriptive term usage for this. I'm interested in learning the proper terminology if this is not considered to be correct.

One more thing worth noting is that in 99% of cases, there probably won't be a brand at all, or if there is, it's not of significance. In addition, if an ingredient doesn't include a unit, I'm making an assumption that the unit is "count", (e.g.: "3 eggs" would mean quantity "3", unit "count", ingredient "eggs").

  • You say "parse" - are you actually asking about how to parse things, or just what to name the parts? And are you trying to know about everything? Notably, you've missed the really common case, "2 cups onion, chopped". – Cascabel Oct 19 '14 at 18:36
  • 1
    @Jefromi oh, c'mon... you could've kept to his example : "3 cups Ore-Ida southern-style hash browns, thawed". But if he's trying to do some sort of AI thing ... it's going to get messy when he finds "one small can of tomato paste", and has to know what size cans tomato paste typically comes in (relative to the time & place the recipe was written), and thus which is the 'small' one from the options. And then there's "one small onion, diced finely" – Joe Oct 19 '14 at 18:43
  • @Joe Sorry :( thought I'd go with a more common one. Anyway, yes, that's why I asked if this was supposed to be about parsing or just naming of parts (so that someone could enter it in a structured way). – Cascabel Oct 19 '14 at 18:44
  • 2
    @Jefromi To clarify, I'm looking for what to name the parts, not how to parse them. Sorry for any confusion there. – Matt Huggins Oct 19 '14 at 21:30
  • 1
    @Jolenealaska : for a system that I maintain (not cooking related, but has units), we store two values -- the 'display value' which is what our source told us the units were, and an internal value that we use for all of our calculations (matching for searching, etc.). If you're going to convert recipies, it'd be a good idea to do something similar ... one value for scaling, but keep the original for display & provenance. – Joe Oct 19 '14 at 21:31
5

This is an exercise in data modeling, more so than cooking.
What you are describing is the design of your database.
You are on the right track.

You will want to consider how many of each of the fields you need to have. For example:

  • Quantity - Unique [there will be exactly one of these]
  • Quantity unit - Unique [exactly one]
  • Brand - Unique [optional] (either one or none)
  • Variation (or style, or preparation-note) - Non-unique [optional] (0, 1, or many)
  • Ingredient - Unique
  • Initial cooking temperature - Unique
  • I.c.t. Units - Unique
  • Preparation Instructions - (you have a decision whether to make one block text, or a series of fields which may or may not be used)
  • Cooking Instructions - (same as Prep. Instruction)
  • Cooling Instrutions... et cetera

ADDITIONAL:

To your question about when multiple modifiers might be used with an ingredient: You might have an ingredient which is expected to be prepared at the time of cooking. So: "minced onions, blanched". It would seem that order might be important to you here, as well. As you see here, there are two styles (I just realized 'modifier' might be a more all-encompassing field-name).

So you might typically see the descriptive nature of the ingredient listed like this (although maybe not the exact verbiage - I'm not sure if this exact ingredient has ever been listed). So you would have to make a decision as to whether you could have 0+ modifiers listed before the ingredient, format with a comma, then have 0+ commas after the ingredient.

Naturally the comma would only appear if there were >=1 modifiers listed after the ingredient.

Since I have thought about how infrequent you might see minced onions, blanched...you might instead see shredded red potatoes, salted and peppered. There are many considerations with respect to how modifiers could used, to be sure.

One more word - in database design, you'll want to take as much time as you can to develop pre-authoring/programming. Any minor change to the database schema could cause you to have to start all over again. :)

  • 2
    Add a bare minimum, add 'quantity qualifer' ('1 heaping tablespoon', '1 scant cup') ... but quantities aren't always one ... '1 cup + 1 TB' ... and then we get into '4 TB, divided' – Joe Oct 19 '14 at 20:59
  • 2
    Good points. My response is meant to invoke another way to think about the process. It isn't intended to be a final solution. – Jason P Sallinger Oct 19 '14 at 21:13
  • 2
    @JasonPSallinger - Thanks for helping to break it down. This is definitely what I'm looking for. Do you have an example of what an ingredient with "many" variations would look like? (Also, thanks to Joe for pointing out the qualifier.) – Matt Huggins Oct 19 '14 at 21:29
  • Sorry, but you are missing lots of cases here which are not "canonical", but very common in real-life recipes. To take quantity as an example: it can be zero (people just say "chocolate flakes", implying that you'll add as many as you want until your cake looks beautiful to you), one, or a range, such as "4-5 apples". Or an "or" phrase, as in "3 large or 4 small onions". And don't forget "salt, to taste", where there is no quantity at all. – rumtscho Oct 20 '14 at 6:32
3

Okay, to make this easier to digest, I'm going to do this is a whole w/ sub parts. Square brackets donote optional parts

Basic recipe:

  • <quantity> <ingredient>[, <preparation>][, "divided"]

Quantity:

  • ( <number> [<qualifier>] [<units>] )+

Ingredients:

  • [<brand-name>] [<preparation>] <item>

... now, you might notice that 'preparation' shows up twice. That's because sometimes the preparation comes before the measurement, and sometimes after:

  • 2 onions, diced
  • 1 cup diced onions
  • 10 cups spinich, sautéd
  • 1 cup cooked spinich

... I didn't go into details on 'preparation', as it's quite complex. (could be multiple steps, 'peeled and diced', or it could be qualified 'finely diced', '5mm slices')

Quantity may show up more than once (1 cup + 1TB).

"divided" is a note that the ingredient will be used in two different steps of preparation. Sometimes it'll be specified in the ingredient line ("2 TB + 1TB"), but not always.

update : bah, the update isn't quite the same as the comment ... because when you're dealing with what to call things, there are often multiple acceptable terms. For instance, 'quantity' could also be 'measurement'.

  • Great info, thank you! No worries on there being synonyms for what to call things, I'm just kind of looking for some kind of insight to make sure I'm considering everything and know how to organize everything when relating the data. :) – Matt Huggins Oct 20 '14 at 1:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.