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
for example…In my word_list…I have “love does not make the world go round. love is what makes the ride worthwhile”
I want to print out all word that not in stop word…
but it print out only love, make, go, round, love, makes, worthwhile…….Word “world, ride” is not print out..Anyone know how to solve it? Thank you…
If you change
word_list, so that it is a list of words, it works fine.word_listwill contain the words you are after.