3,543
edits
(Added some quantity observations.) |
|||
Line 26: | Line 26: | ||
** we can display the value in several metrics if we have a sanitized value in one metric | ** we can display the value in several metrics if we have a sanitized value in one metric | ||
=== | === Canonical approach === | ||
The real-world quantities for products as used by the | The real-world quantities for products as used by the user (and printed on the packages) is not ideal. It is often impossible to parse the quantities and understand what is indicated. | ||
However it is possible to find some common approach. This is a first attempt. | |||
Some remarks: | |||
* product central - any quantity that is indicated is about the product and not the packaging; | |||
* equivalents - one or more equivalents might be available, i.e. in grams or liters, 24 cookies / 6 cookies in 4 packages; | |||
* containers - the generic toplevel package is a container; | |||
* subcontainers - a container might comprise multiple subcontainers (or even subsubcontainers) [hierarchy?] | |||
* (sub-)container synonyms - a user might container other words to describe a container, such as bottle, can, bag, etc. | |||
* defaults - in indicating the quantity some parts are assumed to be understood. If it states 33cl it is assumed to be about the container (the bottle) and the product (beer); | |||
* | |||
* to indicate times, either a "*" or a "x" can be used; | * to indicate times, either a "*" or a "x" can be used; | ||
* the generic formula is: multiplier * quantity size_unit for units | * the generic formula is: multiplier * quantity size_unit for units | ||
Line 42: | Line 53: | ||
* naturally users do not use this formal approach, but most quantities can be translated to this approach. | * naturally users do not use this formal approach, but most quantities can be translated to this approach. | ||
Test | === Test approach === | ||
To test this approach the examples found in France have translated to this formal approach: | To test this approach the examples found in France have translated to this formal approach: | ||
{| class="wikitable sortable" | {| class="wikitable sortable" |
edits