Skip to content

Instantly share code, notes, and snippets.

@monajalal
Created August 23, 2013 23:40
Show Gist options
  • Save monajalal/6325022 to your computer and use it in GitHub Desktop.
Save monajalal/6325022 to your computer and use it in GitHub Desktop.
def remove_all_similar_words(array, word):
new_array=[]
for i in range(0,len(array)):
if array[i] !=word :
new_array.append(array[i])
return new_array
def remove_stopwords(query, stopwords):
for search in stopwords:
for word in query:
if str(word)==search:
query=remove_all_similar_words(query,word)
print "\n".join(query)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment