Remove redundant strings.add for Doc.char_span (#12429)

This commit is contained in:
Adriane Boyd 2023-04-03 11:38:56 +02:00
parent a5406a6c45
commit 0ec4dc5c29

View File

@ -544,10 +544,6 @@ cdef class Doc:
DOCS: https://spacy.io/api/doc#char_span
"""
if not isinstance(label, int):
label = self.vocab.strings.add(label)
if not isinstance(kb_id, int):
kb_id = self.vocab.strings.add(kb_id)
alignment_modes = ("strict", "contract", "expand")
if alignment_mode not in alignment_modes:
raise ValueError(