Repository navigation
index attribute for sentences #4899
Locked
Answered
by
svlandeg
jack-rory-staunton
asked this question in
Help: Coding & Implementations
Feature descriptionAlthough technically they are Spans (which do not have indices per se), it would be nice to somehow access the indices of a Doc's sentences: perhaps by having the generator supply a tuple containing the index. |
Answered by
svlandeg
Jan 12, 2020
Replies: 2 comments
|
Sentences aren't internally stored as a list, so providing an index in the What you could do though, is loop through all the sentences in |
0 replies
Answer selected by
ines
|
I'll do that - thanks! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sentences aren't internally stored as a list, so providing an index in the
docis not straightforward and implementing a function like this would not be efficient.What you could do though, is loop through all the sentences in
list(doc.sents)once, set a custom extension to the correspondingSpan, and use that in your other functions.