mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-19 04:32:32 +03:00
Minor speedup
This continue should be a break. The current form doesn't cause errors but using a break will be a bit faster.
This commit is contained in:
parent
a151c62d13
commit
1d1679d431
|
@ -128,9 +128,10 @@ def get_candidate_mentions(
|
||||||
si = sentence_map[tok.i] # sentence index
|
si = sentence_map[tok.i] # sentence index
|
||||||
for ii in range(1, max_span_width):
|
for ii in range(1, max_span_width):
|
||||||
ei = tok.i + ii # end index
|
ei = tok.i + ii # end index
|
||||||
|
|
||||||
# Note: this matches slice syntax, so the token index is one less
|
# Note: this matches slice syntax, so the token index is one less
|
||||||
if ei > len(doc) or sentence_map[ei - 1] != si:
|
if ei > len(doc) or sentence_map[ei - 1] != si:
|
||||||
continue
|
break
|
||||||
|
|
||||||
begins.append(tok.i)
|
begins.append(tok.i)
|
||||||
ends.append(ei)
|
ends.append(ei)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user