Hello all,
I've been set a lab assignment and am really struggling to get to grips with it. The aim to to create a "grass-roots" program that doesn't make heavy use of built in functions. Namely "string.replace()" in this case!
Any ideas as to why the below code doesn't work? I've been playing around with it for a while now to no avail.. Just some background though, I only started Python a couple of weeks ago so please be gentle!
def removeStopWords(text_input):
line_stop_words = []
stop_words = "a","It","i","it","am","at","on","in","of","to","is","so","too","my","The","the","and","but","are","very","here","even","from","them","then","than","this","that","though"
word = ""
for word in text_input:
word_list = string.split(text_input)
new_string = ""
for word in word_list:
if word not in stop_words:
new_string = new_string + word + " "
new_string = string.split(new_string)
line_stop_words = line_stop_words + [new_string]
return(line_stop_words)
Cheers,