Created
August 23, 2013 23:40
-
-
Save monajalal/6325022 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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