Nltk: Error in Online Book - Chapter 7.6

Created on 27 Sep 2017  路  2Comments  路  Source: nltk/nltk

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))

admin book resolved

Most helpful comment

Thanks again @campionfellin for the fixes! It's merged on nltk_book =)

All 2 comments

Hey @MrDupin , I just made a PR in the nltk/nltk_book repo to fix this.

https://github.com/nltk/nltk_book/pull/202

Thanks again @campionfellin for the fixes! It's merged on nltk_book =)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

talbaumel picture talbaumel  路  4Comments

alvations picture alvations  路  4Comments

jeryini picture jeryini  路  5Comments

BLKSerene picture BLKSerene  路  4Comments

goodmami picture goodmami  路  4Comments