Parsing the ingredient line
Each line is split into quantity, unit and food name, then matched against a composition database derived from USDA FoodData Central. Ambiguities are resolved conservatively: 'a handful' becomes 30 g, 'a can of chickpeas' becomes 240 g drained, and an unspecified onion becomes a medium one at 110 g. Where a line cannot be matched with confidence, it is flagged rather than silently dropped, because a missing ingredient distorts every number that follows.