Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hrctweet = 'RT @HillaryforIA: The #iacaucus starts in 24 hours! #ImWithHer https://t.co/bF5fyfKbFt'
- def splitter(text, stop_words, stop_prefixes):
- simpletext = []
- newlist = text.split(' ')
- for phrase in newlist:
- simpletext.append((phrase.lower()).strip(PUNCTUATION))
- auxlist1 = simpletext
- for word in auxlist1:
- for stopper in STOP_WORDS[stop_words]:
- if word == stopper:
- del simpletext[simpletext.index(word)]
- print(simpletext)
- auxlist2 = simpletext
- for word in auxlist2:
- print(word)
- for stopfix in STOP_PREFIXES[stop_prefixes]:
- print(stopfix)
- if word.startswith(stopfix) == True:
- print(word)
- print(stopfix)
- print(simpletext.index(word))
- # del simpletext[simpletext.index(word)]
- return simpletext
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement