I tried writing this code:
def stopWords(text, stopwords):
stopwords = map(to_lower(x),stopwords)
pattern = '/[0-9\W]/'
text = re.sub(pattern, ',', text)
text_array = text.partition(',');
text_array = map(to_lower(x), text_array);
keywords = []
for term in text_array:
if(term in stopwords):
keywords.append(term)
return filter(None, keywords)
stopwords = open('stop_words.txt','r').read()
text = "All words in the English language can be classified as one of the eight different parts of speech."
print(stopWords(text, stopwords))
But I get an error that says IndentationError: unindent does not match any outer indentation level. What i am doing wrong?
for term in text_array:ends the function?{and}and the indentation of the code is optional. In Python the indentation of the code defines the code structure.