I am a newbie to python programming. I have two lists, the first list containing stopwords while the other containing the text document. I want to replace the stop words in the text document with "/". Is there anyone that could help?
I have used the replace function, it was giving an error
text = "This is an example showing off word filtration"
stop = `set`(stopwords.words("english"))
text = nltk.word_tokenize(document)
`for` word in stop:
text = text.replace(stop, "/")
`print`(text)
It should output "/ / / example showing / word filtration"