Python NLTK:不能使用generate()函数

Ole*_*bno 4 python nltk

我不应该得到这个错误.这已经成功了,任何教程都以同样的方式解决了这个问题并且它有效.请帮忙.

import nltk 
from nltk.book import *

text3.generate()
Run Code Online (Sandbox Code Playgroud)
AttributeError                            Traceback (most recent call last)
<ipython-input-2-e0816ba18b61> in <module>()
----> 1 text3.generate()

AttributeError: 'Text' object has no attribute 'generate'
Run Code Online (Sandbox Code Playgroud)

print sys.version #my python version 2.7.8 | Anaconda 2.0.1(x86_64)| (默认,2014年8月21日,15:21:46)[GCC 4.2.1(Apple Inc. build 5577)]

Nim*_*ush 11

NLTK书的第一个在线章节中的第四个注释说:

generate()方法在NLTK 3.0中不可用,但将在后续版本中恢复