mirror of https://github.com/explosion/spaCy.git
Fix typo (see #3681)
This commit is contained in:
parent
f2a56c1b56
commit
f8fce6c03c
|
@ -42,7 +42,7 @@ def filter_spans(spans, prefer_longest=True):
|
||||||
sorted_spans = sorted(spans, key=get_sort_key, reverse=prefer_longest)
|
sorted_spans = sorted(spans, key=get_sort_key, reverse=prefer_longest)
|
||||||
result = []
|
result = []
|
||||||
seen_tokens = set()
|
seen_tokens = set()
|
||||||
for span in spans:
|
for span in sorted_spans:
|
||||||
if span.start not in seen_tokens and span.end - 1 not in seen_tokens:
|
if span.start not in seen_tokens and span.end - 1 not in seen_tokens:
|
||||||
result.append(span)
|
result.append(span)
|
||||||
seen_tokens.update(range(span.start, span.end))
|
seen_tokens.update(range(span.start, span.end))
|
||||||
|
|
Loading…
Reference in New Issue