Skip to content

Commit

Permalink
fix(linker): fix start of span to split
Browse files Browse the repository at this point in the history
  • Loading branch information
nsantacruz committed Jul 4, 2024
1 parent bc5fffb commit d03a961
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sefaria/model/linker/ref_part.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def split_part(self, part: RawRefPart, str_end) -> Tuple['RawRef', RawRefPart, R
"""
start_char, end_char = span_char_inds(part.span)
pivot = len(part.text) - len(str_end) + start_char
aspan = part.span.doc.char_span(0, pivot, alignment_mode='contract')
aspan = part.span.doc.char_span(start_char, pivot, alignment_mode='contract')
bspan = part.span.doc.char_span(pivot, end_char, alignment_mode='contract')
if aspan is None or bspan is None:
raise InputError(f"Couldn't break on token boundaries for strings '{self.text[0:pivot]}' and '{self.text[pivot:end_char]}'")
Expand Down

0 comments on commit d03a961

Please sign in to comment.