diff --git a/spacy/hu/tokenizer_exceptions.py b/spacy/hu/tokenizer_exceptions.py index 6429fcf14..f328e1d26 100644 --- a/spacy/hu/tokenizer_exceptions.py +++ b/spacy/hu/tokenizer_exceptions.py @@ -540,7 +540,7 @@ ORD_NUM_OR_DATE = "([A-Z0-9]+[./-])*(\d+\.?)" _NUM = "[+\-]?\d+([,.]\d+)*" _OPS = "[=<>+\-\*/^()÷%²]" _SUFFIES = "-[{a}]+".format(a=ALPHA_LOWER) -NUMERIC_EXP = "\(?({n})(({o})({n}))*[)%]?".format(n=_NUM, o=_OPS) +NUMERIC_EXP = "({n})(({o})({n}))*[%]?".format(n=_NUM, o=_OPS) TIME_EXP = "\d+(:\d+)*(\.\d+)?" NUMS = "(({ne})|({t})|({on})|({c}))({s})?".format( diff --git a/spacy/tests/hu/test_tokenizer.py b/spacy/tests/hu/test_tokenizer.py index c08511c1b..e091f1914 100644 --- a/spacy/tests/hu/test_tokenizer.py +++ b/spacy/tests/hu/test_tokenizer.py @@ -94,7 +94,7 @@ NUMBER_TESTS = [ ('A 2<3 van.', ['A', '2<3', 'van', '.']), ('A 2=3 van.', ['A', '2=3', 'van', '.']), ('A 2÷3 van.', ['A', '2÷3', 'van', '.']), - ('A (2÷3)-2/5=1 van.', ['A', '(2÷3)-2/5=1', 'van', '.']), + ('A 1=(2÷3)-2/5 van.', ['A', '1=(2÷3)-2/5', 'van', '.']), ('A 2 +3 van.', ['A', '2', '+3', 'van', '.']), ('A 2+ 3 van.', ['A', '2', '+', '3', 'van', '.']), ('A 2 + 3 van.', ['A', '2', '+', '3', 'van', '.']),