diff --git a/spacy/util.py b/spacy/util.py index afed4142e..592f8e9dd 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -108,6 +108,12 @@ def compile_infix_regex(entries): return re.compile(expression) +def update_exc(exc, additions): + overlap = set(exc.keys()).intersection(set(additions)) + assert not overlap, overlap + exc.update(additions) + + def normalize_slice(length, start, stop, step=None): if not (step is None or step == 1): raise ValueError("Stepped slices not supported in Span objects."