Porterstemmer:在Spyder上运行时无茎输出或错误



在我的Spyder的屏幕截图和以下代码中很明显,我没有任何输出或任何错误。我想念什么?:

import nltk
from nltk.stem import PorterStemmer
paragraph = "The Times of India issued its first edition on 3 November 
             1838 as The Bombay Times and Journal of Commerce.[13][14] 
             The paper published Wednesdays and Saturdays under the 
             direction of Raobahadur Narayan Dinanath Velkar, a 
             Maharashtrian Reformist, and contained news from Britain and the world, as well as the Indian Subcontinent. J.E. Brennan was its first editor.[15][16] In 1850, it began to publish 
             daily editions."
sentences = nltk.sent_tokenize(paragraph)
stemmer = PorterStemmer()
for i in range(len(sentences)):
    words = nltk.word_tokenize(sentences[i])
    newwords = [stemmer.stem(word) for word in words]
    sentences[i] = ' '.join(newwords)    

谢谢@prashant rana我的屁股是单击帮助而不是变量Explorer

最新更新