diff --git a/quantulum3/_lang/en_US/tests/quantities.json b/quantulum3/_lang/en_US/tests/quantities.json index 911ef17..1eb4e69 100644 --- a/quantulum3/_lang/en_US/tests/quantities.json +++ b/quantulum3/_lang/en_US/tests/quantities.json @@ -1316,5 +1316,36 @@ "uncertainty": null } ] + }, + { + "req": "There is a ⅓ cup of sauce and ½ tbsp of salt in this recipe.", + "res": [ + { + "value": 0.3333333333333333, + "unit": "cup", + "surface": "⅓ cup", + "entity": "volume", + "dimensions": [ + { + "base": "length", + "power": 3 + } + ], + "uncertainty": null + }, + { + "value": 0.5, + "unit": "tablespoon", + "surface": "½ tbsp", + "entity": "volume", + "dimensions": [ + { + "base": "length", + "power": 3 + } + ], + "uncertainty": null + } + ] } -] \ No newline at end of file +] diff --git a/quantulum3/regex.py b/quantulum3/regex.py index 09c1a8d..57ccf15 100644 --- a/quantulum3/regex.py +++ b/quantulum3/regex.py @@ -202,7 +202,7 @@ def operators(lang="en_US"): NUM_PATTERN = r""" (?{number} # required number [+-]? # optional sign - \.?\d+ # required digits + (\.?\d+|[{unicode_fract}]) # required digits or unicode fraction (?:[{grouping}]\d{{3}})* # allowed grouping (?{decimals}[{decimal_operators}]\d+)? # optional decimals )