word_list = "love does not make the world go round. love is what makes the ride worthwhile"
from nltk.corpus import stopwords
for word in word_list:
#print word
if word in stopwords.words('english'):
#print word #print out stopword for checking
word_list.remove(word)
else:
print word
例如......在我的word_list中......我有“爱不会让世界运转。爱是让骑行值得的东西”
我想打印出所有不在停用词中的单词...
但它只打印出love,make,go,round,love,makes,worthy.......“世界,骑行”这个词没有打印出来......有人知道如何解决吗?谢谢...