Tokenisation with Spacy - how to get tokens to the left/right of token
the token.lefts and token.rights attributes return a generator of the immediate children of the word, in the syntactic dependency parse. It does not just return the tokens on the left and right of the given token.

see : https://spacy.io/api/token#rights

If you want the adjacent tokens for a doc, you can do :

for i in range(len(doc))[1:-1]:
    print(doc[i-1], doc[i+1])


It will print the adjacent tokens for all tokens of the doc, starting at the 2nd token and finishing at the penultimate one.