Skip to content

token differs from token.string, in some cases token.string contains a trailing space while token does not #5504

Discussion options

You must be logged in to vote

Token.string was deprecated a while ago in favor of Token.text_with_ws, probably in part due to this confusion. I'd recommend using Token.text and Token.text_with_ws instead. Token.text_with_ws includes a trailing whitespace if the token is followed by a space in the original text.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / doc Feature: Doc, Span and Token objects
2 participants
Converted from issue

This discussion was converted from issue #5504 on December 11, 2020 00:21.