Finds every quantity paired with a known unit of measure in a string, along with where
each one sits in the text.
Intended for text that has already been parsed — an Ingredient.description, a
recipe step — where imperial fragments such as "1 1/2-inch" or "(about 1 pound)"
remain embedded in prose. Composes with convertUnit, which the unit IDs feed
directly.
parseIngredient's descriptionMeasurements option runs exactly this over each
ingredient's description.
Finds every quantity paired with a known unit of measure in a string, along with where each one sits in the text.
Intended for text that has already been parsed — an Ingredient.description, a recipe step — where imperial fragments such as
"1 1/2-inch"or"(about 1 pound)"remain embedded in prose. Composes with convertUnit, which the unit IDs feed directly.parseIngredient'sdescriptionMeasurementsoption runs exactly this over each ingredient's description.