mirror of https://github.com/explosion/spaCy.git
Add update_exc util function
This commit is contained in:
parent
1256232fad
commit
66c7348cda
|
@ -108,6 +108,12 @@ def compile_infix_regex(entries):
|
||||||
return re.compile(expression)
|
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):
|
def normalize_slice(length, start, stop, step=None):
|
||||||
if not (step is None or step == 1):
|
if not (step is None or step == 1):
|
||||||
raise ValueError("Stepped slices not supported in Span objects."
|
raise ValueError("Stepped slices not supported in Span objects."
|
||||||
|
|
Loading…
Reference in New Issue