In the online version of the book, in Chapter 7.6 the final "Your Turn" note contains some errors. The book reads:
print(rtuple(rel, lcon=True, rcon=True))
But this will throw an error, since rtuple is not recognized. Replacing rtuple with nltk.rtuple fixed the issue.
Also, in the code instead of rel we write r, so the variable name will also cause an issue.
I believe the following line does the trick (it works for me):
print(nltk.rtuple(r, lcon=True, rcon=True))
Hey @MrDupin , I just made a PR in the nltk/nltk_book repo to fix this.
Thanks again @campionfellin for the fixes! It's merged on nltk_book =)
Most helpful comment
Thanks again @campionfellin for the fixes! It's merged on
nltk_book=)