cooklang 0.18.2

Cooklang parser with opt-in extensions
Documentation
default_system = "metric"

[si.prefixes]
kilo = ["kilo"]
hecto = ["hecto"]
deca = ["deca"]
deci = ["deci"]
centi = ["centi"]
milli = ["milli"]

[si.symbol_prefixes]
kilo = ["k"]
hecto = ["h"]
deca = ["da"]
deci = ["d"]
centi = ["c"]
milli = ["m"]

[fractions]
metric = false
imperial = true

[fractions.quantity]
time = false
temperature = false

[fractions.unit]
tsp = { max_whole = 5, max_denominator = 8 }
tbsp = { max_whole = 4, max_denominator = 3 }
lb = { max_denominator = 8 }

[[quantity]]
quantity = "volume"
best = { metric = ["ml", "l"], imperial = ["cup", "tsp", "tbsp"] }
[quantity.units]
metric = [
    { names = ["liter", "liters", "litre", "litres"], symbols = ["l", "L"], ratio = 1, expand_si = true },
]
imperial = [
    { names = ["teaspoon", "teaspoons"], symbols = ["tsp", "tsp."], ratio = 0.004_928_921 },
    { names = ["tablespoon", "tablespoons"], symbols = ["tbsp", "tbsp.", "tbs", "tbs."], ratio = 0.014_786_764 },
    { names = ["fluid ounce", "fluid ounces"], symbols = ["fl oz", "fl. oz.", "fl. oz", "fl oz."], ratio = 0.029_573_529 },
    { names = ["cup", "cups"], symbols = ["c"], ratio = 0.236_588_236 },
    { names = ["pint", "pints"], symbols = ["pt"], ratio = 0.473_176_473 },
    { names = ["quart", "quarts"], symbols = ["qt"], ratio = 0.946_352_946 },
    { names = ["gallon", "gallons"], symbols = ["gal"], ratio = 3.785_411_784 },
]

[[quantity]]
quantity = "length"
best = { metric = ["cm", "mm", "m"], imperial = ["in", "ft"] }
[quantity.units]
metric = [
    { names = ["meter", "meters", "metre", "metres"], symbols = ["m"], ratio = 1, expand_si = true },
]
imperial = [
    { names = ["foot", "feet"], symbols = ["ft", "'"], ratio = 0.3048 },
    { names = ["inch", "inches"], symbols = ["in", "\""], ratio = 0.0254 },
]

[[quantity]]
quantity = "mass"
best = { metric = ["mg", "g", "kg"], imperial = ["oz", "lb"] }
[quantity.units]
metric = [
    { names = ["gram", "grams"], symbols = ["g"], ratio = 1, expand_si = true },
]
imperial = [
    { names = ["ounce", "ounces"], symbols = ["oz", "oz."], ratio = 28.349_523_125 },
    { names = ["pound", "pounds"], symbols = ["lb", "lb."], ratio = 453.592_37 },
]

[[quantity]]
quantity = "time"
best = ["s", "h", "min", "d"]
units = [
    { names = ["second", "seconds"], symbols = ["s", "sec"], aliases = ["secs"], ratio = 1 },
    { names = ["minute", "minutes"], symbols = ["min"], aliases = ["mins"], ratio = 60 },
    { names = ["hour", "hours"], symbols = ["h"], ratio = 3600 },
    { names = ["day", "days"], symbols = ["d"], ratio = 86400 },
]

[[quantity]]
quantity = "temperature"
best = { metric = ["C"], imperial = ["F"] }
[quantity.units]
metric = [
    { names = ["celsius"], symbols = ["°C", "ºC", "", "C"], ratio = 1, difference = 273.15 },
]
imperial = [
    { names = ["fahrenheit"], symbols = ["°F", "ºF", "", "F"], ratio = 0.55555555556, difference = 459.67 }
]