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:
Paul O'Leary McCann 2021-07-21 19:50:10 +09:00
parent a151c62d13
commit 1d1679d431

View File

@ -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)