mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-18 20:22:25 +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
|
||||
for ii in range(1, max_span_width):
|
||||
ei = tok.i + ii # end index
|
||||
|
||||
# Note: this matches slice syntax, so the token index is one less
|
||||
if ei > len(doc) or sentence_map[ei - 1] != si:
|
||||
continue
|
||||
break
|
||||
|
||||
begins.append(tok.i)
|
||||
ends.append(ei)
|
||||
|
|
Loading…
Reference in New Issue
Block a user