Skip to content

Is it possible to get the offsets of sentences in the text? #71

Discussion options

You must be logged in to vote

Hi @hehuan2112

Sure, you can use its.span for sentence offsets.

const sentences = doc.sentences().out( its.span );

returns the following

[ [ 0, 4 ], [ 5, 9 ], [ 10, 14 ] ]

Thanks

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@rachnachakraborty
Comment options

@hehuan2112
Comment options

Answer selected by hehuan2112
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants